From: Frederic Weisbecker <frederic@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <frederic@kernel.org>
Subject: [PATCH 1/2] sched: Spare resched IPI when prio changes on a single fair task
Date: Tue, 3 Dec 2019 17:01:05 +0100 [thread overview]
Message-ID: <20191203160106.18806-2-frederic@kernel.org> (raw)
In-Reply-To: <20191203160106.18806-1-frederic@kernel.org>
The runqueue of a fair task being remotely reniced is going to get a
resched IPI in order to reassess which task should be the current
running on the CPU. However that evaluation is useless if the fair task
is running alone, in which case we can spare that IPI, preventing
nohz_full CPUs from being disturbed.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
kernel/sched/fair.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 08a233e97a01..6d2560cb24f0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10322,6 +10322,8 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio)
if (!task_on_rq_queued(p))
return;
+ if (rq->cfs.nr_running == 1)
+ return;
/*
* Reschedule if we are currently running on this runqueue and
* our priority decreased, or if we are not currently running on
--
2.23.0
next prev parent reply other threads:[~2019-12-03 16:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 16:01 [PATCH 0/2] sched: Spare IPI on single task renice Frederic Weisbecker
2019-12-03 16:01 ` Frederic Weisbecker [this message]
2019-12-17 12:39 ` [tip: sched/core] sched: Spare resched IPI when prio changes on a single fair task tip-bot2 for Frederic Weisbecker
2019-12-03 16:01 ` [PATCH 2/2] sched: Use fair:prio_changed() instead of ad-hoc implementation Frederic Weisbecker
2019-12-17 12:39 ` [tip: sched/core] " tip-bot2 for Frederic Weisbecker
2019-12-04 12:20 ` [PATCH 0/2] sched: Spare IPI on single task renice Peter Zijlstra
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=20191203160106.18806-2-frederic@kernel.org \
--to=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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