linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Liang Chen <liangchen.linux@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	davem@davemloft.net, edumazet@google.com,  pabeni@redhat.com,
	hawk@kernel.org, linyunsheng@huawei.com,  netdev@vger.kernel.org,
	linux-mm@kvack.org, jasowang@redhat.com,  almasrymina@google.com
Subject: Re: [PATCH net-next v8 4/4] skbuff: Optimization of SKB coalescing for page pool
Date: Tue, 12 Dec 2023 11:00:06 +0800	[thread overview]
Message-ID: <CAKhg4tKZ=ab50KqxpO47AreGocekXBuGsxtmFHmTDAjoThk27A@mail.gmail.com> (raw)
In-Reply-To: <20231211121409.5cfaebd5@kernel.org>

On Tue, Dec 12, 2023 at 4:14 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 11 Dec 2023 09:46:55 +0200 Ilias Apalodimas wrote:
> > As I said in the past the patch look correct. I don't like the fact
> > that more pp internals creep into the default network stack, but
> > perhaps this is fine with the bigger adoption?
> > Jakub any thoughts/objections?
>
> Now that you asked... the helper does seem to be in sort of
> a in-between state of being skb specific.
>
> What worries me is that this:
>
> +/**
> + * skb_pp_frag_ref() - Increase fragment reference count of a page
> + * @page:      page of the fragment on which to increase a reference
> + *
> + * Increase fragment reference count (pp_ref_count) on a page, but if it is
> + * not a page pool page, fallback to increase a reference(_refcount) on a
> + * normal page.
> + */
> +static void skb_pp_frag_ref(struct page *page)
> +{
> +       struct page *head_page = compound_head(page);
> +
> +       if (likely(is_pp_page(head_page)))
> +               page_pool_ref_page(head_page);
> +       else
> +               page_ref_inc(head_page);
> +}
>
> doesn't even document that the caller must make sure that the skb
> which owns this page is marked for pp recycling. The caller added
> by this patch does that, but we should indicate somewhere that doing
> skb_pp_frag_ref() for frag in a non-pp-recycling skb is not correct.
>
> We can either lean in the direction of making it less skb specific,
> put the code in page_pool.c / helpers.h and make it clear that the
> caller has to be careful.
> Or we make it more skb specific, take a skb pointer as arg, and also
> look at its recycling marking..
> or just improve the kdoc.

Thank you for the suggestion! I will proceed with improving the kdoc.


  reply	other threads:[~2023-12-12  3:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11  3:52 [PATCH net-next v8 0/4] skbuff: Optimize " Liang Chen
2023-12-11  3:52 ` [PATCH net-next v8 1/4] page_pool: transition to reference count management after page draining Liang Chen
2023-12-11  7:43   ` Ilias Apalodimas
2023-12-11  3:52 ` [PATCH net-next v8 2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment Liang Chen
2023-12-11 10:12   ` Jesper Dangaard Brouer
2023-12-11  3:52 ` [PATCH net-next v8 3/4] skbuff: Add a function to check if a page belongs to page_pool Liang Chen
2023-12-11  7:40   ` Ilias Apalodimas
2023-12-11  3:52 ` [PATCH net-next v8 4/4] skbuff: Optimization of SKB coalescing for page pool Liang Chen
2023-12-11  7:46   ` Ilias Apalodimas
2023-12-11 20:14     ` Jakub Kicinski
2023-12-12  3:00       ` Liang Chen [this message]
2023-12-13  7:09       ` Ilias Apalodimas
2023-12-14  2:26         ` Liang Chen
2023-12-14  2:34           ` Jakub Kicinski
2023-12-14  2:46             ` Liang Chen

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='CAKhg4tKZ=ab50KqxpO47AreGocekXBuGsxtmFHmTDAjoThk27A@mail.gmail.com' \
    --to=liangchen.linux@gmail.com \
    --cc=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=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