Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp565648pxb; Wed, 13 Jan 2021 10:14:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBcbhBip5JckejRvMC4qDcQBhfN05kYtlZBrcH4QsmVpbhBUozOnDQpzTwicjK343ZN3Z0 X-Received: by 2002:aa7:c9c9:: with SMTP id i9mr2813782edt.160.1610561647043; Wed, 13 Jan 2021 10:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610561647; cv=none; d=google.com; s=arc-20160816; b=QmiUA9iZqxEyQkxmCJtsRZZzcXVScxcHy7oT7Nh6aR88jjLgJYJyW4qGXnV8Z44kYL ysTAvaIILVJUmv+8f2olCBtuMKMk3OR+AX0HYnzKTh2qxxd28XJrLA7mT1f+ZlfZ5tD2 NLctGNTDSWLeU8UPwo+oRVSLhCR5rKTG6yHC6Fure0MLhMryFhdECV/b33irWcnIXF+U YEZFbTA11ixDbN3/I5Y6PDyavihK5VVS1ERK4YH3Xhk6L6dfj33DHwIefg4yij9/IUdg nHfuPVV3JP0bFI1zIZ+a4r+rhckF/w7xNhdGbAQKkAD891enk2MqKi5qKqjo3aQjV52W PF9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=uqkXytG4n457AzdSY0xCIV2KcGZ23Z52bb2JSamAP4Y=; b=U4XeSagRtf0db+T03yNDaJp1yp/t3VeZKsIXRwAFq4/lw8FPQ7EWw9SXLhRPacBuhv +vpgeb2ACzSd7XNVaYKlq1Q+ef0JymMOlLZvjlwe6AT1V7gIE3o2jLzbQkBSDRhEAf/A 2vOEjv1yQHk8lW6+UGk16bOsFDR9pBrOsVutSmV/nzWgZByU+ji458WwUCD3Ti485Wbs 9DDiWIG8s52VBo4bg5ESKgPnY97qABgwGIwnGlr6B8CfdfhhPqGbtWfWzCbKQMng6p8i Fg0p6fUG4bZ7+Xz72Dh77i3hEyjcxdt31aMbAaZR7FdqgU08UUcjAhNE8ZSIEPSdKkvm HiWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RgeWmANp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si1225587eje.504.2021.01.13.10.13.42; Wed, 13 Jan 2021 10:14:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RgeWmANp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbhAMSMx (ORCPT + 99 others); Wed, 13 Jan 2021 13:12:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:37038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727198AbhAMSMx (ORCPT ); Wed, 13 Jan 2021 13:12:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BCA88233ED; Wed, 13 Jan 2021 18:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610561532; bh=9elX7cNWCe9G39/ZIw1v4prZnJFSz0GD4UUQdqJ6cqE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RgeWmANpXc1zGm081hvR7XF+GkBpB0TC98RrJNkav937ZHj09ykKwwD8xh3/uU97T Vt2UhvNZFdwfsOPFEYKH1H9a/ttv4wSLURnfnZrTrfzkNXPjFKl6+tijxAoEbgVAOk S2Ptnrzty7BXw0YCJWEoYe9NmIQ2RF1gB0VzBtNeoM2uzsRmUCr8CKix9oNXUx3CdS sXLpFNTXSzqFzeXvBczfr3C5qEqCxJKkwfHb856KV8nxGRSTukfB+UFslnUfrYukz6 g6iAurhru6LdWCrTZ8xJGbfbLh/PhXu5gdqI2ndxW1p+4CXMLNc06OfaSCI+nJ3ggp tSge7vUBE9q4g== Date: Wed, 13 Jan 2021 10:12:10 -0800 From: Jakub Kicinski To: Eric Dumazet Cc: Alexander Lobakin , Edward Cree , "David S. Miller" , Edward Cree , Jonathan Lemon , Willem de Bruijn , Miaohe Lin , Steffen Klassert , Guillaume Nault , Yadu Kishore , Al Viro , netdev , LKML Subject: Re: [PATCH net-next 0/5] skbuff: introduce skbuff_heads bulking and reusing Message-ID: <20210113101210.6d0ad308@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210111182655.12159-1-alobakin@pm.me> <20210112110802.3914-1-alobakin@pm.me> <20210112170242.414b8664@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210113090341.74832be9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jan 2021 18:15:20 +0100 Eric Dumazet wrote: > > IDK much about MM, but we already have a kmem_cache for skbs and now > > we're building a cache on top of a cache. Shouldn't MM take care of > > providing a per-CPU BH-only lockless cache? > > I think part of the improvement comes from bulk operations, which are > provided by mm layer. > > I also note Alexander made no provision for NUMA awareness. > Probably reusing skb located on a remote node will not be ideal. I was wondering about that yesterday, but couldn't really think of a legitimate reason not to have XPS set up right. Do you have particular config in mind, or are we taking "default config"? Also can't the skb _itself_ be pfmemalloc? My main point is that I'm wondering if this sort of cache would be useful when allocating skbs for sockets? Assuming that the network stack is not isolated to its own cores, won't fronting alloc_skb() with bh_disable() try the cache bh_enable() potentially help? In that sense fronting kmem_cache would feel cleaner than our own little ring buffer.