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

Preliminary results for async test. I still need to figure out why there can't...

Preliminary results for async test. I still need to figure out why there can't be two yields in an async block or how to fix it.
parent 68af7d9f
......@@ -227,7 +227,7 @@ noinline struct ipc_message *async_recv(struct ttd_ring_channel *rx, unsigned lo
}
else
{
THCYield();
//THCYield();
}
}
......
......@@ -92,10 +92,15 @@ static unsigned long add_nums_async(unsigned long trans, unsigned long res1, awe
msg->fn_type = ADD_NUMS;
msg->reg1 = trans;
msg->reg2 = res1;
msg->reg3 = res1;
msg->reg4 = res1;
msg->reg5 = res1;
msg->reg6 = res1;
msg->msg_id = msg_id;
send(channel,msg);
//msg = recv(channel);
msg = async_recv(channel, msg_id);
printk(KERN_ERR "result = %lx\n", msg->reg1);
result = msg->reg1;
transaction_complete(msg);
......@@ -201,22 +206,21 @@ static void test_async_ipc(void* chan)
thc_latch_init(&(current->ptstate->latch));
thc_init();
get_random_bytes(&res1, sizeof(res1));
res1 = 1;
res2 = res1+res1;
res3 = res1 + res2;
res4 = res3 + res2;
res5 = res4 + res3;
DO_FINISH(
// while (num_transactions < ASYNC_TRANSACTIONS) {
// start = RDTSC_START();
ASYNC(add_nums_async(num_transactions, res1, awe););
// printk(KERN_ERR "middle of async");
// ASYNC(add_nums_async(num_transactions + 1, res1, awe););
// end = RDTSCP();
// pr_err("%lu\n", end-start);
// num_transactions++;
// });
);
while (num_transactions < TRANSACTIONS) {
start = RDTSC_START();
ASYNC(add_nums_async(num_transactions, 1, awe););
end = RDTSCP();
pr_err("%lu\n", end-start);
num_transactions++;
});
pr_err("Complete\n");
printk(KERN_ERR "lcd async exiting module and deleting ptstate");
thc_done();
......@@ -280,9 +284,9 @@ noinline void foo4(void) {
int callee(void *chan)
{
// test_async_ipc(chan);
test_async_ipc(chan);
test_sync_ipc(chan);
// test_sync_ipc(chan);
/*
current->ptstate = kzalloc(sizeof(struct ptstate_t), GFP_KERNEL);
thc_latch_init(&(current->ptstate->latch));
......
......@@ -51,10 +51,13 @@ int caller(void *channel)
unsigned long num_transactions = 0;
unsigned long temp_res = 0;
unsigned long msg_id = 0;
struct ttd_ring_channel *chan = channel;
struct ipc_message *msg;
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:
......@@ -78,6 +81,7 @@ int caller(void *channel)
transaction_complete(msg);
msg = get_send_slot(chan);
msg->fn_type = ADD_NUMS;
msg->msg_id = msg_id;
msg->reg1 = temp_res;
send(chan, msg);
break;
......
......@@ -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 12000
#define TRANSACTIONS 20 //12000
int callee(void *chan);
......
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