sched_rt: don't use first_cpu on cpumask created with cpumask_and.
PATCH 1/1 sched_rt: don't use first_cpu on cpumask created with cpumask_and.
Ingo, please apply to tip/urgent.
cpumask_and() only initializes nr_cpu_ids bits, so the (deprecated) first_cpu() might find one of those uninitialized bits if nr_cpu_ids is less than NR_CPUS (as it can be for CONFIG_CPUMASK_OFFSTACK).
--- kernel/sched_rt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched_rt.c +2 -2
@@ -968,8 +968,8 @@ static inline int pick_optimal_cpu(int tif ((this_cpu !=-1 ) &&cpu_isset (this_cpu, *mask))return this_cpu; - first =first_cpu (*mask); -if (first !=NR_CPUS ) + first =cpumask_first (mask); +if (first < nr_cpu_ids)return first;return -1 ;
Ingo Molnar
AppliedQuoted 10 lines · Rusty Russell
Ingo, please apply to tip/urgent.
cpumask_and()only initializesnr_cpu_idsbits, so the (deprecated)first_cpu()might find one of those uninitialized bits ifnr_cpu_idsis less thanNR_CPUS(as it can be forCONFIG_CPUMASK_OFFSTACK).Signed-off-by Rusty Russell <[email protected]>--- kernel/sched_rt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to tip/sched/urgent, thanks Rusty!
Also, Git sorted out the same-content merge with this commit in cpus4096 just fine:
d38b223: cpumask: reduce stack usage in find_lowest_rq
(this commit is where you backported it from i suspect?)
Ingo
Quoted 14 lines · On Sunday 01 February 2009 00:19:47 Ingo Molnar wrote:
Quoted 10 lines · Rusty Russell
Ingo, please apply to tip/urgent.
cpumask_and()only initializesnr_cpu_idsbits, so the (deprecated)first_cpu()might find one of those uninitialized bits ifnr_cpu_idsis less thanNR_CPUS(as it can be forCONFIG_CPUMASK_OFFSTACK).Signed-off-by Rusty Russell <[email protected]>--- kernel/sched_rt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 8 lines
Applied to tip/sched/urgent, thanks Rusty!
Also, Git sorted out the same-content merge with this commit in cpus4096 just fine:
d38b223: cpumask: reduce stack usage in
find_lowest_rq(this commit is where you backported it from i suspect?)
No, this was a clean audit on current Linus' tree. I wanted to make sure that what Linus had worked...
Thanks,
Rusty.