From: Yunsheng Lin <linyunsheng@huawei.com>
To: Liang Chen <liangchen.linux@gmail.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<hawk@kernel.org>, <ilias.apalodimas@linaro.org>
Cc: <netdev@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH net-next v4 4/4] skbuff: Optimization of SKB coalescing for page pool
Date: Wed, 29 Nov 2023 11:56:40 +0800 [thread overview]
Message-ID: <664e753b-23ba-56b7-a2b7-a2bd83260887@huawei.com> (raw)
In-Reply-To: <20231129031201.32014-5-liangchen.linux@gmail.com>
On 2023/11/29 11:12, Liang Chen wrote:
>
> +/**
> + * skb_pp_get_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 inline void skb_pp_get_frag_ref(struct page *page)
Simiar comment for 'inline ' too.
Also, Is skb_pp_frag_ref() a better name than skb_pp_get_frag_ref()
mirroring skb_frag_ref()?
> +{
> + struct page *head_page = compound_head(page);
> +
> + if (likely(skb_frag_is_pp_page(head_page)))
> + atomic_long_inc(&head_page->pp_ref_count);
As pp_ref_count is supposed to be a internal field to page_pool,
I am not sure if it matters that much to manipulate pp_ref_count
directly in skbuff core.
Maybe we can provide a helper for that if it really matter in the
future.
> + else
> + get_page(head_page);
I suppose we can use page_ref_inc() as we have a compound_head()
calling in the above.
Other than the above nits, LGTM.
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
next prev parent reply other threads:[~2023-11-29 3:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 3:11 [PATCH net-next v4 0/4] skbuff: Optimize " Liang Chen
2023-11-29 3:11 ` [PATCH net-next v4 1/4] page_pool: Rename pp_frag_count to pp_ref_count Liang Chen
2023-11-29 3:30 ` Yunsheng Lin
2023-11-29 3:11 ` [PATCH net-next v4 2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment Liang Chen
2023-11-29 3:12 ` [PATCH net-next v4 3/4] skbuff: Add a function to check if a page belongs to page_pool Liang Chen
2023-11-29 3:40 ` Yunsheng Lin
2023-11-29 7:08 ` Liang Chen
2023-11-29 3:12 ` [PATCH net-next v4 4/4] skbuff: Optimization of SKB coalescing for page pool Liang Chen
2023-11-29 3:56 ` Yunsheng Lin [this message]
2023-11-29 7:08 ` 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=664e753b-23ba-56b7-a2b7-a2bd83260887@huawei.com \
--to=linyunsheng@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=liangchen.linux@gmail.com \
--cc=linux-mm@kvack.org \
--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