Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern rump: Use l_sched.info, not l_priv...



details:   https://anonhg.NetBSD.org/src/rev/35403b9ff7fb
branches:  trunk
changeset: 377548:35403b9ff7fb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 16 23:05:53 2023 +0000

description:
rump: Use l_sched.info, not l_private, for cv waits.

- l_sched is scheduler-private, used only by sched_m2.c, should be safe
- l_private is lwp-private, used by tls in user threads, would like to
  reuse for kthreads too

diffstat:

 sys/rump/kern/lib/libsysproxy/sysproxy.c |  14 +++++++-------
 sys/rump/librump/rumpkern/locks.c        |   8 ++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diffs (77 lines):

diff -r 2fdc1b8ff4af -r 35403b9ff7fb sys/rump/kern/lib/libsysproxy/sysproxy.c
--- a/sys/rump/kern/lib/libsysproxy/sysproxy.c  Sun Jul 16 22:20:54 2023 +0000
+++ b/sys/rump/kern/lib/libsysproxy/sysproxy.c  Sun Jul 16 23:05:53 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysproxy.c,v 1.9 2022/08/21 10:24:23 riastradh Exp $   */
+/*     $NetBSD: sysproxy.c,v 1.10 2023/07/16 23:05:53 riastradh Exp $  */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysproxy.c,v 1.9 2022/08/21 10:24:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysproxy.c,v 1.10 2023/07/16 23:05:53 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/filedesc.h>
@@ -180,17 +180,17 @@ hyp_lwpexit(void)
        /*
         * Ok, all lwps are either:
         *  1) not in the cv code
-        *  2) sleeping on l->l_private
+        *  2) sleeping on l->l_sched.info
         *  3) sleeping on p->p_waitcv
         *
-        * Either way, l_private is stable until we set PS_RUMP_LWPEXIT
-        * in p->p_sflag.
+        * Either way, l_sched.info is stable until we set
+        * PS_RUMP_LWPEXIT in p->p_sflag.
         */
 
        mutex_enter(p->p_lock);
        LIST_FOREACH(l, &p->p_lwps, l_sibling) {
-               if (l->l_private)
-                       cv_broadcast(l->l_private);
+               if (l->l_sched.info)
+                       cv_broadcast(l->l_sched.info);
        }
        p->p_sflag |= PS_RUMP_LWPEXIT;
        cv_broadcast(&p->p_waitcv);
diff -r 2fdc1b8ff4af -r 35403b9ff7fb sys/rump/librump/rumpkern/locks.c
--- a/sys/rump/librump/rumpkern/locks.c Sun Jul 16 22:20:54 2023 +0000
+++ b/sys/rump/librump/rumpkern/locks.c Sun Jul 16 23:05:53 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locks.c,v 1.84 2023/04/12 06:35:40 riastradh Exp $     */
+/*     $NetBSD: locks.c,v 1.85 2023/07/16 23:05:53 riastradh Exp $     */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.84 2023/04/12 06:35:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.85 2023/07/16 23:05:53 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -395,7 +395,7 @@ docvwait(kcondvar_t *cv, kmutex_t *mtx, 
 
        UNLOCKED(mtx, false);
 
-       l->l_private = cv;
+       l->l_sched.info = cv;
        rv = 0;
        if (ts) {
                if (rumpuser_cv_timedwait(RUMPCV(cv), RUMPMTX(mtx),
@@ -430,7 +430,7 @@ docvwait(kcondvar_t *cv, kmutex_t *mtx, 
                mutex_enter(mtx);
                rv = EINTR;
        }
-       l->l_private = NULL;
+       l->l_sched.info = NULL;
 
        return rv;
 }



Home | Main Index | Thread Index | Old Index