mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Mina Almasry <almasrymina@google.com>,
	Jason Gunthorpe <jgg@nvidia.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Shakeel Butt" <shakeelb@google.com>
Subject: Re: [RFC PATCH net-next v5 2/2] net: add netmem to skb_frag_t
Date: Thu, 18 Jan 2024 16:52:04 +0800	[thread overview]
Message-ID: <1a4ff438-581f-1e14-6dfb-051d26d752a2@huawei.com> (raw)
In-Reply-To: <65a8225348b92_11eb12942c@willemb.c.googlers.com.notmuch>

On 2024/1/18 2:54, Willem de Bruijn wrote:
> 
> I agree. A concern with CONFIGs is that what matters in practice is
> which default the distros compile with. In this case, adding hurdles
> to using the feature likely for no real reason.
> 
> Static branches are used throughout the kernel in performance
> sensitive paths, exactly because they allow optional paths effectively
> for free. I'm quite surprised that this issue is being raised so
> strongly here, as they are hardly new or controversial.

The new or controversial part about its usage in the devmem patchset as my
understanding is:
1. It is assumed the devmem and normal page processing in networking does
   not have to be treated equally in the same system, either the performance
   of devmem is favored or the performance of normal page is favored. I think
   if distros is starting to worry about the CONFIG for devmem, devmem must be
   quite popular that we might need the best performance of both. IMHO, static
   branches might be just a convenient way to start supporting the devmem for
   now as we seems to not have a clear idea of unified handling or proper API
   for both devmem and normal page.

2. Specifically to skb_frag_page(), if the returning NULL is to catch its misuse
   for devmem, then I am agreed with this generally. But the NULL returning
   handling in kcm_write_msgs() seems to suggest otherwise to me. Isn't it
   reasonable to make the semantic obvious by using WARN_ON or BUG_ON directly in
   skb_frag_page(), and returning NULL does not 100% reliably crash the thread as
   suggested by jason?

> 
> But perhaps best is to show with data. Is there a representative page
> pool benchmark that exercises the most sensitive case (XDP_DROP?) that
> we can run with and without a static branch to demonstrate that any
> diff is within the noise?
> 
>>> But none of this is related to correctness. Code calling
>>> skb_frag_page() will fail or crash if it's not handled correctly
>>> regardless of the implementation details of skb_frag_page(). In the
>>> devmem series we add support to handle it correctly via [1] & [2].
>>>
>>> --
>>> Thanks,
>>> Mina
>>
>>
>>
>> -- 
>> Thanks,
>> Mina
> 
> 
> 
> .
> 

  reply	other threads:[~2024-01-18  8:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09  1:14 [RFC PATCH net-next v5 0/2] Abstract page from net stack Mina Almasry
2024-01-09  1:14 ` [RFC PATCH net-next v5 1/2] net: introduce abstraction for network memory Mina Almasry
2024-01-10 18:45   ` Shakeel Butt
2024-01-09  1:14 ` [RFC PATCH net-next v5 2/2] net: add netmem to skb_frag_t Mina Almasry
2024-01-11 12:44   ` Yunsheng Lin
2024-01-12  0:34     ` Mina Almasry
2024-01-12 11:51       ` Yunsheng Lin
2024-01-12 15:35         ` Mina Almasry
2024-01-15  9:37           ` Yunsheng Lin
2024-01-15 23:23             ` Mina Almasry
2024-01-16  0:01               ` Jason Gunthorpe
2024-01-16 11:04                 ` Yunsheng Lin
2024-01-16 12:16                   ` Jason Gunthorpe
2024-01-17  9:28                     ` Yunsheng Lin
2024-01-17 18:00                     ` Mina Almasry
2024-01-17 18:34                       ` Mina Almasry
2024-01-17 18:54                         ` Willem de Bruijn
2024-01-18  8:52                           ` Yunsheng Lin [this message]
2024-01-18 13:56                           ` Mina Almasry
2024-01-10  2:03 ` [RFC PATCH net-next v5 0/2] Abstract page from net stack Jakub Kicinski

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=1a4ff438-581f-1e14-6dfb-051d26d752a2@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=almasrymina@google.com \
    --cc=christian.koenig@amd.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jgg@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shakeelb@google.com \
    --cc=willemdebruijn.kernel@gmail.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

all inboxes | Powered by JetHome®