git: 1c4e16f6db81 - main - x86/cpu_machdep.c: unconditionally fence

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 29 Jan 2026 18:12:34 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=1c4e16f6db81254376f4919aede03267fe572aea

commit 1c4e16f6db81254376f4919aede03267fe572aea
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-01-22 13:27:00 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-29 18:11:56 +0000

    x86/cpu_machdep.c: unconditionally fence
    
    For !SCHED_ULE, even if the fence is not needed, it is harmless.
    
    Reviewed by:    olce
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D54831
---
 sys/x86/x86/cpu_machdep.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c
index 5b4abfe71642..067374be4941 100644
--- a/sys/x86/x86/cpu_machdep.c
+++ b/sys/x86/x86/cpu_machdep.c
@@ -47,7 +47,6 @@
 #include "opt_kstack_pages.h"
 #include "opt_maxmem.h"
 #include "opt_platform.h"
-#include "opt_sched.h"
 #ifdef __i386__
 #include "opt_apic.h"
 #endif
@@ -543,9 +542,7 @@ cpu_idle_enter(int *statep, int newstate)
 	 * is visible before calling cpu_idle_wakeup().
 	 */
 	atomic_store_int(statep, newstate);
-#if defined(SCHED_ULE) && defined(SMP)
 	atomic_thread_fence_seq_cst();
-#endif
 
 	/*
 	 * Since we may be in a critical section from cpu_idle(), if