From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Joe Damato <jdamato@fastly.com>, netdev@vger.kernel.org
Cc: hdanton@sina.com, pabeni@redhat.com, namangulati@google.com,
edumazet@google.com, amritha.nambiar@intel.com,
sridhar.samudrala@intel.com, sdf@fomichev.me, peter@typeblog.net,
m2shafiei@uwaterloo.ca, bjorn@rivosinc.com, hch@infradead.org,
willy@infradead.org, willemdebruijn.kernel@gmail.com,
skhawaja@google.com, kuba@kernel.org,
Martin Karsten <mkarsten@uwaterloo.ca>,
"David S. Miller" <davem@davemloft.net>,
Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Linux Documentation <linux-doc@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux BPF <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next v5 7/7] docs: networking: Describe irq suspension
Date: Mon, 4 Nov 2024 17:52:52 +0700 [thread overview]
Message-ID: <ZyinhIlMIrK58ABF@archie.me> (raw)
In-Reply-To: <20241103052421.518856-8-jdamato@fastly.com>
[-- Attachment #1: Type: text/plain, Size: 3332 bytes --]
On Sun, Nov 03, 2024 at 05:24:09AM +0000, Joe Damato wrote:
> +It is important to note that choosing a large value for ``gro_flush_timeout``
> +will defer IRQs to allow for better batch processing, but will induce latency
> +when the system is not fully loaded. Choosing a small value for
> +``gro_flush_timeout`` can cause interference of the user application which is
> +attempting to busy poll by device IRQs and softirq processing. This value
> +should be chosen carefully with these tradeoffs in mind. epoll-based busy
> +polling applications may be able to mitigate how much user processing happens
> +by choosing an appropriate value for ``maxevents``.
> +
> +Users may want to consider an alternate approach, IRQ suspension, to help deal
to help dealing
> +with these tradeoffs.
> +
> <snipped>...
> +There are essentially three possible loops for network processing and
> +packet delivery:
> +
> +1) hardirq -> softirq -> napi poll; basic interrupt delivery
> +
> +2) timer -> softirq -> napi poll; deferred irq processing
> +
> +3) epoll -> busy-poll -> napi poll; busy looping
The loops list are parsed inconsistently due to tabs between the
enumerators and list items. I have to expand them into single space
(along with number reference fix to follow the output):
---- >8 ----
diff --git a/Documentation/networking/napi.rst b/Documentation/networking/napi.rst
index bbd58bcc430fab..848cb19f0becc1 100644
--- a/Documentation/networking/napi.rst
+++ b/Documentation/networking/napi.rst
@@ -375,23 +375,21 @@ epoll finds no events, the setting of ``gro_flush_timeout`` and
There are essentially three possible loops for network processing and
packet delivery:
-1) hardirq -> softirq -> napi poll; basic interrupt delivery
+1) hardirq -> softirq -> napi poll; basic interrupt delivery
+2) timer -> softirq -> napi poll; deferred irq processing
+3) epoll -> busy-poll -> napi poll; busy looping
-2) timer -> softirq -> napi poll; deferred irq processing
-
-3) epoll -> busy-poll -> napi poll; busy looping
-
-Loop 2) can take control from Loop 1), if ``gro_flush_timeout`` and
+Loop 2 can take control from Loop 1, if ``gro_flush_timeout`` and
``napi_defer_hard_irqs`` are set.
-If ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are set, Loops 2)
-and 3) "wrestle" with each other for control.
+If ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are set, Loops 2
+and 3 "wrestle" with each other for control.
-During busy periods, ``irq-suspend-timeout`` is used as timer in Loop 2),
-which essentially tilts network processing in favour of Loop 3).
+During busy periods, ``irq-suspend-timeout`` is used as timer in Loop 2,
+which essentially tilts network processing in favour of Loop 3.
-If ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are not set, Loop 3)
-cannot take control from Loop 1).
+If ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` are not set, Loop 3
+cannot take control from Loop 1.
Therefore, setting ``gro_flush_timeout`` and ``napi_defer_hard_irqs`` is
the recommended usage, because otherwise setting ``irq-suspend-timeout``
Thanks.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-11-04 10:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-03 5:24 [PATCH net-next v5 0/7] Suspend IRQs during application busy periods Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 1/7] net: Add napi_struct parameter irq_suspend_timeout Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 2/7] net: Suspend softirq when prefer_busy_poll is set Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 3/7] net: Add control functions for irq suspension Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 4/7] eventpoll: Trigger napi_busy_loop, if prefer_busy_poll is set Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 5/7] eventpoll: Control irq suspension for prefer_busy_poll Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 6/7] selftests: net: Add busy_poll_test Joe Damato
2024-11-03 5:24 ` [PATCH net-next v5 7/7] docs: networking: Describe irq suspension Joe Damato
2024-11-04 10:52 ` Bagas Sanjaya [this message]
2024-11-04 18:24 ` Joe Damato
2024-11-04 18:43 ` Jonathan Corbet
2024-11-04 18:51 ` Joe Damato
2024-11-04 19:21 ` Jonathan Corbet
2024-11-04 20:00 ` Joe Damato
2024-11-05 1:21 ` Bagas Sanjaya
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=ZyinhIlMIrK58ABF@archie.me \
--to=bagasdotme@gmail.com \
--cc=amritha.nambiar@intel.com \
--cc=bjorn@rivosinc.com \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hch@infradead.org \
--cc=hdanton@sina.com \
--cc=horms@kernel.org \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m2shafiei@uwaterloo.ca \
--cc=mkarsten@uwaterloo.ca \
--cc=namangulati@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peter@typeblog.net \
--cc=sdf@fomichev.me \
--cc=skhawaja@google.com \
--cc=sridhar.samudrala@intel.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=willy@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;
as well as URLs for NNTP newsgroup(s).