mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Mel Gorman" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Mel Gorman <mgorman@techsingularity.net>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/numa: Do not swap tasks between nodes when spare capacity is available
Date: Mon, 13 Jun 2022 08:43:30 -0000	[thread overview]
Message-ID: <165510981090.4207.296202433440317954.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220520103519.1863-3-mgorman@techsingularity.net>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     13ede33150877d44756171e33570076882b17b0b
Gitweb:        https://git.kernel.org/tip/13ede33150877d44756171e33570076882b17b0b
Author:        Mel Gorman <mgorman@techsingularity.net>
AuthorDate:    Fri, 20 May 2022 11:35:17 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 13 Jun 2022 10:29:59 +02:00

sched/numa: Do not swap tasks between nodes when spare capacity is available

If a destination node has spare capacity but there is an imbalance then
two tasks are selected for swapping. If the tasks have no numa group
or are within the same NUMA group, it's simply shuffling tasks around
without having any impact on the compute imbalance. Instead, it's just
punishing one task to help another.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20220520103519.1863-3-mgorman@techsingularity.net
---
 kernel/sched/fair.c |  9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 51836ef..23da36c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1790,6 +1790,15 @@ static bool task_numa_compare(struct task_numa_env *env,
 	 */
 	cur_ng = rcu_dereference(cur->numa_group);
 	if (cur_ng == p_ng) {
+		/*
+		 * Do not swap within a group or between tasks that have
+		 * no group if there is spare capacity. Swapping does
+		 * not address the load imbalance and helps one task at
+		 * the cost of punishing another.
+		 */
+		if (env->dst_stats.node_type == node_has_spare)
+			goto unlock;
+
 		imp = taskimp + task_weight(cur, env->src_nid, dist) -
 		      task_weight(cur, env->dst_nid, dist);
 		/*

  reply	other threads:[~2022-06-13  8:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 10:35 [PATCH v2 0/4] Mitigate inconsistent NUMA imbalance behaviour Mel Gorman
2022-05-20 10:35 ` [PATCH 1/4] sched/numa: Initialise numa_migrate_retry Mel Gorman
2022-06-13  8:43   ` [tip: sched/core] " tip-bot2 for Mel Gorman
2022-05-20 10:35 ` [PATCH 2/4] sched/numa: Do not swap tasks between nodes when spare capacity is available Mel Gorman
2022-06-13  8:43   ` tip-bot2 for Mel Gorman [this message]
2022-05-20 10:35 ` [PATCH 3/4] sched/numa: Apply imbalance limitations consistently Mel Gorman
2022-05-27  6:21   ` [sched/numa] 5278ba412f: unixbench.score -2.9% regression kernel test robot
2022-06-13  8:43   ` [tip: sched/core] sched/numa: Apply imbalance limitations consistently tip-bot2 for Mel Gorman
2022-05-20 10:35 ` [PATCH 4/4] sched/numa: Adjust imb_numa_nr to a better approximation of memory channels Mel Gorman
2022-06-13  8:43   ` [tip: sched/core] " tip-bot2 for Mel Gorman
2022-05-24 16:01 ` [PATCH v2 0/4] Mitigate inconsistent NUMA imbalance behaviour Vincent Guittot
2022-05-25 12:49   ` Mel Gorman
2022-05-31 10:26     ` Vincent Guittot
2022-05-31 14:09       ` Mel Gorman
2022-06-08  9:53 ` K Prateek Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=165510981090.4207.296202433440317954.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®