Commit af0c0bee authored by Michael Quigley's avatar Michael Quigley
Browse files

still trying to figure out why code crashes when put inside kernel thread....

still trying to figure out why code crashes when put inside kernel thread. CHenged code so that a sanity check is performed with the original async code inside a kernel thread
parent f1594eac
......@@ -222,12 +222,12 @@ noinline struct ipc_message *async_recv(struct ttd_ring_channel *rx, unsigned lo
else
{
awe_t* other_awe = get_awe_from_msg_id(msg_id);
THCYield(); //THCYieldTo(other_awe);
break;//THCYield(); //THCYieldTo(other_awe);
}
}
else
{
//THCYield();
THCYield();
}
}
......
obj-m := rpc_testing.o
ccflags-y += -O2 -I/users/mquigley/fast-ipc-module/current/IPC
EXTRA_CFLAGS=-DDEBUG_OUTPUT
INC_DIR = ../../IPC
CFLAGS_ipc.o = -O2 -DPOLL
CFLAGS_ring-channel.o = -I$(INC_DIR)
......
......@@ -87,7 +87,6 @@ static unsigned long add_nums_async(unsigned long trans, unsigned long res1, awe
unsigned long result;
unsigned long msg_id = (unsigned long)awe;
pr_err("msg id = %lx\n", msg_id);
msg = get_send_slot(channel);
msg->fn_type = ADD_NUMS;
msg->reg1 = trans;
......@@ -212,13 +211,14 @@ static void test_async_ipc(void* chan)
res4 = res3 + res2;
res5 = res4 + res3;
DO_FINISH(
while (num_transactions < TRANSACTIONS) {
start = RDTSC_START();
while (num_transactions < TRANSACTIONS / 3) {
// start = RDTSC_START();
ASYNC(add_nums_async(num_transactions, 1, awe););
end = RDTSCP();
pr_err("%lu\n", end-start);
ASYNC(add_nums_async(num_transactions, 2, awe););
ASYNC(add_nums_async(num_transactions, 3, awe););
// end = RDTSCP();
// pr_err("%lu\n", end-start);
num_transactions++;
});
pr_err("Complete\n");
......@@ -284,19 +284,19 @@ noinline void foo4(void) {
int callee(void *chan)
{
test_async_ipc(chan);
// test_async_ipc(chan);
// test_sync_ipc(chan);
/*
current->ptstate = kzalloc(sizeof(struct ptstate_t), GFP_KERNEL);
thc_latch_init(&(current->ptstate->latch));
//current->ptstate = kzalloc(sizeof(struct ptstate_t), GFP_KERNEL);
//thc_latch_init(&(current->ptstate->latch));
thc_init();
//assert((PTS() == NULL) && "PTS already initialized");
printk(KERN_ERR "lcd async entering module ptstate allocated");
DO_FINISH(ASYNC(foo3();); printk(KERN_ERR "lcd async apit_init coming back\n"); ASYNC(foo4();););
DO_FINISH(ASYNC(foo3();); ASYNC(foo4();););
//printk(KERN_ERR "lcd async apit_init coming back\n");
printk(KERN_ERR "lcd async end of DO_FINISH");
printk(KERN_ERR "lcd async exiting module and deleting ptstate");
thc_done();
kfree(current->ptstate);*/
kfree(current->ptstate);
return 1;
}
......@@ -57,7 +57,6 @@ int caller(void *channel)
while (num_transactions < TRANSACTIONS) {
msg = recv(chan);
msg_id = msg->msg_id;
printk(KERN_ERR "recv regs:\n 0x%lx\n 0x%lx\n 0x%lx\n 0x%lx\n 0x%lx\n 0x%lx\n status = 0x%lx\n", msg->reg1, msg->reg2, msg->reg3, msg->reg4, msg->reg5, msg->reg6, msg->msg_status);
switch(msg->fn_type) {
case NULL_INVOCATION:
......
......@@ -6,7 +6,7 @@ typedef enum {NULL_INVOCATION, ADD_CONSTANT, ADD_NUMS, ADD_3_NUMS,
ADD_4_NUMS, ADD_5_NUMS, ADD_6_NUMS} fn_types;
/* must be divisible by 6... because I call 6 functions in the Callee.c */
#define TRANSACTIONS 20 //12000
#define TRANSACTIONS 0 //12000
int callee(void *chan);
......
......@@ -55,10 +55,9 @@ static void setup_tests(void)
kfree(chan2);
return;
}
ipc_start_thread(chan1);
ipc_start_thread(chan2);
//callee(NULL);
// ipc_start_thread(chan2);
// callee(NULL);
}
static int __init rpc_init(void)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment