From: Ingo Molnar <mingo@kernel.org>
To: Mike Galbraith <efault@gmx.de>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
x86@kernel.org, Chen Yu <yu.c.chen@intel.com>,
Gautham Shenoy <gautham.shenoy@amd.com>
Subject: [PATCH] sched/fair: Do not wakeup-preempt same-prio SCHED_OTHER tasks
Date: Tue, 19 Sep 2023 11:02:26 +0200 [thread overview]
Message-ID: <ZQljoiSBhZLEFI/G@gmail.com> (raw)
In-Reply-To: <0e153dd25900af70f91e4a73f960320e6daf3c6a.camel@gmx.de>
* Mike Galbraith <efault@gmx.de> wrote:
> On Tue, 2023-08-22 at 08:33 +0530, K Prateek Nayak wrote:
> > Hello Mike,
>
> Greetings!
>
> > > FWIW, there are more tbench shards lying behind EEVDF than in front.
> > >
> > > tbench 8 on old i7-4790 box
> > > 4.4.302 4024
> > > 6.4.11 3668
> > > 6.4.11-eevdf 3522
> > >
> >
> > I agree, but on servers, tbench has been useful to identify a variety of
> > issues [1][2][3] and I believe it is better to pick some shards up than
> > leave them lying around for others to step on :)
>
> Absolutely, but in this case it isn't due to various overheads wiggling
> about and/or bitrot, everything's identical except the scheduler, and
> its overhead essentially is too.
>
> taskset -c 3 pipe-test
> 6.4.11 1.420033 usecs/loop -- avg 1.420033 1408.4 KHz
> 6.4.11-eevdf 1.413024 usecs/loop -- avg 1.413024 1415.4 KHz
>
> Methinks these shards are due to tbench simply being one of those
> things that happens to like the CFS notion of short term fairness a bit
> better than the EEVDF notion, ie are inevitable fallout tied to the
> very thing that makes EEVDF service less spiky that CFS, and thus will
> be difficult to sweep up.
>
> Too bad I didn't save Peter's test hack to make EEVDF use the same
> notion of fair (not a keeper) as I think that would likely prove it.
BTW., if overscheduling is still an issue, I'm wondering whether we
could go so far as to turn off wakeup preemption for same-prio
SCHED_OTHER tasks altogether, as per the attached patch?
What does this do to your various tests? Test booted only.
Thanks,
Ingo
=============>
From: Ingo Molnar <mingo@kernel.org>
Date: Tue, 19 Sep 2023 10:49:51 +0200
Subject: [PATCH] sched/fair: Do not wakeup-preempt same-prio SCHED_OTHER tasks
Reduce overscheduling some more: do not wakeup-preempt same-priority
SCHED_OTHER tasks.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a502e3255392..98efe01c8e4e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8042,7 +8042,7 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
* Batch and idle tasks do not preempt non-idle tasks (their preemption
* is driven by the tick):
*/
- if (unlikely(p->policy != SCHED_NORMAL) || !sched_feat(WAKEUP_PREEMPTION))
+ if (unlikely(p->policy != SCHED_NORMAL) || likely(p->prio == curr->prio) || !sched_feat(WAKEUP_PREEMPTION))
return;
find_matching_se(&se, &pse);
next prev parent reply other threads:[~2023-09-19 9:02 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 13:24 [tip:sched/eevdf] [sched/fair] e0c2ff903c: phoronix-test-suite.blogbench.Write.final_score -34.8% regression kernel test robot
2023-08-11 1:11 ` Chen Yu
2023-08-11 2:42 ` Chen Yu
2023-08-14 13:29 ` Peter Zijlstra
2023-08-14 18:32 ` Mike Galbraith
2023-08-15 23:52 ` Peter Zijlstra
2023-08-16 3:54 ` Mike Galbraith
2023-08-16 12:37 ` Peter Zijlstra
2023-08-16 13:40 ` Peter Zijlstra
2023-08-16 15:38 ` Mike Galbraith
2023-08-16 20:04 ` Peter Zijlstra
2023-08-17 1:25 ` Mike Galbraith
2023-08-17 15:10 ` [tip: sched/core] sched/eevdf: Curb wakeup-preemption tip-bot2 for Peter Zijlstra
2023-08-21 10:39 ` K Prateek Nayak
2023-08-21 15:30 ` Mike Galbraith
2023-08-22 3:03 ` K Prateek Nayak
2023-08-22 6:09 ` Mike Galbraith
2023-08-25 6:41 ` K Prateek Nayak
2023-09-19 9:02 ` Ingo Molnar [this message]
2023-09-19 9:48 ` [PATCH] sched/fair: Do not wakeup-preempt same-prio SCHED_OTHER tasks Mike Galbraith
2023-09-22 10:00 ` kernel test robot
2023-09-25 11:07 ` Ingo Molnar
2023-09-25 16:45 ` Chen Yu
2023-08-18 1:09 ` [tip:sched/eevdf] [sched/fair] e0c2ff903c: phoronix-test-suite.blogbench.Write.final_score -34.8% regression Chen Yu
2023-08-22 6:48 ` Chen Yu
2023-08-22 7:07 ` Chen Yu
2023-08-16 3:40 ` Chen Yu
2023-08-16 9:20 ` Peter Zijlstra
2023-08-14 12:49 ` Peter Zijlstra
2023-08-18 1:54 ` Chen Yu
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=ZQljoiSBhZLEFI/G@gmail.com \
--to=mingo@kernel.org \
--cc=efault@gmx.de \
--cc=gautham.shenoy@amd.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
--cc=yu.c.chen@intel.com \
/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