Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/rump/kernspace Catch up with reality.



details:   https://anonhg.NetBSD.org/src/rev/e52dca918642
branches:  trunk
changeset: 745869:e52dca918642
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Mar 14 20:25:46 2020 +0000

description:
Catch up with reality.

diffstat:

 tests/rump/kernspace/busypage.c |  34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diffs (66 lines):

diff -r 4d7a7b1f058c -r e52dca918642 tests/rump/kernspace/busypage.c
--- a/tests/rump/kernspace/busypage.c   Sat Mar 14 20:23:51 2020 +0000
+++ b/tests/rump/kernspace/busypage.c   Sat Mar 14 20:25:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: busypage.c,v 1.6 2020/02/23 15:46:43 ad Exp $  */
+/*     $NetBSD: busypage.c,v 1.7 2020/03/14 20:25:46 ad Exp $  */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: busypage.c,v 1.6 2020/02/23 15:46:43 ad Exp $");
+__RCSID("$NetBSD: busypage.c,v 1.7 2020/03/14 20:25:46 ad Exp $");
 #endif /* !lint */
 
 #include <sys/param.h>
@@ -52,15 +52,14 @@
 thread(void *arg)
 {
 
-       rw_enter(uobj->vmobjlock, RW_WRITER);
+       mutex_enter(&testpg->interlock);
        threadrun = true;
-#ifdef notyet
        cv_signal(&tcv);
-#else
-       wakeup(&tcv);
-#endif
-       testpg->flags |= PG_WANTED;
-       UVM_UNLOCK_AND_WAIT_RW(testpg, uobj->vmobjlock, false, "tw", 0);
+       mutex_exit(&testpg->interlock);
+
+       rw_enter(uobj->vmobjlock, RW_READER);
+       uvm_pagewait(testpg, uobj->vmobjlock, "tw");
+
        kthread_exit(0);
 }
 
@@ -84,16 +83,17 @@
        if (rv)
                panic("thread creation failed: %d", rv);
 
-       rw_enter(uobj->vmobjlock, RW_WRITER);
-#ifdef notyet
+       kpause("lolgic", false, mstohz(100), NULL);
+
+       mutex_enter(&testpg->interlock);
        while (!threadrun)
-               cv_wait(&tcv, uobj->vmobjlock);
-#else
-       while (!threadrun)
-               rwtsleep(&tcv, 0, "nutter", 0, uobj->vmobjlock);
-#endif
+               cv_wait(&tcv, &testpg->interlock);
+       mutex_exit(&testpg->interlock);
 
-       uvm_page_unbusy(&testpg, 1);
+       rw_enter(uobj->vmobjlock, RW_WRITER);
+       mutex_enter(&testpg->interlock);
+       uvm_pageunbusy(testpg);
+       mutex_exit(&testpg->interlock);
        rw_exit(uobj->vmobjlock);
 
        rv = kthread_join(newl);



Home | Main Index | Thread Index | Old Index