public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: skbuff: update comment about pfmemalloc propagating
@ 2023-05-15  5:01 Yunsheng Lin
  2023-05-15 15:31 ` Pavel Begunkov
  2023-05-16  8:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yunsheng Lin @ 2023-05-15  5:01 UTC (permalink / raw)
  To: davem, kuba, pabeni; +Cc: netdev, linux-kernel, Yunsheng Lin, Pavel Begunkov

__skb_fill_page_desc_noacc() is not doing any pfmemalloc
propagating, and yet it has a comment about that, commit
84ce071e38a6 ("net: introduce __skb_fill_page_desc_noacc")
may have accidentally moved it to __skb_fill_page_desc_noacc(),
so move it back to __skb_fill_page_desc() which is supposed
to be doing pfmemalloc propagating.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
CC: Pavel Begunkov <asml.silence@gmail.com>
---
Also maybe we need a better name for 'noacc' or add some
comment about that, as 'noacc' seems a little confusing
for __skb_fill_page_desc_noacc().
---
 include/linux/skbuff.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 00e8c435fa1a..4b8d55247198 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2426,11 +2426,6 @@ static inline void __skb_fill_page_desc_noacc(struct skb_shared_info *shinfo,
 {
 	skb_frag_t *frag = &shinfo->frags[i];
 
-	/*
-	 * Propagate page pfmemalloc to the skb if we can. The problem is
-	 * that not all callers have unique ownership of the page but rely
-	 * on page_is_pfmemalloc doing the right thing(tm).
-	 */
 	skb_frag_fill_page_desc(frag, page, off, size);
 }
 
@@ -2463,6 +2458,11 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
 					struct page *page, int off, int size)
 {
 	__skb_fill_page_desc_noacc(skb_shinfo(skb), i, page, off, size);
+
+	/* Propagate page pfmemalloc to the skb if we can. The problem is
+	 * that not all callers have unique ownership of the page but rely
+	 * on page_is_pfmemalloc doing the right thing(tm).
+	 */
 	page = compound_head(page);
 	if (page_is_pfmemalloc(page))
 		skb->pfmemalloc	= true;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: skbuff: update comment about pfmemalloc propagating
  2023-05-15  5:01 [PATCH net-next] net: skbuff: update comment about pfmemalloc propagating Yunsheng Lin
@ 2023-05-15 15:31 ` Pavel Begunkov
  2023-05-16  8:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2023-05-15 15:31 UTC (permalink / raw)
  To: Yunsheng Lin, davem, kuba, pabeni; +Cc: netdev, linux-kernel

On 5/15/23 06:01, Yunsheng Lin wrote:
> __skb_fill_page_desc_noacc() is not doing any pfmemalloc
> propagating, and yet it has a comment about that, commit
> 84ce071e38a6 ("net: introduce __skb_fill_page_desc_noacc")
> may have accidentally moved it to __skb_fill_page_desc_noacc(),
> so move it back to __skb_fill_page_desc() which is supposed
> to be doing pfmemalloc propagating.

Looks good,

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>


> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
> CC: Pavel Begunkov <asml.silence@gmail.com>
> ---
> Also maybe we need a better name for 'noacc' or add some
> comment about that, as 'noacc' seems a little confusing
> for __skb_fill_page_desc_noacc().

It's a known pattern bur in block/ and should be "noacct",
but yeah, it can be more specific.

> ---
>   include/linux/skbuff.h | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 00e8c435fa1a..4b8d55247198 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -2426,11 +2426,6 @@ static inline void __skb_fill_page_desc_noacc(struct skb_shared_info *shinfo,
>   {
>   	skb_frag_t *frag = &shinfo->frags[i];
>   
> -	/*
> -	 * Propagate page pfmemalloc to the skb if we can. The problem is
> -	 * that not all callers have unique ownership of the page but rely
> -	 * on page_is_pfmemalloc doing the right thing(tm).
> -	 */
>   	skb_frag_fill_page_desc(frag, page, off, size);
>   }
>   
> @@ -2463,6 +2458,11 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
>   					struct page *page, int off, int size)
>   {
>   	__skb_fill_page_desc_noacc(skb_shinfo(skb), i, page, off, size);
> +
> +	/* Propagate page pfmemalloc to the skb if we can. The problem is
> +	 * that not all callers have unique ownership of the page but rely
> +	 * on page_is_pfmemalloc doing the right thing(tm).
> +	 */
>   	page = compound_head(page);
>   	if (page_is_pfmemalloc(page))
>   		skb->pfmemalloc	= true;

-- 
Pavel Begunkov

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: skbuff: update comment about pfmemalloc propagating
  2023-05-15  5:01 [PATCH net-next] net: skbuff: update comment about pfmemalloc propagating Yunsheng Lin
  2023-05-15 15:31 ` Pavel Begunkov
@ 2023-05-16  8:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-16  8:20 UTC (permalink / raw)
  To: Yunsheng Lin; +Cc: davem, kuba, pabeni, netdev, linux-kernel, asml.silence

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 15 May 2023 13:01:07 +0800 you wrote:
> __skb_fill_page_desc_noacc() is not doing any pfmemalloc
> propagating, and yet it has a comment about that, commit
> 84ce071e38a6 ("net: introduce __skb_fill_page_desc_noacc")
> may have accidentally moved it to __skb_fill_page_desc_noacc(),
> so move it back to __skb_fill_page_desc() which is supposed
> to be doing pfmemalloc propagating.
> 
> [...]

Here is the summary with links:
  - [net-next] net: skbuff: update comment about pfmemalloc propagating
    https://git.kernel.org/netdev/net-next/c/8b33485128ad

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-16  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15  5:01 [PATCH net-next] net: skbuff: update comment about pfmemalloc propagating Yunsheng Lin
2023-05-15 15:31 ` Pavel Begunkov
2023-05-16  8:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox