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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 18E45C43381 for ; Tue, 12 Jan 2021 11:09:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8E8923102 for ; Tue, 12 Jan 2021 11:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390903AbhALLJd (ORCPT ); Tue, 12 Jan 2021 06:09:33 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:21307 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732036AbhALLJZ (ORCPT ); Tue, 12 Jan 2021 06:09:25 -0500 Date: Tue, 12 Jan 2021 11:08:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610449723; bh=9Pj0YAwWv/zYIG9LK/XF1RnE+W2Pai5Bl/8RQ1TEw0g=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=YVqimRxGmPdGr1qE4VwCnwpP3KC1lGN44f6RR5Rm2gF5aYeTlgz6C25GwT2Nt6+Gz tBvSsfkIdiXvniE6xTsuRJvpcv9t0srAcdVwO3h1gcQmDsG/TjEunpMCUNAVlndxPD kaJU+DgcktAQPBNy7ukifvHAxLGrzDPQCSj+KpRab6WG10vfBcxcvEevW4Rkv4wXwG DVi2ZlzxJYcEPD5sEokuQFEu2BagdGxkXfW9seZwp9R1z5CqQhW0g+08YbjB5qDwaC PIvn4vXoK6UM/w+N1IlZ5k/KOBXjTxu+URBOQcBzN+ArRkLoQLW5o5mrcpl0JMGMV0 GYLqdaj7AYRCg== To: Edward Cree From: Alexander Lobakin Cc: Alexander Lobakin , "David S. Miller" , Jakub Kicinski , Eric Dumazet , Edward Cree , Jonathan Lemon , Willem de Bruijn , Miaohe Lin , Steffen Klassert , Guillaume Nault , Yadu Kishore , Al Viro , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: Re: [PATCH net-next 0/5] skbuff: introduce skbuff_heads bulking and reusing Message-ID: <20210112110802.3914-1-alobakin@pm.me> In-Reply-To: References: <20210111182655.12159-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Edward Cree Date: Tue, 12 Jan 2021 09:54:04 +0000 > Without wishing to weigh in on whether this caching is a good idea... Well, we already have a cache to bulk flush "consumed" skbs, although kmem_cache_free() is generally lighter than kmem_cache_alloc(), and a page frag cache to allocate skb->head that is also bulking the operations, since it contains a (compound) page with the size of min(SZ_32K, PAGE_SIZE). If they wouldn't give any visible boosts, I think they wouldn't hit mainline. > Wouldn't it be simpler, rather than having two separate "alloc" and "flus= h" > caches, to have a single larger cache, such that whenever it becomes ful= l > we bulk flush the top half, and when it's empty we bulk alloc the bottom > half? That should mean fewer branches, fewer instructions etc. than > having to decide which cache to act upon every time. I though about a unified cache, but couldn't decide whether to flush or to allocate heads and how much to process. Your suggestion answers these questions and generally seems great. I'll try that one, thanks! > -ed Al