linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Vasily Averin <vvs@virtuozzo.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	David Ahern <dsahern@kernel.org>,
	Julian Wiedmann <jwi@linux.ibm.com>,
	Christoph Paasch <christoph.paasch@gmail.com>,
	linux-kernel@vger.kernel.org, kernel@openvz.org
Subject: Re: [PATCH net v9] skb_expand_head() adjust skb->truesize incorrectly
Date: Wed, 20 Oct 2021 09:18:13 -0700	[thread overview]
Message-ID: <2721362c-462b-878f-9e09-9f6c4353c73d@gmail.com> (raw)
In-Reply-To: <a7318420-0182-7e66-33e3-3368d4cc181f@virtuozzo.com>



On 10/4/21 10:57 PM, Vasily Averin wrote:
> On 10/4/21 10:26 PM, Eric Dumazet wrote:

>>
>>     Why not re-using is_skb_wmem() here ?
>>     Testing != sock_edemux looks strange.
> 
> All non-wmem skbs was cloned and then was freed already.
> After pskb_expand_head() call we can have:
> (1) either original wmem skbs 
> (2) or cloned skbs: 
>  (2a) either without sk at all,
>  (2b) or with sock_edemux destructor (that was set inside skb_set_owner_w() for !sk_fullsock(sk))
>  (2c) or with sock_wfree destructor (that was set inside skb_set_owner_w() for sk_fullsock(sk))
> 
> (2a) and (2b) do not require truesize/sk_wmem_alloc update, it was handled inside pskb_expand_head()
> (1) and (2c) cases are processed here.
> 
> If required I can add this explanation either into patch description or as comment.
> 

sock_edemux is one of the current destructors.

New ones will be added later. We can not expect that in two or three years,
at least one reviewer will remember this special case.

I would prefer you list the known destructors (allow-list, instead of disallow-list)



> Btw I just noticed that we can avoid cloning for original skbs without sk.
> How do you think should I do it?

Lets wait a bit before new features...


  parent reply	other threads:[~2021-10-20 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210920111259.18f9cc01@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
2021-09-20 21:41 ` [PATCH net v8] skb_expand_head() adjust skb->truesize incorrectly Vasily Averin
2021-09-21  5:21   ` Vasily Averin
2021-10-04 13:00     ` [PATCH net v9] " Vasily Averin
2021-10-04 13:14       ` Vasily Averin
2021-10-04 19:26       ` Eric Dumazet
2021-10-05  5:57         ` Vasily Averin
2021-10-20 16:14           ` Eric Dumazet
2021-10-20 16:18           ` Eric Dumazet [this message]
2021-10-22 10:28             ` [PATCH net v10] " Vasily Averin
2021-10-22 19:32               ` Eric Dumazet
2021-10-22 20:50               ` patchwork-bot+netdevbpf

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=2721362c-462b-878f-9e09-9f6c4353c73d@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=christoph.paasch@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=jwi@linux.ibm.com \
    --cc=kernel@openvz.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vvs@virtuozzo.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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;
as well as URLs for NNTP newsgroup(s).