From: jsg Date: Wed, 3 Jul 2024 01:36:50 +0000 (+0000) Subject: remove __mp_release_all_but_one(), unused since sched_bsd.c rev 1.92 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=af1a00f9e0048050db8ad368227d3917fd4b7c7b;p=openbsd remove __mp_release_all_but_one(), unused since sched_bsd.c rev 1.92 ok claudio@ --- diff --git a/sys/arch/alpha/alpha/lock_machdep.c b/sys/arch/alpha/alpha/lock_machdep.c index 6f949985856..4edcd536c41 100644 --- a/sys/arch/alpha/alpha/lock_machdep.c +++ b/sys/arch/alpha/alpha/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.8 2020/03/05 09:28:31 claudio Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.9 2024/07/03 01:36:50 jsg Exp $ */ /* * Copyright (c) 2007 Artur Grabowski @@ -162,22 +162,6 @@ __mp_release_all(struct __mp_lock *mpl) return (rv); } -int -__mp_release_all_but_one(struct __mp_lock *mpl) -{ - int rv = mpl->mpl_count - 2; -#ifdef MP_LOCKDEBUG - if (mpl->mpl_cpu != curcpu()) { - db_printf("__mp_release_all_but_one(%p): not held lock\n", mpl); - db_enter(); - } -#endif - - mpl->mpl_count = 2; - - return (rv); -} - void __mp_acquire_count(struct __mp_lock *mpl, int count) { diff --git a/sys/arch/alpha/include/mplock.h b/sys/arch/alpha/include/mplock.h index 664e9430b9e..32fb7305d97 100644 --- a/sys/arch/alpha/include/mplock.h +++ b/sys/arch/alpha/include/mplock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mplock.h,v 1.2 2017/12/04 09:51:03 mpi Exp $ */ +/* $OpenBSD: mplock.h,v 1.3 2024/07/03 01:36:50 jsg Exp $ */ /* * Copyright (c) 2004 Niklas Hallqvist. All rights reserved. @@ -43,7 +43,6 @@ void __mp_lock_init(struct __mp_lock *); void __mp_lock(struct __mp_lock *); void __mp_unlock(struct __mp_lock *); int __mp_release_all(struct __mp_lock *); -int __mp_release_all_but_one(struct __mp_lock *); void __mp_acquire_count(struct __mp_lock *, int); int __mp_lock_held(struct __mp_lock *, struct cpu_info *); diff --git a/sys/arch/hppa/hppa/lock_machdep.c b/sys/arch/hppa/hppa/lock_machdep.c index 44c9dda7fb4..67d515a46c0 100644 --- a/sys/arch/hppa/hppa/lock_machdep.c +++ b/sys/arch/hppa/hppa/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.14 2019/04/23 13:35:12 visa Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.15 2024/07/03 01:36:50 jsg Exp $ */ /* * Copyright (c) 2007 Artur Grabowski @@ -191,32 +191,6 @@ __mp_release_all(struct __mp_lock *mpl) return (rv); } -int -__mp_release_all_but_one(struct __mp_lock *mpl) -{ - int rv = mpl->mpl_count - 2; -#ifdef WITNESS - int i; -#endif - -#ifdef MP_LOCKDEBUG - if (mpl->mpl_cpu != curcpu()) { - db_printf("__mp_release_all_but_one(%p): lock not held - " - "%p != %p\n", mpl, mpl->mpl_cpu, curcpu()); - db_enter(); - } -#endif - -#ifdef WITNESS - for (i = 0; i < rv; i++) - WITNESS_UNLOCK(&mpl->mpl_lock_obj, LOP_EXCLUSIVE); -#endif - - mpl->mpl_count = 2; - - return (rv); -} - void __mp_acquire_count(struct __mp_lock *mpl, int count) { diff --git a/sys/arch/hppa/include/mplock.h b/sys/arch/hppa/include/mplock.h index b0c2d7299e2..87f01b205c1 100644 --- a/sys/arch/hppa/include/mplock.h +++ b/sys/arch/hppa/include/mplock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mplock.h,v 1.5 2019/04/23 13:35:12 visa Exp $ */ +/* $OpenBSD: mplock.h,v 1.6 2024/07/03 01:36:50 jsg Exp $ */ /* * Copyright (c) 2004 Niklas Hallqvist. All rights reserved. @@ -50,7 +50,6 @@ void ___mp_lock_init(struct __mp_lock *); void __mp_lock(struct __mp_lock *); void __mp_unlock(struct __mp_lock *); int __mp_release_all(struct __mp_lock *); -int __mp_release_all_but_one(struct __mp_lock *); void __mp_acquire_count(struct __mp_lock *, int); int __mp_lock_held(struct __mp_lock *, struct cpu_info *); diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index fb38210927d..ec16111a8fd 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.74 2024/05/29 18:55:45 claudio Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.75 2024/07/03 01:36:50 jsg Exp $ */ /* * Copyright (c) 2017 Visa Hankala @@ -194,30 +194,6 @@ __mp_release_all(struct __mp_lock *mpl) return (rv); } -int -__mp_release_all_but_one(struct __mp_lock *mpl) -{ - struct __mp_lock_cpu *cpu = &mpl->mpl_cpus[cpu_number()]; - int rv = cpu->mplc_depth - 1; -#ifdef WITNESS - int i; - - for (i = 0; i < rv; i++) - WITNESS_UNLOCK(&mpl->mpl_lock_obj, LOP_EXCLUSIVE); -#endif - -#ifdef MP_LOCKDEBUG - if (!__mp_lock_held(mpl, curcpu())) { - db_printf("__mp_release_all_but_one(%p): not held lock\n", mpl); - db_enter(); - } -#endif - - cpu->mplc_depth = 1; - - return (rv); -} - void __mp_acquire_count(struct __mp_lock *mpl, int count) { diff --git a/sys/sys/mplock.h b/sys/sys/mplock.h index 34f2f97c97b..b28ac240d94 100644 --- a/sys/sys/mplock.h +++ b/sys/sys/mplock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mplock.h,v 1.13 2019/04/23 13:35:12 visa Exp $ */ +/* $OpenBSD: mplock.h,v 1.14 2024/07/03 01:36:50 jsg Exp $ */ /* * Copyright (c) 2004 Niklas Hallqvist. All rights reserved. @@ -51,7 +51,6 @@ void ___mp_lock_init(struct __mp_lock *, const struct lock_type *); void __mp_lock(struct __mp_lock *); void __mp_unlock(struct __mp_lock *); int __mp_release_all(struct __mp_lock *); -int __mp_release_all_but_one(struct __mp_lock *); void __mp_acquire_count(struct __mp_lock *, int); int __mp_lock_held(struct __mp_lock *, struct cpu_info *);