summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Shijie <shijie@os.amperecomputing.com>2024-10-01 09:00:21 +0200
committerPeter Zijlstra <peterz@infradead.org>2024-10-07 09:28:41 +0200
commit4423af84b29794a9bd2bd07188d8e71083e54c61 (patch)
tree67bbb27844d1ee2508dd677cbb49515851af65e9
parentsched/fair: remove the DOUBLE_TICK feature (diff)
downloadlinux-4423af84b29794a9bd2bd07188d8e71083e54c61.tar.xz
linux-4423af84b29794a9bd2bd07188d8e71083e54c61.zip
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
-rw-r--r--kernel/sched/fair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c9e3b8d2a85f..5a621210c9c1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -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;