Commit 01b7a15d authored by Scotty Bauer's avatar Scotty Bauer

This setup is for FLOOD tests with pause instruction, CPU is set @ 2.4ghz back...

This setup is for FLOOD tests with pause instruction, CPU is set @ 2.4ghz back down to what userland produces, 320-380 cycles, all the way to 60 cycles Round trip for 64 message flood
Signed-off-by: Scotty Bauer's avatarScotty Bauer <sbauer@eng.utah.edu>
parent fed33415
......@@ -3,8 +3,8 @@ obj-m := test.o
#CFLAGS_betaModule2.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall
#CFLAGS_ring-channel.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall
CFLAGS_test.o = -O2 -DPOLL #-DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_betaModule2.o = -O2 -DPOLL #-DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_test.o = -O2 -DPOLL -DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_betaModule2.o = -O2 -DPOLL -DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_ring-channel.o = -O2
......
......@@ -202,7 +202,7 @@ static int ipc_thread_func(void *input)
struct ipc_message *prod_msg, *cons_msg;
unsigned int pTok = 0xC1346BAD;
unsigned int cTok = 0xBADBEEF;
int i;
if (filep == NULL) {
pr_debug("Thread was sent a null filepointer!\n");
......@@ -240,39 +240,32 @@ static int ipc_thread_func(void *input)
while (count < NUM_LOOPS * FLOOD_SIZE) {
#endif
/* wait and get message */
//wait_for_consumer_slot(cons_msg, cTok);
wait_for_consumer_slot(cons_msg, cTok);
//if (wait_for_consumer_slot(cons_channel, local_cons, &imsg, cTok))
// break;
/* NOTIFY RECEVD */
while(cons_msg->monitor != cTok)
cpu_relax();
//cons_msg->monitor = pTok;
cons_msg->monitor = pTok;
//pr_debug("Notified recvd on CPU %d at volatile location %p\n",
// CPU_NUM, &cons_msg->monitor);
//if(imsg->message[3] != '1') {
// pr_err("message wasnt 1 it was %c and monitor is %u\n",
// imsg->message[3], imsg->monitor);
//}
//if(cons_msg->message[3] != '1')
// pr_err("message on slave wasnt whjat we expected \n");
/* wait and get writer slot*/
//wait_for_producer_slot(prod_msg, pTok);
while(prod_msg->monitor != pTok)
cpu_relax();
//imsg->message[0] = 'b';
//imsg->message[1] = 'e';
//imsg->message[2] = 't';
//imsg->message[3] = '2';
wait_for_producer_slot(prod_msg, pTok);
//prod_msg->message[0] = 'b';
//prod_msg->message[1] = 'e';
//prod_msg->message[2] = 't';
//prod_msg->message[3] = '2';
prod_msg->monitor = cTok;
//local_prod++;
//local_cons++;
//prod_msg = get_next_available_slot(prod_channel, local_prod);
//cons_msg = get_next_available_slot(cons_channel, local_cons);
prod_msg++;
cons_msg++;
local_prod++;
local_cons++;
prod_msg = get_next_available_slot(prod_channel, local_prod);
cons_msg = get_next_available_slot(cons_channel, local_cons);
count++;
}
preempt_enable();
local_irq_restore(flags);
......@@ -336,6 +329,7 @@ static unsigned long beta_connect_mem(struct ipc_container *container,
static unsigned long beta_alloc_mem(struct ipc_container *container)
{
int ret;
int i;
if (container->channel_tx == NULL)
return -EINVAL;
......@@ -353,7 +347,7 @@ static unsigned long beta_alloc_mem(struct ipc_container *container)
start = (unsigned long) container->channel_tx->recs;
end = (unsigned long) container->channel_tx->recs + (CHAN_NUM_PAGES * PAGE_SIZE);
int i;
for(i = 0; i < (CHAN_NUM_PAGES * PAGE_SIZE)/sizeof(int); i++)
*((int *)container->channel_tx->recs+i) = 0xC1346BAD;
//memseta(container->channel_tx->recs, 0, (CHAN_NUM_PAGES * PAGE_SIZE));
......
......@@ -3,8 +3,8 @@ obj-m := betaModule1.o
#CFLAGS_betaModule.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall
#CFLAGS_ring-channel.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall
CFLAGS_betaModule1.o = -g -O2 -DPOLL -DTIMING #-DUSE_FLOOD #-DDEBUG #-DDEBUG_MWAIT_RETRY
CFLAGS_betaModule.o = -g -O2 -DPOLL -DTIMING #-DUSE_FLOOD #-DDEBUG #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_betaModule1.o = -g -O2 -DPOLL -DTIMING -DUSE_FLOOD #-DDEBUG #-DDEBUG_MWAIT_RETRY
CFLAGS_betaModule.o = -g -O2 -DPOLL -DTIMING -DUSE_FLOOD #-DDEBUG #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_ring-channel.o = -g -O2
betaModule1-objs := ./ring-chan/ring-channel.o ./betaModule.o
......
......@@ -279,21 +279,15 @@ static int ipc_thread_func(void *input)
#if defined(USE_FLOOD)
for (i = 0; i < FLOOD_SIZE; i++) {
#endif
wait_for_producer_slot(prod_msg, pTok);
//ptok = 0xC1346BAD;
//__builtin_prefetch(cons_msg, 1, 1);
//wait_for_producer_slot(prod_msg, pTok);
while(prod_msg->monitor != pTok)
cpu_relax();
//imsg->message[0] = 'b';
//imsg->message[1] = 'e';
//imsg->message[2] = 't';
//imsg->message[3] = '1';
//prod_msg->message[0] = 'b';
//prod_msg->message[1] = 'e';
//prod_msg->message[2] = 't';
//prod_msg->message[3] = '1';
prod_msg->monitor = cTok;
//local_prod++;
local_prod++;
#if defined(USE_FLOOD)
prod_msg = get_next_available_slot(prod_channel, local_prod);
}
......@@ -301,24 +295,21 @@ static int ipc_thread_func(void *input)
for (i = 0; i < FLOOD_SIZE; i++) {
#endif
//wait_for_consumer_slot(cons_msg, cTok);
while(cons_msg->monitor != cTok)
cpu_relax();
/* ack the msg */
//cons_msg->monitor = pTok;
// local_cons++;
wait_for_consumer_slot(cons_msg, cTok);
//if(cons_msg->message[3] != '2')
//pr_err("MESSAGE WASNT WHAT WE WANTED ON BETA 1\n");
/* ack the msg */
cons_msg->monitor = pTok;
local_cons++;
#if defined(USE_FLOOD)
cons_msg = get_next_available_slot(cons_channel, local_cons);
cons_msg = get_next_available_slot(cons_channel, local_cons);
}
#endif
end64 = RDTSCP();
#if !defined(USE_FLOOD)
//prod_msg = get_next_available_slot(prod_channel, local_prod);
//cons_msg = get_next_available_slot(cons_channel, local_cons);
prod_msg++;
cons_msg++;
prod_msg = get_next_available_slot(prod_channel, local_prod);
cons_msg = get_next_available_slot(cons_channel, local_cons);
#endif
count++;
......@@ -531,7 +522,7 @@ static void dump_time(void)
counter+= timekeeper[i];
}
pr_err("MIN\tMAX\tAVG\tMEDIAN\n");
pr_err("%llu & %llu & %llu & %llu\n", min, max, counter/NUM_LOOPS, timekeeper[4999]);
pr_err("%llu & %llu & %llu & %llu \n", min, max, counter/NUM_LOOPS, timekeeper[4999]);
}
......
#include <linux/types.h>
int CHAN_NUM_PAGES = 256;
int BUF_SIZE = 60;
int CHAN_NUM_PAGES = 16;
int BUF_SIZE = 124;
int NUM_LOOPS = 10000;
int FLOOD_SIZE = 64;
int FLOOD_SIZE = 1;
#if defined(USE_MWAIT)
unsigned long ecx = 1; /*break of interrupt flag */
......@@ -21,7 +21,7 @@ struct ipc_container{
/*Don't let gcc do anything cute, we need this to be 128 bytes */
struct ipc_message{
char message[60];
char message[124];
volatile uint32_t monitor;
}__attribute__((packed));
......
Markdown is supported
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