[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iL4WBTKErxc7_31=RpkpznnZGAoijrevUk8xj+q9ZyFkQ@mail.gmail.com>
Date: Mon, 19 Feb 2024 19:31:40 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
eric.dumazet@...il.com, Willem de Bruijn <willemdebruijn.kernel@...il.com>,
Daan De Meyer <daan.j.demeyer@...il.com>, Kuniyuki Iwashima <kuniyu@...zon.com>,
Martin KaFai Lau <martin.lau@...nel.org>, David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH net] net: implement lockless setsockopt(SO_PEEK_OFF)
On Mon, Feb 19, 2024 at 7:07 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On Mon, 2024-02-19 at 14:12 +0000, Eric Dumazet wrote:
> > syzbot reported a lockdep violation [1] involving af_unix
> > support of SO_PEEK_OFF.
> >
> > Since SO_PEEK_OFF is inherently not thread safe (it uses a per-socket
> > sk_peek_off field), there is really no point to enforce a pointless
> > thread safety in the kernel.
> >
> > After this patch :
> >
> > - setsockopt(SO_PEEK_OFF) no longer acquires the socket lock.
> >
> > - skb_consume_udp() no longer has to acquire the socket lock.
> >
> > - af_unix no longer needs a special version of sk_set_peek_off(),
> > because it does not lock u->iolock anymore.
> >
> > As a followup, we could replace prot->set_peek_off to be a boolean
> > and avoid an indirect call, since we always use sk_set_peek_off().
>
> Only related to that mentioned possible follow-up: I'm trying to
> benchmarking the UDP change mentioned here:
>
> https://lore.kernel.org/netdev/725a92b4813242549f2316e6682d3312b5e658d8.camel@redhat.com/
>
> and that it will require an udp specific set_peek_off() variant.
>
> The indirect call in the control path should not be too bad, right?
Not at all ;)
Powered by blists - more mailing lists