update test
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 6 Sep 2008 18:28:25 +0000 (18:28 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 6 Sep 2008 18:28:25 +0000 (18:28 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@3058 04897980-b3bd-0310-b5e0-8ef037075253

trunk/tests/kernel/test-wbias-rwlock.c

index 943986233330f0f4b49e0ab1e3651c6906df8947..3b16f5feb0c934ab161d6efb0d449aaa2227fd97 100644 (file)
@@ -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;
 }
 
This page took 0.031067 seconds and 4 git commands to generate.