From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Subject: Re: [PATCH net-next v2 2/2] unix: Show number of pending scm files of receive queue in fdinfo
Date: Tue, 25 Feb 2020 11:07:51 +0300 [thread overview]
Message-ID: <96efcefc-fa4f-cd9c-78e1-5e00c0a96321@virtuozzo.com> (raw)
In-Reply-To: <2c18fad07d0e303557185aa760ba37688191eaa3.camel@redhat.com>
Hi,
On 24.02.2020 13:15, Paolo Abeni wrote:
> Hi,
>
> On Mon, 2019-12-09 at 10:03 +0000, Kirill Tkhai wrote:
>> diff --git a/include/net/af_unix.h b/include/net/af_unix.h
>> index 3426d6dacc45..17e10fba2152 100644
>> --- a/include/net/af_unix.h
>> +++ b/include/net/af_unix.h
>> @@ -41,6 +41,10 @@ struct unix_skb_parms {
>> u32 consumed;
>> } __randomize_layout;
>>
>> +struct scm_stat {
>> + u32 nr_fds;
>> +};
>> +
>
> I'd like to drop the 'destructor' argument from
> __skb_try_recv_datagram() and friends - that will both clean-up the
> datagram code a bit and will avoid an indirect call in fast-path.
>
> unix_dgram_recvmsg() needs special care: with the proposed change
> scm_stat_del() will be called explicitly after _skb_try_recv_datagram()
> while 'nr_fds' must to be updated under the receive queue lock.
>
> Any of the following should work:
> - change 'nr_fds' to an atomic type, and drop all lockdep stuff
> - acquire again the receive queue spinlock before calling
> scm_stat_del(), ev doing that only 'if UNIXCB(skb).fp'
> - open code a variant of __skb_try_recv_datagram() which will take care
> of scm_stat_del() under the receive queue lock.
>
> Do you have any preferences? If you don't plan to add more fields to
> 'struct scm_stat' I would go for the first option.
The first option looks the best in my opinion.
Kirill
next prev parent reply other threads:[~2020-02-25 8:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <157588582628.223723.6787992203555637280.stgit () localhost ! localdomain>
2020-02-24 10:15 ` [PATCH net-next v2 2/2] unix: Show number of pending scm files of receive queue in fdinfo Paolo Abeni
2020-02-25 8:07 ` Kirill Tkhai [this message]
2019-12-09 10:03 [PATCH net-next v2 0/2] unix: Show number of scm files " Kirill Tkhai
2019-12-09 10:03 ` [PATCH net-next v2 2/2] unix: Show number of pending scm files of receive queue " Kirill Tkhai
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=96efcefc-fa4f-cd9c-78e1-5e00c0a96321@virtuozzo.com \
--to=ktkhai@virtuozzo.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).