From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6575DC43381 for ; Mon, 25 Mar 2019 16:03:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DA4A20830 for ; Mon, 25 Mar 2019 16:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729606AbfCYQDo (ORCPT ); Mon, 25 Mar 2019 12:03:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfCYQDn (ORCPT ); Mon, 25 Mar 2019 12:03:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 409E58762B; Mon, 25 Mar 2019 16:03:43 +0000 (UTC) Received: from carbon (ovpn-200-46.brq.redhat.com [10.40.200.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5F8564293; Mon, 25 Mar 2019 16:03:38 +0000 (UTC) Date: Mon, 25 Mar 2019 17:03:37 +0100 From: Jesper Dangaard Brouer To: Felix Fietkau Cc: Eric Dumazet , netdev@vger.kernel.org, davem@davemloft.net, fw@strlen.de, brouer@redhat.com Subject: Re: [PATCH v2] net: use bulk free in kfree_skb_list Message-ID: <20190325170337.145026cb@carbon> In-Reply-To: References: <20190324165644.21303-1-nbd@nbd.name> <3d7fd814-9525-f0a6-95ff-cccc2de8ecd8@gmail.com> <283cb1b7-dc83-04fd-15c0-b4bfd2411cbc@nbd.name> <37b3be81-f86d-3805-10d3-177e66d8d8f7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Mar 2019 16:03:43 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 25 Mar 2019 10:35:35 +0100 Felix Fietkau wrote: > On 2019-03-25 10:31, Eric Dumazet wrote: > > On 03/25/2019 02:09 AM, Felix Fietkau wrote: > >> On 2019-03-25 09:51, Eric Dumazet wrote: > >>> On 03/24/2019 09:56 AM, Felix Fietkau wrote: > >>>> > >>>> Since we're freeing multiple skbs, we might as well use bulk > >>>> free to save a few cycles. Use the same conditions for bulk free > >>>> as in napi_consume_skb. > >>> > >>> I do not believe kfree_skb_list() is used in the fast path, so do > >>> we really need to make it so complex ? > >> > >> mac80211 uses it to free the fraglist from A-MSDU aggregated > >> packets in the tx status path. That's one fast path where it gets > >> used right now and the reason it was showing up in my perf > >> traces. Notice that kfree_skb_list(to_free) is used in (what I consider) "fast-path" when the qdisc system drops packets, happens via to_free in bottom of __dev_xmit_skb(). And fq_codel (which is default in most distro's today) have an optimization (in fq_codel_drop()) for bulk freeing SKBs, which will also benefit from this. Thus, I still think it will be valuable to optimize kfree_skb_list(). > > This is not drop monitor friendly then.... > > > > TX completion should use consume_skb() or dev_kfree_skb() > > > > BTW, I wonder what drop-monitor signal bulk free is sending ? > > Good point about the drop monitor. Would you prefer that I replace > this patch with one that adds a consume_skb_list function and another > one that makes mac80211 use it? -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer