git: 143942f9929a - main - unr: remove UNR64_LOCKED

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Sat, 08 Oct 2022 10:41:26 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=143942f9929a36ec7fe56556d0afe0b2d23e08c4

commit 143942f9929a36ec7fe56556d0afe0b2d23e08c4
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-10-08 09:38:41 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-10-08 10:41:21 +0000

    unr: remove UNR64_LOCKED
    
    All platforms support 64-bit atomics now.
---
 sys/kern/subr_unit.c | 13 -------------
 sys/sys/systm.h      |  8 --------
 2 files changed, 21 deletions(-)

diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c
index 8e5eb94711c3..7931012360ba 100644
--- a/sys/kern/subr_unit.c
+++ b/sys/kern/subr_unit.c
@@ -98,19 +98,6 @@ static struct mtx unitmtx;
 
 MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF);
 
-#ifdef UNR64_LOCKED
-uint64_t
-alloc_unr64(struct unrhdr64 *unr64)
-{
-	uint64_t item;
-
-	mtx_lock(&unitmtx);
-	item = unr64->counter++;
-	mtx_unlock(&unitmtx);
-	return (item);
-}
-#endif
-
 #else /* ...USERLAND */
 
 #include <bitstring.h>
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 9673d7e93ab5..7664a4506b0c 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -510,10 +510,6 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item);
 int alloc_unrl(struct unrhdr *uh);
 void free_unr(struct unrhdr *uh, u_int item);
 
-#ifndef __LP64__
-#define UNR64_LOCKED
-#endif
-
 struct unrhdr64 {
         uint64_t	counter;
 };
@@ -525,16 +521,12 @@ new_unrhdr64(struct unrhdr64 *unr64, uint64_t low)
 	unr64->counter = low;
 }
 
-#ifdef UNR64_LOCKED
-uint64_t alloc_unr64(struct unrhdr64 *);
-#else
 static __inline uint64_t
 alloc_unr64(struct unrhdr64 *unr64)
 {
 
 	return (atomic_fetchadd_64(&unr64->counter, 1));
 }
-#endif
 
 void	intr_prof_stack_use(struct thread *td, struct trapframe *frame);