Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by thor...
details: https://anonhg.NetBSD.org/src/rev/b151a7dbedfc
branches: netbsd-8
changeset: 934226:b151a7dbedfc
user: martin <martin%NetBSD.org@localhost>
date: Sun Jun 07 17:08:12 2020 +0000
description:
Pull up following revision(s) (requested by thorpej in ticket #949):
sys/kern/subr_pcu.c: revision 1.22
Relax the KASSERT() in pcu_discard_all() to allow non-curlwp if it is
in LSIDL state, which can happen if the new LWP is exiting before it's
ever run, e.g. if an error occurs in _lwp_create(2).
diffstat:
sys/kern/subr_pcu.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (32 lines):
diff -r 1401b7245dbd -r b151a7dbedfc sys/kern/subr_pcu.c
--- a/sys/kern/subr_pcu.c Sun Jun 07 16:41:24 2020 +0000
+++ b/sys/kern/subr_pcu.c Sun Jun 07 17:08:12 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pcu.c,v 1.20.6.1 2017/10/24 09:14:59 snj Exp $ */
+/* $NetBSD: subr_pcu.c,v 1.20.6.2 2020/06/07 17:08:12 martin Exp $ */
/*-
* Copyright (c) 2011, 2014 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.20.6.1 2017/10/24 09:14:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.20.6.2 2020/06/07 17:08:12 martin Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -130,7 +130,12 @@
{
const uint32_t pcu_valid = l->l_pcu_valid;
- KASSERT(l == curlwp || ((l->l_flag & LW_SYSTEM) && pcu_valid == 0));
+ /*
+ * The check for LSIDL here is to catch the case where the LWP exits
+ * due to an error in the LWP creation path before it ever runs.
+ */
+ KASSERT(l == curlwp || l->l_stat == LSIDL ||
+ ((l->l_flag & LW_SYSTEM) && pcu_valid == 0));
if (__predict_true(pcu_valid == 0)) {
/* PCUs are not in use. */
Home |
Main Index |
Thread Index |
Old Index