All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shoaib Rao <rao.shoaib@oracle.com>
To: Eric Dumazet <edumazet@google.com>
Cc: netdev <netdev@vger.kernel.org>, Jakub Kicinski <kuba@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] af_unix: fix holding spinlock in oob handling
Date: Thu, 12 Aug 2021 13:38:39 -0700	[thread overview]
Message-ID: <10b15115-b76f-d998-3206-f02f30e1f7f2@oracle.com> (raw)
In-Reply-To: <CANn89iKx9JW8atr96MJHpU34C7c3Wm72cbxkxUJQmoj=mX2UoQ@mail.gmail.com>


On 8/12/21 1:33 PM, Eric Dumazet wrote:
> On Thu, Aug 12, 2021 at 7:37 PM Shoaib Rao <rao.shoaib@oracle.com> wrote:
>>
>> On 8/12/21 12:53 AM, Eric Dumazet wrote:
>>>           if (ousk->oob_skb)
>>> -               kfree_skb(ousk->oob_skb);
>>> +               consume_skb(ousk->oob_skb);
>> Should I be using consume_skb(), as the skb is not being consumed, the
>> ref count is decremented and if zero skb will be freed.
>>
> consume_skb() and kfree_skb() have the same ref count handling.
>
> The difference is that kfree_skb() is used by convention when a packet
> is dropped
>
> Admins can look closely at packet drops with drop_monitor, or :
>
> perf record -a -g -e skb:kfree_skb sleep 10
> perf report
>
> In your case, the oob_skb is not really dropped. It is replaced by
> another one, it is part of the normal operation.

Thanks a lot for the explanation. This was very helpful. In my case the 
skb may be dropped (oob was not read but the read has passed beyond oob, 
or could become part of normal data). Anyways, I will change it to use 
consume_skb().

Regards,

Shoaib


  reply	other threads:[~2021-08-12 20:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 22:06 [PATCH] af_unix: fix holding spinlock in oob handling Rao Shoaib
2021-08-12  7:53 ` Eric Dumazet
2021-08-12 16:23   ` Shoaib Rao
2021-08-12 17:37   ` Shoaib Rao
2021-08-12 20:33     ` Eric Dumazet
2021-08-12 20:38       ` Shoaib Rao [this message]
2021-08-13 17:32 ` Jakub Kicinski
2021-08-13 17:59   ` Shoaib Rao
2021-08-13 17:46 Rao Shoaib

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=10b15115-b76f-d998-3206-f02f30e1f7f2@oracle.com \
    --to=rao.shoaib@oracle.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.