mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	sched/fair: Simplify nohz_balancer_kick()
Calling 'nohz_balance_exit_idle(rq)' will always clear 'rq->cpu' from 'nohz.idle_cpus_mask' if it is set. Since it is called at the top of 'nohz_balancer_kick()', 'rq->cpu' will never be set in 'nohz.idle_cpus_mask' if it is accessed in the rest of the function. Combine the 'sched_domain_span()' with 'nohz.idle_cpus_mask' and drop the '(i == cpu)' check since 'rq->cpu' will never be iterated over. While at it, clean up a condition alignment. Signed-off-by: Valentin Schneider <valentin.schneider@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Dietmar.Eggemann@arm.com Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: morten.rasmussen@arm.com Cc: vincent.guittot@linaro.org Link: https://lkml.kernel.org/r/20190117153411.2390-2-valentin.schneider@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
		
							parent
							
								
									99687cdbb3
								
							
						
					
					
						commit
						7edab78d74
					
				
					 1 changed files with 2 additions and 6 deletions
				
			
		| 
						 | 
					@ -9623,11 +9623,7 @@ static void nohz_balancer_kick(struct rq *rq)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sd = rcu_dereference(per_cpu(sd_asym_packing, cpu));
 | 
						sd = rcu_dereference(per_cpu(sd_asym_packing, cpu));
 | 
				
			||||||
	if (sd) {
 | 
						if (sd) {
 | 
				
			||||||
		for_each_cpu(i, sched_domain_span(sd)) {
 | 
							for_each_cpu_and(i, sched_domain_span(sd), nohz.idle_cpus_mask) {
 | 
				
			||||||
			if (i == cpu ||
 | 
					 | 
				
			||||||
			    !cpumask_test_cpu(i, nohz.idle_cpus_mask))
 | 
					 | 
				
			||||||
				continue;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			if (sched_asym_prefer(i, cpu)) {
 | 
								if (sched_asym_prefer(i, cpu)) {
 | 
				
			||||||
				flags = NOHZ_KICK_MASK;
 | 
									flags = NOHZ_KICK_MASK;
 | 
				
			||||||
				goto unlock;
 | 
									goto unlock;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue