Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 4423af8

Browse files
HuangShijie2024Peter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Christoph Lameter (Ampere) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent e31488c commit 4423af8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5280,7 +5280,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
52805280
*
52815281
* EEVDF: placement strategy #1 / #2
52825282
*/
5283-
if (sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
5283+
if (sched_feat(PLACE_LAG) && cfs_rq->nr_running && se->vlag) {
52845284
struct sched_entity *curr = cfs_rq->curr;
52855285
unsigned long load;
52865286

0 commit comments

Comments
 (0)