linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mina Almasry <almasrymina@google.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Liang Chen <liangchen.linux@gmail.com>,
	davem@davemloft.net, edumazet@google.com,  pabeni@redhat.com,
	hawk@kernel.org, ilias.apalodimas@linaro.org,
	 linyunsheng@huawei.com, netdev@vger.kernel.org,
	linux-mm@kvack.org,  jasowang@redhat.com
Subject: Re: [PATCH net-next v7 4/4] skbuff: Optimization of SKB coalescing for page pool
Date: Mon, 11 Dec 2023 12:07:06 -0800	[thread overview]
Message-ID: <CAHS8izMPKJZz=n2CoEiQv+HsC_QKRLm3Wk4V-cq7Jvv=Vr=y9g@mail.gmail.com> (raw)
In-Reply-To: <20231211113203.2ae8bccf@kernel.org>

On Mon, Dec 11, 2023 at 11:32 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Sun, 10 Dec 2023 20:21:21 -0800 Mina Almasry wrote:
> > Is it possible/desirable to add a comment to skb_frag_ref() that it
> > should not be used with skb->pp_recycle? At least I was tripped by
> > this, but maybe it's considered obvious somehow.
> >
> > But I feel like this maybe needs to be fixed. Why does the page_pool
> > need a separate page->pp_ref_count? Why not use page->_refcount like
> > the rest of the code? Is there a history here behind this decision
> > that you can point me to? It seems to me that
> > incrementing/decrementing page->pp_ref_count may be equivalent to
> > doing the same on page->_refcount.
>
> Does reading the contents of the comment I proposed here:
> https://lore.kernel.org/all/20231208173816.2f32ad0f@kernel.org/
> elucidate it? The pp_ref_count means the holder is aware that
> they can't release the reference by calling put_page().
> Because (a) we may need to clean up the pp state, unmap DMA etc.
> and (b) one day it may not even be a real page (your work).
>

Thank you, that makes sense.

> TBH I'm partial to the rename from patch 1, so I wouldn't delay this
> work any more :) But you have a point that we should inspect the code
> and consider making the semantics of skb_frag_ref() stronger all by
> itself, without the need to add a new flavor of the helper..
> Are you okay with leaving that as a follow up or do you reckon it's
> easy enough we should push for it now?

I think the rename from pp_frag_count -> pp_ref_count is a huge
improvement, and I think the fact that the netstack has a way to
obtain a reference on a pp frag is also a huge improvement. Please go
ahead mearging this if you like, I was asking questions for my own
education/follow up work to consider.

-- 
Thanks,
Mina


      reply	other threads:[~2023-12-11 20:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 10:54 [PATCH net-next v7 0/4] skbuff: Optimize " Liang Chen
2023-12-06 10:54 ` [PATCH net-next v7 1/4] page_pool: transition to reference count management after page draining Liang Chen
2023-12-09  1:38   ` Jakub Kicinski
2023-12-11  3:31     ` Liang Chen
2023-12-06 10:54 ` [PATCH net-next v7 2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment Liang Chen
2023-12-06 10:54 ` [PATCH net-next v7 3/4] skbuff: Add a function to check if a page belongs to page_pool Liang Chen
2023-12-06 10:54 ` [PATCH net-next v7 4/4] skbuff: Optimization of SKB coalescing for page pool Liang Chen
2023-12-09  2:18   ` Mina Almasry
2023-12-11  3:38     ` Liang Chen
2023-12-11  4:21       ` Mina Almasry
2023-12-11 19:32         ` Jakub Kicinski
2023-12-11 20:07           ` Mina Almasry [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='CAHS8izMPKJZz=n2CoEiQv+HsC_QKRLm3Wk4V-cq7Jvv=Vr=y9g@mail.gmail.com' \
    --to=almasrymina@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=liangchen.linux@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=linyunsheng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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