update test
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 17 Aug 2008 07:01:38 +0000 (07:01 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 17 Aug 2008 07:01:38 +0000 (07:01 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@3026 04897980-b3bd-0310-b5e0-8ef037075253

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

index dc17953259282c24da8e1343cfc62211224587ca..8e40a8f6728d4dcf0fe7aa20f39bc0a42eaae410 100644 (file)
@@ -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;
This page took 0.024313 seconds and 4 git commands to generate.