From: Jakub Kicinski <kuba@kernel.org>
To: peterz@infradead.org, tglx@linutronix.de
Cc: jstultz@google.com, edumazet@google.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] softirq: avoid spurious stalls due to need_resched()
Date: Tue, 31 Jan 2023 14:32:10 -0800 [thread overview]
Message-ID: <20230131143210.288223c5@kernel.org> (raw)
In-Reply-To: <20221222221244.1290833-3-kuba@kernel.org>
On Thu, 22 Dec 2022 14:12:43 -0800 Jakub Kicinski wrote:
> need_resched() added in commit c10d73671ad3 ("softirq: reduce latencies")
> does improve latency for real workloads (for example memcache).
> Unfortunately it triggers quite often even for non-network-heavy apps
> (~900 times a second on a loaded webserver), and in small fraction of
> cases whatever the scheduler decided to run will hold onto the CPU
> for the entire time slice.
>
> 10ms+ stalls on a machine which is not actually under overload cause
> erratic network behavior and spurious TCP retransmits. Typical end-to-end
> latency in a datacenter is < 200us so its common to set TCP timeout
> to 10ms or less.
>
> The intent of the need_resched() is to let a low latency application
> respond quickly and yield (to ksoftirqd). Put a time limit on this dance.
> Ignore the fact that ksoftirqd is RUNNING if we were trying to be nice
> and the application did not yield quickly.
>
> On a webserver loaded at 90% CPU this change reduces the numer of 8ms+
> stalls the network softirq processing sees by around 10x (2/sec -> 0.2/sec).
> It also seems to reduce retransmissions by ~10% but the data is quite
> noisy.
Peter, is there a chance you could fold this patch into your ongoing
softirq rework? We can't both work on softirq in parallel, unfortunately
and this improvement is really key to counter balance whatever
heuristics CFS accumulated between 5.12 and 5.19 :(
Not to use the "r-word".
I can spin a version of this on top of your core/softirq branch, would
that work?
next prev parent reply other threads:[~2023-01-31 22:32 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 22:12 [PATCH 0/3] softirq: uncontroversial change Jakub Kicinski
2022-12-22 22:12 ` [PATCH 1/3] softirq: rename ksoftirqd_running() -> ksoftirqd_should_handle() Jakub Kicinski
2022-12-22 22:12 ` [PATCH 2/3] softirq: avoid spurious stalls due to need_resched() Jakub Kicinski
2023-01-31 22:32 ` Jakub Kicinski [this message]
2023-03-03 13:30 ` Thomas Gleixner
2023-03-03 15:18 ` Thomas Gleixner
2023-03-03 21:31 ` Jakub Kicinski
2023-03-03 22:37 ` Paul E. McKenney
2023-03-03 23:25 ` Dave Taht
2023-03-04 1:14 ` Paul E. McKenney
2023-03-03 23:36 ` Paul E. McKenney
2023-03-03 23:44 ` Jakub Kicinski
2023-03-04 1:25 ` Paul E. McKenney
2023-03-04 1:39 ` Jakub Kicinski
2023-03-04 3:11 ` Paul E. McKenney
2023-03-04 20:48 ` Paul E. McKenney
2023-03-05 20:43 ` Thomas Gleixner
2023-03-05 22:42 ` Paul E. McKenney
2023-03-05 23:00 ` Frederic Weisbecker
2023-03-06 4:30 ` Paul E. McKenney
2023-03-06 11:22 ` Frederic Weisbecker
2023-03-06 9:13 ` David Laight
2023-03-06 11:57 ` Frederic Weisbecker
2023-03-06 14:57 ` Paul E. McKenney
2023-03-07 0:51 ` Jakub Kicinski
2022-12-22 22:12 ` [PATCH 3/3] softirq: don't yield if only expedited handlers are pending Jakub Kicinski
2023-01-09 9:44 ` Peter Zijlstra
2023-01-09 10:16 ` Eric Dumazet
2023-01-09 19:12 ` Jakub Kicinski
2023-03-03 11:41 ` Thomas Gleixner
2023-03-03 14:17 ` Thomas Gleixner
2023-04-20 17:24 ` [PATCH 0/3] softirq: uncontroversial change Paolo Abeni
2023-04-20 17:41 ` Eric Dumazet
2023-04-20 20:23 ` Paolo Abeni
2023-04-21 2:48 ` Jason Xing
2023-04-21 9:33 ` Paolo Abeni
2023-04-21 9:46 ` Jason Xing
2023-05-09 19:56 ` [tip: irq/core] Revert "softirq: Let ksoftirqd do its job" tip-bot2 for Paolo Abeni
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=20230131143210.288223c5@kernel.org \
--to=kuba@kernel.org \
--cc=edumazet@google.com \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).