From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Mel Gorman <mgorman@techsingularity.net>,
linux-mm@kvack.org, chuck.lever@oracle.com,
netdev@vger.kernel.org, linux-nfs@vger.kernel.org,
linux-kernel@vger.kernel.org, brouer@redhat.com
Subject: Re: [PATCH RFC net-next 2/3] net: page_pool: use alloc_pages_bulk in refill code path
Date: Fri, 26 Feb 2021 15:31:49 +0100 [thread overview]
Message-ID: <20210226153149.08b3d822@carbon> (raw)
In-Reply-To: <YDaz2tXXxEkcBfRR@apalos.home>
On Wed, 24 Feb 2021 22:15:22 +0200
Ilias Apalodimas <ilias.apalodimas@linaro.org> wrote:
> Hi Jesper,
>
> On Wed, Feb 24, 2021 at 07:56:46PM +0100, Jesper Dangaard Brouer wrote:
> > There are cases where the page_pool need to refill with pages from the
> > page allocator. Some workloads cause the page_pool to release pages
> > instead of recycling these pages.
> >
> > For these workload it can improve performance to bulk alloc pages from
> > the page-allocator to refill the alloc cache.
> >
> > For XDP-redirect workload with 100G mlx5 driver (that use page_pool)
> > redirecting xdp_frame packets into a veth, that does XDP_PASS to create
> > an SKB from the xdp_frame, which then cannot return the page to the
> > page_pool. In this case, we saw[1] an improvement of 18.8% from using
> > the alloc_pages_bulk API (3,677,958 pps -> 4,368,926 pps).
> >
> > [1] https://github.com/xdp-project/xdp-project/blob/master/areas/mem/page_pool06_alloc_pages_bulk.org
> >
> > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
>
> [...]
>
> > + /* Remaining pages store in alloc.cache */
> > + list_for_each_entry_safe(page, next, &page_list, lru) {
> > + list_del(&page->lru);
> > + if (pp_flags & PP_FLAG_DMA_MAP) {
> > + page = page_pool_dma_map(pool, page);
> > + if (!page)
>
> As I commented on the previous patch, i'd prefer the put_page() here to be
> explicitly called, instead of hiding in the page_pool_dma_map()
I fully agree. I will fixup the code.
> > + continue;
> > + }
> > + if (likely(pool->alloc.count < PP_ALLOC_CACHE_SIZE)) {
> > + pool->alloc.cache[pool->alloc.count++] = page;
> > + pool->pages_state_hold_cnt++;
> > + trace_page_pool_state_hold(pool, page,
> > + pool->pages_state_hold_cnt);
> > + } else {
> > + put_page(page);
> > + }
> > + }
> > +out:
> > if (pool->p.flags & PP_FLAG_DMA_MAP) {
> > - page = page_pool_dma_map(pool, page);
> > - if (!page)
> > + first_page = page_pool_dma_map(pool, first_page);
> > + if (!first_page)
> > return NULL;
> > }
> >
> [...]
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2021-02-26 14:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 10:26 [RFC PATCH 0/3] Introduce a bulk order-0 page allocator for sunrpc Mel Gorman
2021-02-24 10:26 ` [PATCH 1/3] SUNRPC: Set rq_page_end differently Mel Gorman
2021-02-24 10:26 ` [PATCH 2/3] mm, page_alloc: Add a bulk page allocator Mel Gorman
2021-02-24 10:26 ` [PATCH 3/3] SUNRPC: Refresh rq_pages using " Mel Gorman
2021-02-24 11:27 ` [RFC PATCH 0/3] Introduce a bulk order-0 page allocator for sunrpc Jesper Dangaard Brouer
2021-02-24 11:55 ` Mel Gorman
2021-02-24 13:20 ` Chuck Lever
2021-02-24 18:56 ` [PATCH RFC net-next 0/3] Use bulk order-0 page allocator API for page_pool Jesper Dangaard Brouer
2021-02-24 18:56 ` [PATCH RFC net-next 1/3] net: page_pool: refactor dma_map into own function page_pool_dma_map Jesper Dangaard Brouer
2021-02-24 20:11 ` Ilias Apalodimas
2021-02-24 18:56 ` [PATCH RFC net-next 2/3] net: page_pool: use alloc_pages_bulk in refill code path Jesper Dangaard Brouer
2021-02-24 20:15 ` Ilias Apalodimas
2021-02-26 14:31 ` Jesper Dangaard Brouer [this message]
2021-02-24 18:56 ` [PATCH RFC net-next 3/3] mm: make zone->free_area[order] access faster Jesper Dangaard Brouer
2021-02-25 11:28 ` Mel Gorman
2021-02-25 15:16 ` Jesper Dangaard Brouer
2021-02-25 15:38 ` Mel Gorman
2021-02-26 14:34 ` Jesper Dangaard Brouer
2021-03-01 13:29 ` [PATCH RFC V2 net-next 0/2] Use bulk order-0 page allocator API for page_pool Jesper Dangaard Brouer
2021-03-01 13:29 ` [PATCH RFC V2 net-next 1/2] net: page_pool: refactor dma_map into own function page_pool_dma_map Jesper Dangaard Brouer
2021-03-01 13:29 ` [PATCH RFC V2 net-next 2/2] net: page_pool: use alloc_pages_bulk in refill code path Jesper Dangaard Brouer
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=20210226153149.08b3d822@carbon \
--to=brouer@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=ilias.apalodimas@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=netdev@vger.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).