Re: [PATCH v2 2/3] sched/fair: Change likelyhood of nohz.nr_cpus and do stats update if its due

From: Shrikanth Hegde
Date: Tue Jan 06 2026 - 01:44:51 EST




On 1/6/26 11:20 AM, K Prateek Nayak wrote:
Hello Shrikanth,

On 1/6/2026 9:53 AM, Shrikanth Hegde wrote:
There are also nuances like the smp_mb__after_atomic() in

That reminds me, need to upgrade this to smp_mb now, given atomic is gone.

Isn't cpumask_set_cpu() also an atomic op?

set_bit() has a comment stating it is a "relaxed atomic operation" in
asm-generic/bitops/instrumented-atomic.h which makes it similar to a
atomic_inc().

"
* set_bit - Atomically set a bit in memory
* @nr: the bit to set
* @addr: the address to start counting from
*
* This is a relaxed atomic operation (no implied memory barriers).
"

I believed the comment. If it was relaxed atomic operation then
one would need a smp barrier.

But it calls arch_set_bit.
Looking at x86 implementation in arch/x86/include/asm/bitops.h it
looks like it does full smp_mb. Whereas on powerpc it doesn't.
So smp_mb__after_atomic can remain as is.


Effective change to v3 is return instead of out.