Module Name:    src
Committed By:   ad
Date:           Sat Mar 14 20:25:47 UTC 2020

Modified Files:
        src/tests/rump/kernspace: busypage.c

Log Message:
Catch up with reality.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/rump/kernspace/busypage.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/rump/kernspace/busypage.c
diff -u src/tests/rump/kernspace/busypage.c:1.6 src/tests/rump/kernspace/busypage.c:1.7
--- src/tests/rump/kernspace/busypage.c:1.6	Sun Feb 23 15:46:43 2020
+++ src/tests/rump/kernspace/busypage.c	Sat Mar 14 20:25:46 2020
@@ -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 @@ static void
 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 @@ rumptest_busypage()
 	if (rv)
 		panic("thread creation failed: %d", rv);
 
-	rw_enter(uobj->vmobjlock, RW_WRITER);
-#ifdef notyet
-	while (!threadrun)
-		cv_wait(&tcv, uobj->vmobjlock);
-#else
+	kpause("lolgic", false, mstohz(100), NULL);
+
+	mutex_enter(&testpg->interlock);
 	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);

Reply via email to