[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190614.185300.694618024091547290.davem@davemloft.net>
Date: Fri, 14 Jun 2019 18:53:00 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: edumazet@...gle.com
Cc: willemb@...gle.com, maheshb@...gle.com, netdev@...r.kernel.org,
eric.dumazet@...il.com
Subject: Re: [PATCH net-next 0/8] net/packet: better behavior under DDOS
From: Eric Dumazet <edumazet@...gle.com>
Date: Wed, 12 Jun 2019 09:52:25 -0700
> 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.
Series applied.
Powered by blists - more mailing lists