From: Yunsheng Lin <linyunsheng@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>, <davem@davemloft.net>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>, <hawk@kernel.org>,
<ilias.apalodimas@linaro.org>, <alexander.duyck@gmail.com>,
Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [PATCH net-next v2 1/3] net: skb: plumb napi state thru skb freeing paths
Date: Fri, 14 Apr 2023 17:40:57 +0800 [thread overview]
Message-ID: <f2d47b7a-40fe-d366-e1a2-a81842e43acf@huawei.com> (raw)
In-Reply-To: <20230413222001.78fdc9a4@kernel.org>
On 2023/4/14 13:20, Jakub Kicinski wrote:
> On Fri, 14 Apr 2023 08:57:03 +0800 Yunsheng Lin wrote:
>>>> Does it break the single-producer single-consumer assumption of tx queue?
>>>
>>> We do not think so.
>>
>> Then I guess it is ok to do direct recycling for page pool case as it is
>> per napi?
>
> We're talking about the tx queue or the pp cache?
> Those have different producers and consumers.
I was trying to confirm if there are more than one contexts that will call
napi->poll() concurrently, if no, then it seems we only have one consumer
for pp cache. And it does not really matter here too when napi->poll() from
netpoll only do tx completion now.
If we are able to limit the context of producer for pp cache to be
the same as consumer, then we might avoid the !!bugget checking.
I do ack that it is a bigger change considering when we might need to
hold a persisent and safe reference to the NAPI instance for this too,
so we might leave it for now like you mentioned in the cover letter.
>
>> It is per cpu cache case we are using !!bugget to protect it from preemption
>> while netpoll_poll_dev() is running?
>
> This is the scenario - We are feeding the page pool cache from the
> deferred pages. An IRQ comes and interrupts us half way thru.
> netpoll then tries to also feed the page pool cache. Unhappiness.
I assume feeding the page pool cache means producer for pp cache?
If netpoll only do tx completion by using zero bugget, it does not
seem to have any direct relation with page pool yet.
>
> Note that netpoll is activated extremely rarely (only when something
> writes to the console), and even more rarely does it actually poll
> for space in the Tx queue.
That is my point, we turn out to need a checking in the fast path in order
to handle the netpoll case, which is a extreme rare case.
> .
>
next prev parent reply other threads:[~2023-04-14 9:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 4:26 [PATCH net-next v2 0/3] page_pool: allow caching from safely localized NAPI Jakub Kicinski
2023-04-13 4:26 ` [PATCH net-next v2 1/3] net: skb: plumb napi state thru skb freeing paths Jakub Kicinski
2023-04-13 7:49 ` Yunsheng Lin
2023-04-13 8:51 ` Eric Dumazet
2023-04-14 0:57 ` Yunsheng Lin
2023-04-14 5:20 ` Jakub Kicinski
2023-04-14 9:40 ` Yunsheng Lin [this message]
2023-04-13 4:26 ` [PATCH net-next v2 2/3] page_pool: allow caching from safely localized NAPI Jakub Kicinski
2023-04-14 8:45 ` Jesper Dangaard Brouer
2023-04-14 14:50 ` Jakub Kicinski
2023-04-13 4:26 ` [PATCH net-next v2 3/3] bnxt: hook NAPIs to page pools Jakub Kicinski
2023-04-14 13:09 ` [PATCH net-next v2 0/3] page_pool: allow caching from safely localized NAPI Dragos Tatulea
2023-04-15 2:20 ` patchwork-bot+netdevbpf
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=f2d47b7a-40fe-d366-e1a2-a81842e43acf@huawei.com \
--to=linyunsheng@huawei.com \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tariqt@nvidia.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;
as well as URLs for NNTP newsgroup(s).