Blob Blame History Raw
From 55cef68bbc0ddcc6f77e302d64569f715ef4c69e Mon Sep 17 00:00:00 2001
From: Josh Don <joshdon@google.com>
Date: Tue, 4 Aug 2020 12:34:13 -0700
Subject: [PATCH] sched/fair: Ignore cache hotness for SMT migration

References: bnc#1155798 (CPU scheduler functional and performance backports)
Patch-mainline: v5.10-rc1
Git-commit: ec73240b1627cddfd7cef018c7fa1c32e64a721e

SMT siblings share caches, so cache hotness should be irrelevant for
cross-sibling migration.

Signed-off-by: Josh Don <joshdon@google.com>
Proposed-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200804193413.510651-1-joshdon@google.com
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
 kernel/sched/fair.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 2de320cb4b99..327e3325c396 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7348,6 +7348,10 @@ static int task_hot(struct task_struct *p, struct lb_env *env)
 	if (unlikely(task_has_idle_policy(p)))
 		return 0;
 
+	/* SMT siblings share cache */
+	if (env->sd->flags & SD_SHARE_CPUCAPACITY)
+		return 0;
+
 	/*
 	 * Buddy candidates are cache hot:
 	 */