[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+FuTScKx9wagxn-ano=Zj+KTzDpGsSQi6Uwv1CHr7AMg_+eCQ@mail.gmail.com>
Date: Wed, 12 Jun 2019 13:15:16 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Mahesh Bandewar <maheshb@...gle.com>,
netdev <netdev@...r.kernel.org>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH net-next 0/8] net/packet: better behavior under DDOS
On Wed, Jun 12, 2019 at 12:52 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> Using tcpdump (or other af_packet user) on a busy host can lead to
> catastrophic consequences, because suddenly, potentially all cpus
> are spinning on a contended spinlock.
>
> Both packet_rcv() and tpacket_rcv() grab the spinlock
> to eventually find there is no room for an additional packet.
>
> This patch series align packet_rcv() and tpacket_rcv() to both
> check if the queue is full before grabbing the spinlock.
>
> If the queue is full, they both increment a new atomic counter
> placed on a separate cache line to let readers drain the queue faster.
>
> There is still false sharing on this new atomic counter,
> we might in the future make it per cpu if there is interest.
>
> Eric Dumazet (8):
> net/packet: constify __packet_get_status() argument
> net/packet: constify packet_lookup_frame() and __tpacket_has_room()
> net/packet: constify prb_lookup_block() and __tpacket_v3_has_room()
> net/packet: constify __packet_rcv_has_room()
> net/packet: make tp_drops atomic
> net/packet: implement shortcut in tpacket_rcv()
> net/packet: remove locking from packet_rcv_has_room()
> net/packet: introduce packet_rcv_try_clear_pressure() helper
>
> net/packet/af_packet.c | 96 ++++++++++++++++++++++++-----------
For the series:
Acked-by: Willem de Bruijn <willemb@...gle.com>
Thanks Eric
Powered by blists - more mailing lists