From: Chris Mason <clm@fb.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Sabrina Dubroca <sd@queasysnail.net>,
David Miller <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: Revert "net: avoid one atomic operation in skb_clone()"
Date: Fri, 21 Nov 2014 14:39:34 -0500 [thread overview]
Message-ID: <1416598774.24312.9@mail.thefacebook.com> (raw)
In-Reply-To: <1416598161.8629.120.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Nov 21, 2014 at 2:29 PM, Eric Dumazet <eric.dumazet@gmail.com>
wrote:
> On Fri, 2014-11-21 at 19:05 +0100, Sabrina Dubroca wrote:
>> Hello Eric,
>>
>> >
>> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>> > index c16615bfb61e..be4c7deed971 100644
>> > --- a/net/core/skbuff.c
>> > +++ b/net/core/skbuff.c
>> > @@ -552,20 +552,13 @@ static void kfree_skbmem(struct sk_buff
>> *skb)
>> > case SKB_FCLONE_CLONE:
>> > fclones = container_of(skb, struct sk_buff_fclones, skb2);
>> >
>> > - /* Warning : We must perform the atomic_dec_and_test() before
>> > - * setting skb->fclone back to SKB_FCLONE_FREE, otherwise
>> > - * skb_clone() could set clone_ref to 2 before our decrement.
>> > - * Anyway, if we are going to free the structure, no need to
>> > - * rewrite skb->fclone.
>> > + /* The clone portion is available for
>> > + * fast-cloning again.
>> > */
>> > - if (atomic_dec_and_test(&fclones->fclone_ref)) {
>> > + skb->fclone = SKB_FCLONE_UNAVAILABLE;
>>
>> Shouldn't that be SKB_FCLONE_FREE ?
>
> Absolutely :(
>
> I'll send a v2, thanks !
v1 made it through the first pass here. I'll switch to SKB_FCLONE_FREE
and restart.
-chris
next prev parent reply other threads:[~2014-11-21 19:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 16:16 crash in __kfree_skb on v3.18-rc5 with CONFIG_DEBUG_PAGEALLOC Chris Mason
2014-11-21 16:31 ` Eric Dumazet
2014-11-21 16:37 ` Eric Dumazet
2014-11-21 16:47 ` Chris Mason
2014-11-21 16:56 ` Eric Dumazet
2014-11-21 17:18 ` Chris Mason
2014-11-21 16:41 ` Chris Mason
2014-11-21 16:57 ` Chris Mason
2014-11-21 17:04 ` [PATCH net] net: Revert "net: avoid one atomic operation in skb_clone()" Eric Dumazet
2014-11-21 18:05 ` Sabrina Dubroca
2014-11-21 19:29 ` Eric Dumazet
2014-11-21 19:39 ` Chris Mason [this message]
2014-11-21 19:47 ` [PATCH v2 " Eric Dumazet
2014-11-21 20:27 ` David Miller
2014-11-21 21:15 ` Chris Mason
2014-11-21 16:33 ` crash in __kfree_skb on v3.18-rc5 with CONFIG_DEBUG_PAGEALLOC Chris Mason
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=1416598774.24312.9@mail.thefacebook.com \
--to=clm@fb.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.