From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [RFC] net: remove busylock Date: Fri, 20 May 2016 06:11:49 -0700 Message-ID: <1463749909.18194.291.camel@edumazet-glaptop3.roam.corp.google.com> References: <1463677716.18194.203.camel@edumazet-glaptop3.roam.corp.google.com> <20160520092903.38620c60@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Alexander Duyck , netdev , Alexander Duyck , John Fastabend , Jamal Hadi Salim To: Jesper Dangaard Brouer Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:36414 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754978AbcETNLv (ORCPT ); Fri, 20 May 2016 09:11:51 -0400 Received: by mail-pf0-f194.google.com with SMTP id g132so11316280pfb.3 for ; Fri, 20 May 2016 06:11:51 -0700 (PDT) In-Reply-To: <20160520092903.38620c60@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 2016-05-20 at 09:29 +0200, Jesper Dangaard Brouer wrote: > The hole idea behind allowing bulk qdisc dequeue, was to mitigate this, > by allowing dequeue to do more work, while holding the lock. > > You mention HTB. Notice HTB does not take advantage of bulk dequeue. > Have you tried to enable/allow HTB to bulk dequeue? > Well, __QDISC___STATE_RUNNING means exactly that : one cpu is dequeueing many packets from the qdisc and tx them to the device. It is generic for any kind of qdisc. HTB bulk dequeue would have to call ->dequeue() mutiple times. If you do this while holding qdisc spinlock, you block other cpus from doing concurrent ->enqueue(), adding latencies (always the same trade off...) HTB wont be anytime soon have separate protections for the ->enqueue() and the ->dequeue(). Have you looked at this monster ? I did, many times... Note that I am working on a patch to transform __QDISC___STATE_RUNNING to a seqcount do that we can grab stats without holding the qdisc lock.