Pull up following revision(s) (requested by riastradh in ticket #1860):
sys/kern/kern_rwlock.c: revision 1.67 sys/kern/kern_lock.c: revision 1.182 sys/kern/kern_mutex.c: revision 1.102 (all via patch) Sprinkle __predict_{true,false} for panicstr checks
This commit is contained in:
parent
0bd857e8fb
commit
dd81d3bc18
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_lock.c,v 1.158.6.2 2018/01/13 21:57:11 snj Exp $ */
|
||||
/* $NetBSD: kern_lock.c,v 1.158.6.3 2023/07/31 14:42:45 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.158.6.2 2018/01/13 21:57:11 snj Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.158.6.3 2023/07/31 14:42:45 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
|
@ -63,7 +63,7 @@ assert_sleepable(void)
|
|||
uint64_t pctr;
|
||||
bool idle;
|
||||
|
||||
if (panicstr != NULL) {
|
||||
if (__predict_false(panicstr != NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_mutex.c,v 1.65.2.2 2018/04/02 09:07:52 martin Exp $ */
|
||||
/* $NetBSD: kern_mutex.c,v 1.65.2.3 2023/07/31 14:42:45 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
|
||||
|
@ -40,7 +40,7 @@
|
|||
#define __MUTEX_PRIVATE
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.65.2.2 2018/04/02 09:07:52 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.65.2.3 2023/07/31 14:42:45 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/atomic.h>
|
||||
|
@ -516,7 +516,7 @@ mutex_vector_enter(kmutex_t *mtx)
|
|||
MUTEX_ASSERT(mtx, curthread != 0);
|
||||
MUTEX_WANTLOCK(mtx);
|
||||
|
||||
if (panicstr == NULL) {
|
||||
if (__predict_true(panicstr == NULL)) {
|
||||
LOCKDEBUG_BARRIER(&kernel_lock, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_rwlock.c,v 1.46.6.2 2018/04/02 09:07:52 martin Exp $ */
|
||||
/* $NetBSD: kern_rwlock.c,v 1.46.6.3 2023/07/31 14:42:45 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
|
@ -38,7 +38,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.46.6.2 2018/04/02 09:07:52 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.46.6.3 2023/07/31 14:42:45 martin Exp $");
|
||||
|
||||
#define __RWLOCK_PRIVATE
|
||||
|
||||
|
@ -186,7 +186,7 @@ static void __noinline
|
|||
rw_abort(const char *func, size_t line, krwlock_t *rw, const char *msg)
|
||||
{
|
||||
|
||||
if (panicstr != NULL)
|
||||
if (__predict_false(panicstr != NULL))
|
||||
return;
|
||||
|
||||
LOCKDEBUG_ABORT(func, line, rw, &rwlock_lockops, msg);
|
||||
|
@ -290,7 +290,7 @@ rw_vector_enter(krwlock_t *rw, const krw_t op)
|
|||
RW_ASSERT(rw, curthread != 0);
|
||||
RW_WANTLOCK(rw, op);
|
||||
|
||||
if (panicstr == NULL) {
|
||||
if (__predict_true(panicstr == NULL)) {
|
||||
LOCKDEBUG_BARRIER(&kernel_lock, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue