Commit 0097904a authored by Michael Quigley's avatar Michael Quigley
Browse files

Cleaned up comments a little bit.

parent d520b142
Pipeline #1214 skipped
......@@ -68,7 +68,7 @@ LIBASYNC_FUNC_ATTR
awe_mapper_remove_id(uint32_t id)
{
awe_table_t *awe_map = get_awe_map();
// BUG_ON(unlikely(id >= AWE_TABLE_COUNT));
BUG_ON(unlikely(id >= AWE_TABLE_COUNT));
if( awe_map->used_slots > 0 )
{
......@@ -86,7 +86,7 @@ LIBASYNC_FUNC_ATTR
awe_mapper_set_id(uint32_t id, void* awe_ptr)
{
awe_table_t *awe_map = get_awe_map();
// BUG_ON(unlikely(id >= AWE_TABLE_COUNT));
BUG_ON(unlikely(id >= AWE_TABLE_COUNT));
(awe_map->awe_list)[id] = awe_ptr;
}
......@@ -100,8 +100,8 @@ LIBASYNC_FUNC_ATTR
awe_mapper_get_awe_ptr(uint32_t id)
{
awe_table_t *awe_map = get_awe_map();
// if (id >= AWE_TABLE_COUNT)
// return NULL;
if (id >= AWE_TABLE_COUNT)
return NULL;
return awe_map->awe_list[id];
}
......
......@@ -326,10 +326,13 @@ int THCShouldStop(void);
// marker we can walk back to.)
void THCAbort(void);
// Yields and saves awe_ptr to correspond to the provided id number
//Yields and saves AWE for continuation (associates it with an id using
//the awe_mapper).
void THCYieldAndSave(uint32_t id_num);
//Yields and saves awe_ptr, but does will not put current AWE in dispatch queue.
//Yields and saves AWE for continuation (associates it with an id using
//the awe_mapper),but will not put AWE for the continuation in the dispatch
//queue.
void THCYieldAndSaveNoDispatch(uint32_t id_num);
// Finish the current AWE, creating a new AWE from its continuation, and
......@@ -365,9 +368,11 @@ int THCYieldToId(uint32_t id_to);
//Also assumes the AWE that is being yielded to is not in the dispatch queue.
int THCYieldToIdNoDispatch(uint32_t id_to);
//Same as THCYieldToIdNoDispatch except that it assumes the caller should be put in the dispatch loop
//(but that the AWE beign yielded to is not in the dispatch loop)
//Same as THCYieldToIdNoDispatch except that it assumes the caller should
//be put in the dispatch queue (but that the AWE being yielded to is not
//in the dispatch queue).
int THCYieldToIdNoDispatch_TopLevel(uint32_t id_to);
// Cancellation actions. These are executed in LIFO order when cancellation
// occurs. Once cancellation has been requested, it is assumed that no
// further cancellation actions will be added. Cancellation actions can be
......
......@@ -175,23 +175,6 @@ static int thread_fn(void* data)
return ret;
}
static void print_max(unsigned long* arr)
{
int max_iter = 0;
unsigned long max_num = 0;
int i = 0;
for(i = 0; i < NUM_SWITCH_MEASUREMENTS; i++)
{
if( arr[i] > max_num )
{
max_num = arr[i];
max_iter = i;
}
}
printk(KERN_ERR "\nmax_num = %lu, max iter = %d\n\n", max_num, max_iter);
}
static int run_test_fn_thread(int (*fn)(void))
{
int ret;
......@@ -215,9 +198,9 @@ static int run_test_fn_thread(int (*fn)(void))
printk(KERN_ERR "Error waiting for thread.\n");
}
printk(KERN_ERR "\nTiming results for context switches (ignoring rdtsc timer overhead):\n");
test_fipc_dump_time(ctx_measurements_arr, NUM_SWITCH_MEASUREMENTS);
print_max(thd_measurements_arr);
printk(KERN_ERR "\nTiming results for thread creation:\n");
printk(KERN_ERR "\nTiming results for thread creation (ignoring rdtsc timer overhead):\n");
test_fipc_dump_time(thd_measurements_arr, NUM_SWITCH_MEASUREMENTS);
printk(KERN_ERR "\n\n");
......@@ -242,11 +225,9 @@ static int run_test_fn_nothread(int (*fn)(void))
goto fail1;
}
printk(KERN_ERR "\nTiming results for context switches:\n");
print_max(ctx_measurements_arr);
printk(KERN_ERR "\nTiming results for context switches (ignoring rdtsc overhead):\n");
test_fipc_dump_time(ctx_measurements_arr, NUM_SWITCH_MEASUREMENTS);
printk(KERN_ERR "\nTiming results for thread creation:\n");
print_max(thd_measurements_arr);
printk(KERN_ERR "\nTiming results for thread creation (ignoring rdtsc overhead):\n");
test_fipc_dump_time(thd_measurements_arr, NUM_SWITCH_MEASUREMENTS);
printk(KERN_ERR "\n\n");
......@@ -266,16 +247,16 @@ static int test_fn(void)
if( USE_OTHER_CORE )
{
printk(KERN_ERR "\n\nTesting no dispatch\n");
printk(KERN_ERR "\n\nTesting no dispatch yields\n");
ret = run_test_fn_thread(test_ctx_switch_and_thd_creation_no_dispatch);
printk(KERN_ERR "\n\nTesting with dispatch\n");
printk(KERN_ERR "\n\nTesting with dispatch yields\n");
ret |= run_test_fn_thread(test_ctx_switch_and_thd_creation);
}
else
{
printk(KERN_ERR "\n\nTesting no dispatch\n");
printk(KERN_ERR "\n\nTesting no dispatch yields\n");
ret = run_test_fn_nothread(test_ctx_switch_and_thd_creation_no_dispatch);
printk(KERN_ERR "\n\nTesting with dispatch\n");
printk(KERN_ERR "\n\nTesting with dispatch yields\n");
ret |= run_test_fn_nothread(test_ctx_switch_and_thd_creation);
}
......
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