From 89889f86dbec971e9c56b4dc5209903f052b6d1a Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 17 Aug 2008 07:01:38 +0000 Subject: [PATCH] update test git-svn-id: http://ltt.polymtl.ca/svn@3026 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/tests/kernel/test-fair-rwlock.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/trunk/tests/kernel/test-fair-rwlock.c b/trunk/tests/kernel/test-fair-rwlock.c index dc179532..8e40a8f6 100644 --- a/trunk/tests/kernel/test-fair-rwlock.c +++ b/trunk/tests/kernel/test-fair-rwlock.c @@ -18,6 +18,9 @@ #error "fair rwlock needs more bits per long to deal with that many CPUs" #endif +/* Test duration, in seconds */ +#define TEST_DURATION 600 + #define THREAD_ROFFSET 1UL #define THREAD_RMASK ((NR_CPUS - 1) * THREAD_ROFFSET) #define SOFTIRQ_ROFFSET (THREAD_RMASK + 1) @@ -41,6 +44,9 @@ #define NR_READERS 6 #define NR_INTERRUPT_READERS 2 +/* Writer iteration delay, in ms. 0 for busy loop. */ +#define WRITER_DELAY 1 + static int var[NR_VARS]; static struct task_struct *reader_threads[NR_READERS]; static struct task_struct *writer_threads[NR_WRITERS]; @@ -159,7 +165,8 @@ static int writer_thread(void *data) //fair_write_unlock(&frwlock); fair_write_unlock_irq(&frwlock); preempt_enable(); /* for get_cycles accuracy */ - //msleep(100); + if (WRITER_DELAY > 0) + msleep(WRITER_DELAY); } while (!kthread_should_stop()); printk("writer_thread/%lu iterations : %lu, " "max contention %llu cycles\n", @@ -215,7 +222,7 @@ static void perform_test(const char *name, void (*callback)(void)) static int my_open(struct inode *inode, struct file *file) { perform_test("fair-rwlock-create", fair_rwlock_create); - ssleep(30); + ssleep(600); perform_test("fair-rwlock-stop", fair_rwlock_stop); return -EPERM; -- 2.34.1