Module Name:    src
Committed By:   ad
Date:           Wed Oct  4 20:44:15 UTC 2023

Modified Files:
        src/sys/kern: kern_lwp.c

Log Message:
Sprinkle a bunch more calls to lwp_need_userret().  There should be no
functional change but it does get rid of a bunch of assumptions about how
mi_userret() works making it easier to adjust in that in the future, and
works as a kind of documentation too.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/kern/kern_lwp.c

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

Modified files:

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.259 src/sys/kern/kern_lwp.c:1.260
--- src/sys/kern/kern_lwp.c:1.259	Wed Oct  4 20:42:38 2023
+++ src/sys/kern/kern_lwp.c	Wed Oct  4 20:44:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.259 2023/10/04 20:42:38 ad Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.260 2023/10/04 20:44:15 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020, 2023
@@ -217,7 +217,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.259 2023/10/04 20:42:38 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.260 2023/10/04 20:44:15 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -1003,6 +1003,7 @@ lwp_start(lwp_t *l, int flags)
 	if ((flags & LWP_SUSPENDED) != 0) {
 		/* It'll suspend itself in lwp_userret(). */
 		l->l_flag |= LW_WSUSPEND;
+		lwp_need_userret(l);
 	}
 	if (p->p_stat == SSTOP || (p->p_sflag & PS_STOPPING) != 0) {
 		KASSERT(l->l_wchan == NULL);

Reply via email to