All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Jonathan Lemon <jonathan.lemon@gmail.com>
Cc: <netdev@vger.kernel.org>, brouer@redhat.com
Subject: Re: [PATCH net-next] net: Don't return pfmemalloc pages to the page pool.
Date: Thu, 20 Dec 2018 14:03:27 +0100	[thread overview]
Message-ID: <20181220140327.4e186cdb@redhat.com> (raw)
In-Reply-To: <20181219200651.824962-1-jonathan.lemon@gmail.com>

On Wed, 19 Dec 2018 12:06:51 -0800
Jonathan Lemon <jonathan.lemon@gmail.com> wrote:

> Return pfmemalloc pages back to the page allocator, instead of
> holding them in the page pool.

Have you experience this issue in practice or is it theory?

>  While here, also use the __page_pool_return_page() API.

Don't combine several unrelated changed in one patch.
 
> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
> ---
>  net/core/page_pool.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 43a932cb609b..091007ff14a3 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -233,7 +233,7 @@ void __page_pool_put_page(struct page_pool *pool,
>  	 *
>  	 * refcnt == 1 means page_pool owns page, and can recycle it.
>  	 */
> -	if (likely(page_ref_count(page) == 1)) {
> +	if (likely(page_ref_count(page) == 1 && !page_is_pfmemalloc(page))) {

I don't like adding this in the hot-path.  Instead we could move this
to the page alloc slow-path, and reject allocating pages with
pgmemalloc in the first place.


>  		/* Read barrier done in page_ref_count / READ_ONCE */
>  
>  		if (allow_direct && in_serving_softirq())
> @@ -259,8 +259,7 @@ void __page_pool_put_page(struct page_pool *pool,
>  	 * doing refcnt based recycle tricks, meaning another process
>  	 * will be invoking put_page.
>  	 */
> -	__page_pool_clean_page(pool, page);
> -	put_page(page);
> +	__page_pool_return_page(pool, page);
>  }
>  EXPORT_SYMBOL(__page_pool_put_page);
>  



-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2018-12-20 13:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 20:06 [PATCH net-next] net: Don't return pfmemalloc pages to the page pool Jonathan Lemon
2018-12-20 13:03 ` Jesper Dangaard Brouer [this message]
2018-12-20 22:11   ` Jonathan Lemon
2018-12-20 23:41     ` Saeed Mahameed
2018-12-21  0:56       ` Jonathan Lemon
2018-12-21  2:13         ` Saeed Mahameed
2018-12-21  2:26           ` Saeed Mahameed
2018-12-21 14:42     ` 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=20181220140327.4e186cdb@redhat.com \
    --to=brouer@redhat.com \
    --cc=jonathan.lemon@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.