From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Haiyang Zhang <haiyangz@microsoft.com>,
Jesper Dangaard Brouer <jbrouer@redhat.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: "brouer@redhat.com" <brouer@redhat.com>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Dexuan Cui <decui@microsoft.com>,
KY Srinivasan <kys@microsoft.com>,
Paul Rosswurm <paulros@microsoft.com>,
"olaf@aepfle.de" <olaf@aepfle.de>,
"vkuznets@redhat.com" <vkuznets@redhat.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"leon@kernel.org" <leon@kernel.org>,
Long Li <longli@microsoft.com>,
"ssengar@linux.microsoft.com" <ssengar@linux.microsoft.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"ast@kernel.org" <ast@kernel.org>,
Ajay Sharma <sharmaajay@microsoft.com>,
"hawk@kernel.org" <hawk@kernel.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"shradhagupta@linux.microsoft.com"
<shradhagupta@linux.microsoft.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: RE: [PATCH net-next] net: mana: Add page pool for RX buffers
Date: Tue, 18 Jul 2023 07:59:47 +0800 [thread overview]
Message-ID: <062768e0-90d6-33dc-162a-c4adaa612f67@linux.dev> (raw)
In-Reply-To: <PH7PR21MB31166EF9DB2F453999D2E92ECA34A@PH7PR21MB3116.namprd21.prod.outlook.com>
在 2023/7/14 20:51, Haiyang Zhang 写道:
>
>
>> -----Original Message-----
>> From: Jesper Dangaard Brouer <jbrouer@redhat.com>
>> On 14/07/2023 05.53, Jakub Kicinski wrote:
>>> On Thu, 13 Jul 2023 14:48:45 +0000 Haiyang Zhang wrote:
>>>> Add page pool for RX buffers for faster buffer cycle and reduce CPU
>>>> usage.
>>>>
>>>> Get an extra ref count of a page after allocation, so after upper
>>>> layers put the page, it's still referenced by the pool. We can reuse
>>>> it as RX buffer without alloc a new page.
>>>
>>> Please use the real page_pool API from include/net/page_pool.h
>>> We've moved past every driver reinventing the wheel, sorry.
>>
>> +1
>>
>> Quoting[1]: Documentation/networking/page_pool.rst
>>
>> Basic use involves replacing alloc_pages() calls with the
>> page_pool_alloc_pages() call.
>> Drivers should use page_pool_dev_alloc_pages() replacing
>> dev_alloc_pages().
>
> Thank Jakub and Jesper for the reviews.
> I'm aware of the page_pool.rst doc, and actually tried it before this
> patch, but I got lower perf. If I understand correctly, we should call
> page_pool_release_page() before passing the SKB to napi_gro_receive().
>
If I get this commit correctly, this commit is to use page pool to get
better performance.
IIRC, folio is to make memory optimization. From the performance
results, with folio, the performance will get about 10%.
So not sure if the folio can be used in this commit to get better
performance.
That is my 2 cent.
Zhu Yanjun
> I found the page_pool_dev_alloc_pages() goes through the slow path,
> because the page_pool_release_page() let the page leave the pool.
>
> Do we have to call page_pool_release_page() before passing the SKB
> to napi_gro_receive()? Any better way to recycle the pages from the
> upper layer of non-XDP case?
>
> Thanks,
> - Haiyang
>
prev parent reply other threads:[~2023-07-18 0:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 14:48 [PATCH net-next] net: mana: Add page pool for RX buffers Haiyang Zhang
2023-07-14 3:53 ` Jakub Kicinski
2023-07-14 7:43 ` Jesper Dangaard Brouer
2023-07-14 12:51 ` Haiyang Zhang
2023-07-14 13:13 ` Jesper Dangaard Brouer
2023-07-14 15:31 ` Jakub Kicinski
2023-07-17 18:26 ` Haiyang Zhang
2023-07-17 23:59 ` Zhu Yanjun [this message]
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=062768e0-90d6-33dc-162a-c4adaa612f67@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jbrouer@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=pabeni@redhat.com \
--cc=paulros@microsoft.com \
--cc=sharmaajay@microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.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).