mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	sched/fair: optimize the PLACE_LAG when se->vlag is zero
When PLACE_LAG is enabled, from the relationship:
            vl_i = (W + w_i)*vl'_i / W
we know that if vl'_i(se->vlag) is zero, the vl_i is zero too.
So if se->vlag is zero, there is no need to waste cycles to
do the calculation.
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Christoph Lameter (Ampere) <cl@linux.com>
Link: https://lkml.kernel.org/r/20241001070021.10626-1-shijie@os.amperecomputing.com
			
			
This commit is contained in:
		
							parent
							
								
									e31488c9df
								
							
						
					
					
						commit
						4423af84b2
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -5280,7 +5280,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
 | 
			
		|||
	 *
 | 
			
		||||
	 * EEVDF: placement strategy #1 / #2
 | 
			
		||||
	 */
 | 
			
		||||
	if (sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
 | 
			
		||||
	if (sched_feat(PLACE_LAG) && cfs_rq->nr_running && se->vlag) {
 | 
			
		||||
		struct sched_entity *curr = cfs_rq->curr;
 | 
			
		||||
		unsigned long load;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue