Skip to content

Commit 046c06f

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
refscale: Correct affinity check
The current affinity check works fine until there are more reader processes than CPUs, at which point the affinity check is looking for non-existent CPUs. This commit therefore applies the same modulus to the check as is present in the set_cpus_allowed_ptr() call. Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Neeraj Upadhyay <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 3269363 commit 046c06f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/refscale.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ ref_scale_reader(void *arg)
829829
goto end;
830830

831831
// Make sure that the CPU is affinitized appropriately during testing.
832-
WARN_ON_ONCE(raw_smp_processor_id() != me);
832+
WARN_ON_ONCE(raw_smp_processor_id() != me % nr_cpu_ids);
833833

834834
WRITE_ONCE(rt->start_reader, 0);
835835
if (!atomic_dec_return(&n_started))

0 commit comments

Comments
 (0)