From: Jakub Kicinski <kuba@kernel•org>
To: Joe Damato <jdamato@fastly•com>
Cc: netdev@vger•kernel.org, corbet@lwn•net, hdanton@sina•com,
bagasdotme@gmail•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, Martin Karsten <mkarsten@uwaterloo•ca>,
"David S. Miller" <davem@davemloft•net>,
Simon Horman <horms@kernel•org>, David Ahern <dsahern@kernel•org>,
Sebastian Andrzej Siewior <bigeasy@linutronix•de>,
Lorenzo Bianconi <lorenzo@kernel•org>,
Alexander Lobakin <aleksander.lobakin@intel•com>,
open list <linux-kernel@vger•kernel.org>
Subject: Re: [PATCH net-next v6 2/7] net: Suspend softirq when prefer_busy_poll is set
Date: Thu, 7 Nov 2024 19:52:03 -0800 [thread overview]
Message-ID: <20241107195203.72ea09b9@kernel.org> (raw)
In-Reply-To: <Zywy8PQDljS5r_rX@LQ3V64L9R2>
On Wed, 6 Nov 2024 19:24:32 -0800 Joe Damato wrote:
> > In your case, when machine is not melting under 100% load - prefer busy
> > poll will be set once or not at all.
>
> I am not sure what you mean by that last sentence, because the
> prefer busy poll flag is set by the application?
There are two flags with almost exactly the same name, that's probably
the source of misunderstanding. NAPI_F_PREFER_BUSY_POLL will always be
set, but unless we are actually in a "napi live lock"
NAPI_STATE_PREFER_BUSY_POLL will not get set, and the latter is what
napi_prefer_busy_poll() tests. But we're dropping this patch so
doesn't matter. I was trying to pile up reasons why checking
napi_prefer_busy_poll() should not be necessary.
> Similar to prefer busy poll piggybacking on IRQ deferral, we
> piggyback on prefer busy polling by allowing the application to use
> an even larger timeout while it is processing incoming data, i.e.,
> deferring IRQs for a longer period, but only after a successful busy
> poll. This makes prefer busy poll + irq suspend useful when
> utilization is below 100%.
>
> > > The overall point to make is that: the suspend timer is used to
> > > prevent misbehaving userland applications from taking too long. It's
> > > essentially a backstop and, as long as the app is making forward
> > > progress, allows the app to continue running its busy poll loop
> > > undisturbed (via napi_complete_done preventing the driver from
> > > enabling IRQs).
> > >
> > > Does that make sense?
> >
> > My mental model put in yet another way is that only epoll knows if it
> > has events, and therefore whether the timeout should be short or long.
> > So the suspend timer should only be applied by epoll.
>
> Here's what we are thinking, can you let me know if you agree with
> this?
>
> - We can drop patch 2 entirely
> - Update the documentation about IRQ suspension as needed now
> that patch 2 has been dropped
> - Leave the rest of the series as is
> - Re-run our tests to gather sufficient data for the test cases
> outlined in the cover letter to ensure that the performance
> numbers hold over several iterations
>
> Does that seem reasonable for the v7 to you?
>
> I am asking because generating the amount of data over the number of
> scenarios we are testing takes a long time and I want to make sure
> we are as aligned as we can be before I kick off another run :)
SGTM, the rest of the series makes perfect sense to me.
Sorry for the delay..
next prev parent reply other threads:[~2024-11-08 3:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 21:55 [PATCH net-next v6 0/7] Suspend IRQs during application busy periods Joe Damato
2024-11-04 21:55 ` [PATCH net-next v6 1/7] net: Add napi_struct parameter irq_suspend_timeout Joe Damato
2024-11-04 21:55 ` [PATCH net-next v6 2/7] net: Suspend softirq when prefer_busy_poll is set Joe Damato
2024-11-06 5:03 ` Jakub Kicinski
2024-11-06 16:52 ` Joe Damato
2024-11-06 23:31 ` Jakub Kicinski
2024-11-07 3:24 ` Joe Damato
2024-11-07 21:01 ` Joe Damato
2024-11-08 3:52 ` Jakub Kicinski [this message]
2024-11-04 21:55 ` [PATCH net-next v6 3/7] net: Add control functions for irq suspension Joe Damato
2024-11-04 21:55 ` [PATCH net-next v6 4/7] eventpoll: Trigger napi_busy_loop, if prefer_busy_poll is set Joe Damato
2024-11-04 21:55 ` [PATCH net-next v6 5/7] eventpoll: Control irq suspension for prefer_busy_poll Joe Damato
2024-11-04 21:55 ` [PATCH net-next v6 6/7] selftests: net: Add busy_poll_test Joe Damato
2024-11-05 3:50 ` Stanislav Fomichev
2024-11-05 17:49 ` Joe Damato
2024-11-04 21:55 ` [PATCH net-next v6 7/7] docs: networking: Describe irq suspension Joe Damato
2024-11-05 1:12 ` 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=20241107195203.72ea09b9@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=aleksander.lobakin@intel$(echo .)com \
--cc=amritha.nambiar@intel$(echo .)com \
--cc=bagasdotme@gmail$(echo .)com \
--cc=bigeasy@linutronix$(echo .)de \
--cc=bjorn@rivosinc$(echo .)com \
--cc=corbet@lwn$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=dsahern@kernel$(echo .)org \
--cc=edumazet@google$(echo .)com \
--cc=hch@infradead$(echo .)org \
--cc=hdanton@sina$(echo .)com \
--cc=horms@kernel$(echo .)org \
--cc=jdamato@fastly$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=lorenzo@kernel$(echo .)org \
--cc=m2shafiei@uwaterloo$(echo .)ca \
--cc=mkarsten@uwaterloo$(echo .)ca \
--cc=namangulati@google$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=peter@typeblog$(echo .)net \
--cc=sdf@fomichev$(echo .)me \
--cc=skhawaja@google$(echo .)com \
--cc=sridhar.samudrala@intel$(echo .)com \
--cc=willemdebruijn.kernel@gmail$(echo .)com \
--cc=willy@infradead$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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