From d4ddd2db97284ec7f9e5a47c294144638a64ccda Mon Sep 17 00:00:00 2001 From: compudj Date: Sat, 6 Sep 2008 18:28:25 +0000 Subject: [PATCH] update test git-svn-id: http://ltt.polymtl.ca/svn@3058 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/tests/kernel/test-wbias-rwlock.c | 31 +++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/trunk/tests/kernel/test-wbias-rwlock.c b/trunk/tests/kernel/test-wbias-rwlock.c index 94398623..3b16f5fe 100644 --- a/trunk/tests/kernel/test-wbias-rwlock.c +++ b/trunk/tests/kernel/test-wbias-rwlock.c @@ -25,9 +25,9 @@ #define NR_VARS 100 #define NR_WRITERS 2 -#define NR_TRYLOCK_WRITERS 2 -#define NR_NPREADERS 4 -#define NR_TRYLOCK_READERS 2 +#define NR_TRYLOCK_WRITERS 1 +#define NR_NPREADERS 2 +#define NR_TRYLOCK_READERS 1 /* * 1 : test standard rwlock @@ -122,19 +122,24 @@ static DEFINE_RWLOCK(std_rw_lock); #if (TEST_INTERRUPTS) #if (TEST_PREEMPT) -#define WBIASRWLOCKMASK (WB_WPTHREAD | WB_RIRQ | WB_RNPTHREAD | WB_RPTHREAD) +#define WBIASRWLOCKWCTX WB_PRIO_P +#define WBIASRWLOCKRCTX (WB_RIRQ | WB_RNPTHREAD | WB_RPTHREAD) #else -#define WBIASRWLOCKMASK (WB_WNPTHREAD | WB_RIRQ | WB_RNPTHREAD) +#define WBIASRWLOCKWCTX WB_PRIO_NP +#define WBIASRWLOCKRCTX (WB_RIRQ | WB_RNPTHREAD) #endif #else #if (TEST_PREEMPT) -#define WBIASRWLOCKMASK (WB_WPTHREAD | WB_RNPTHREAD | WB_RPTHREAD) +#define WBIASRWLOCKWCTX WB_PRIO_P +#define WBIASRWLOCKRCTX (WB_RNPTHREAD | WB_RPTHREAD) #else -#define WBIASRWLOCKMASK (WB_WNPTHREAD | WB_RNPTHREAD) +#define WBIASRWLOCKWCTX WB_PRIO_NP +#define WBIASRWLOCKRCTX (WB_RNPTHREAD) #endif #endif -static DEFINE_WBIAS_RWLOCK(wbiasrwlock, WBIASRWLOCKMASK); -CHECK_WBIAS_RWLOCK_MAP(wbiasrwlock, WBIASRWLOCKMASK); + +static DEFINE_WBIAS_RWLOCK(wbiasrwlock, WBIASRWLOCKWCTX, WBIASRWLOCKRCTX); +CHECK_WBIAS_RWLOCK_MAP(wbiasrwlock, WBIASRWLOCKWCTX, WBIASRWLOCKRCTX); #if (TEST_PREEMPT) @@ -154,11 +159,11 @@ CHECK_WBIAS_RWLOCK_MAP(wbiasrwlock, WBIASRWLOCKMASK); #define wrap_read_trylock_irq() wbias_read_trylock_irq(&wbiasrwlock) #define wrap_write_lock() \ - wbias_write_lock(&wbiasrwlock, WBIASRWLOCKMASK) + wbias_write_lock(&wbiasrwlock, WBIASRWLOCKWCTX, WBIASRWLOCKRCTX) #define wrap_write_unlock() \ - wbias_write_unlock(&wbiasrwlock, WBIASRWLOCKMASK) + wbias_write_unlock(&wbiasrwlock, WBIASRWLOCKWCTX, WBIASRWLOCKRCTX) #define wrap_write_trylock() \ - wbias_write_trylock(&wbiasrwlock, WBIASRWLOCKMASK) + wbias_write_trylock(&wbiasrwlock, WBIASRWLOCKWCTX, WBIASRWLOCKRCTX) #endif @@ -306,7 +311,7 @@ static int trylock_reader_thread(void *data) } while (!kthread_should_stop()); printk("trylock_reader_thread/%lu iterations : %lu, " "successful iterations : %lu\n", - (unsigned long)data, iter, success_iter); + (unsigned long)data, iter + success_iter, success_iter); return 0; } -- 2.34.1