git: 5ed83588dac8 - stable/15 - g_eli: better handling of absent/disabled CPUs

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Thu, 03 Sep 2026 16:36:38 UTC
The branch stable/15 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=5ed83588dac8fb30e893f6dcd1a092116bf07366

commit 5ed83588dac8fb30e893f6dcd1a092116bf07366
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2026-07-13 19:15:00 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-09-03 16:32:36 +0000

    g_eli: better handling of absent/disabled CPUs
    
    Checking hlt_cpus_mask is a no-op, and the mask will be removed in the
    next commit. However, we can use the more recent CPU_ABSENT() macro to
    check the status.
    
    Reviewed by:    olce
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D58157
    
    (cherry picked from commit 63d4f044225d1bb86767759b18c0ae63b25a9c03)
---
 sys/geom/eli/g_eli.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 5bd2d465183e..bc321a0561c8 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -869,16 +869,6 @@ g_eli_access(struct g_provider *pp, int dr, int dw, int de)
 	return (0);
 }
 
-static int
-g_eli_cpu_is_disabled(int cpu)
-{
-#ifdef SMP
-	return (CPU_ISSET(cpu, &hlt_cpus_mask));
-#else
-	return (0);
-#endif
-}
-
 static void
 g_eli_init_uma(void)
 {
@@ -1095,7 +1085,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp,
 		threads = mp_ncpus;
 	sc->sc_cpubind = (mp_ncpus > 1 && threads == mp_ncpus);
 	for (i = 0; i < threads; i++) {
-		if (g_eli_cpu_is_disabled(i)) {
+		if (CPU_ABSENT(i)) {
 			G_ELI_DEBUG(1, "%s: CPU %u disabled, skipping.",
 			    bpp->name, i);
 			continue;