All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Sebastian Andrzej Siewior" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/urgent] sched: Teach the forced-newidle balancer about CPU affinity limitation.
Date: Tue, 05 Apr 2022 08:22:01 -0000	[thread overview]
Message-ID: <164914692120.389.11878203217805894208.tip-bot2@tip-bot2> (raw)
In-Reply-To: <YjNK9El+3fzGmswf@linutronix.de>

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

Commit-ID:     386ef214c3c6ab111d05e1790e79475363abaa05
Gitweb:        https://git.kernel.org/tip/386ef214c3c6ab111d05e1790e79475363abaa05
Author:        Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate:    Thu, 17 Mar 2022 15:51:32 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 05 Apr 2022 09:59:36 +02:00

sched: Teach the forced-newidle balancer about CPU affinity limitation.

try_steal_cookie() looks at task_struct::cpus_mask to decide if the
task could be moved to `this' CPU. It ignores that the task might be in
a migration disabled section while not on the CPU. In this case the task
must not be moved otherwise per-CPU assumption are broken.

Use is_cpu_allowed(), as suggested by Peter Zijlstra, to decide if the a
task can be moved.

Fixes: d2dfa17bc7de6 ("sched: Trivial forced-newidle balancer")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/YjNK9El+3fzGmswf@linutronix.de
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 017ee78..51efaab 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6006,7 +6006,7 @@ static bool try_steal_cookie(int this, int that)
 		if (p == src->core_pick || p == src->curr)
 			goto next;
 
-		if (!cpumask_test_cpu(this, &p->cpus_mask))
+		if (!is_cpu_allowed(p, this))
 			goto next;
 
 		if (p->core_occupation > dst->idle->core_occupation)

  reply	other threads:[~2022-04-05 11:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 21:14 sched_core_balance() releasing interrupts with pi_lock held Steven Rostedt
2022-03-15 21:46 ` Steven Rostedt
2022-03-16 16:03   ` Sebastian Andrzej Siewior
2022-03-16 16:18     ` Sebastian Andrzej Siewior
2022-03-16 17:05       ` Sebastian Andrzej Siewior
2022-03-16 20:35       ` Peter Zijlstra
2022-03-17 12:09         ` Sebastian Andrzej Siewior
2022-03-17 14:51           ` [PATCH] sched: Teach the forced-newidle balancer about CPU affinity limitation Sebastian Andrzej Siewior
2022-04-05  8:22             ` tip-bot2 for Sebastian Andrzej Siewior [this message]
2022-03-16 20:27   ` sched_core_balance() releasing interrupts with pi_lock held Peter Zijlstra
2022-03-16 21:03     ` Peter Zijlstra
2022-03-21 17:30       ` Steven Rostedt
2022-03-29 21:22         ` Steven Rostedt
2022-04-04 20:17           ` T.J. Alumbaugh
2022-04-05  7:48             ` Peter Zijlstra
2022-04-05 15:16               ` Dietmar Eggemann
2022-03-17 12:08     ` Sebastian Andrzej Siewior

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=164914692120.389.11878203217805894208.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.