From 4d1751f98b8db9c93da760d00b1cd150b5428ca9 Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 17 Aug 2008 18:51:16 +0000 Subject: [PATCH] update test git-svn-id: http://ltt.polymtl.ca/svn@3029 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/tests/kernel/test-fair-rwlock.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/trunk/tests/kernel/test-fair-rwlock.c b/trunk/tests/kernel/test-fair-rwlock.c index 109851ff..2cc1ba63 100644 --- a/trunk/tests/kernel/test-fair-rwlock.c +++ b/trunk/tests/kernel/test-fair-rwlock.c @@ -47,8 +47,11 @@ #define NR_INTERRUPT_READERS 1 #define NR_TRYLOCK_INTERRUPT_READERS 1 -/* Writer iteration delay, in ms. 0 for busy loop. */ -#define WRITER_DELAY 1 +/* + * Writer iteration delay, in us. 0 for busy loop. Caution : writers can + * starve readers. + */ +#define WRITER_DELAY 10 static int var[NR_VARS]; static struct task_struct *reader_threads[NR_READERS]; @@ -252,7 +255,7 @@ static int writer_thread(void *data) fair_write_unlock_irq(&frwlock); preempt_enable(); /* for get_cycles accuracy */ if (WRITER_DELAY > 0) - msleep(WRITER_DELAY); + udelay(WRITER_DELAY); } while (!kthread_should_stop()); printk("writer_thread/%lu iterations : %lu, " "max contention %llu cycles\n", @@ -282,7 +285,7 @@ static int trylock_writer_thread(void *data) //fair_write_unlock(&frwlock); fair_write_unlock_irq(&frwlock); if (WRITER_DELAY > 0) - msleep(WRITER_DELAY); + udelay(WRITER_DELAY); } while (!kthread_should_stop()); printk("trylock_writer_thread/%lu iterations : %lu, " "successful iterations : %lu\n", -- 2.34.1