Skip to contentSkip to conversation

sched_ext: Mark racy bitfields to prevent adding fields that can't tolerate races

PATCH Applied Tejun Heo 1 participant 2 messages Nov 5, 2025

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author reviewer
#0 lore raw

PATCH 1/1 sched_ext: Mark racy bitfields to prevent adding fields that can't tolerate races

The warned bitfields in struct scx_sched are updated racily from concurrent CPUs causing RMW races, which is fine for these boolean warning flags. Add a comment marking this area to prevent future fields that can't tolerate racy updates from being added here.

---
 kernel/sched/ext_internal.h |    4 ++++
 1 file changed, 4 insertions(+)
kernel/sched/ext_internal.h +4 -0
@@ -895,6 +895,10 @@ struct scx_sched {
 	struct scx_dispatch_q	**global_dsqs;
 	struct scx_sched_pcpu __percpu *pcpu;
 
+	/*
+	 * Updates to the following warned bitfields can race causing RMW issues
+	 * but it doesn't really matter.
+	 */
 	bool			warned_zero_slice:1;
 	bool			warned_deprecated_rq:1;
 
author reviewer Applied
#1 lore raw

Applied to sched_ext/for-6.19.

Thanks.
--
tejun