From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f49.google.com (mail-yx1-f49.google.com [74.125.224.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 026EE3E95B5 for ; Wed, 21 Jan 2026 05:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768973381; cv=none; b=RyVHUGQEyIkathTXdDV/g9cvBy49yc3lE6KzOLYWFRgq5EmWRREO8hqEIATHmJgkH919M9BKZ/sghRUgqiW5BB5LfqIgu/1Js6m0TaZ+5TFX35H6Cx8R3mD0/JsEZlPVgqquz/e/4O5Cm0WD8ZNBhgTHH7igl+x0LGxXM/DDrFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768973381; c=relaxed/simple; bh=uQc7kvpnr3eWQJ+H7RqNdRd5OZKaD9lrnlN+V2TeZpw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sUD0KcjebuHt+ICo7EUdSdHe+ejANV5RsLFSVVLLuLrVcxZV4ZrzsOPLHTbnQ8g8dvyaFUL2GqpPbKV3MYqdnIr6IyWCBYc3cL0p6Hw6Ws1ub38QdvKEJYNdYM6ONxGoXYKSbKRoHYN7NlC90ek/TdjaHtbQNIQHL+2jup33/6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N5Mlk7u9; arc=none smtp.client-ip=74.125.224.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N5Mlk7u9" Received: by mail-yx1-f49.google.com with SMTP id 956f58d0204a3-6467c5acb7dso5230922d50.1 for ; Tue, 20 Jan 2026 21:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768973379; x=1769578179; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Xj8z6sgYRSc2zcxSy7UyhR6bNJrDd7gH3jcOHm2KVdE=; b=N5Mlk7u9FDtv8iuzab4wtE//XR4wWyXKvWvfNWKiMhMYaY2hk90IsgZpkX9QxE5r5W E+qUf/NIq8OaJIc13eE5mtj6u9w7AAHIIoWzH5gg9L15O6Gpkq0vl64BijAuY+dpdn1l Cd3MmbfbEGxleWpjm6Qz/UbSFqFOZ9oFZnKUfmoKwvefd+DUMatAKmC7j6CtXDqMy3wb oKDTDIyRwiIuvQvjbjA3GujyM2WPByE0MUuc7FrndL7Og6k87i8CnbJAosSKeGKiJjob 4tZXjTKNqik++zdsjhNAQVzTeWVwaTbOEpfXcEJp4VjS9nLKnffIbWsvhZN+tSimS6Rr upOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768973379; x=1769578179; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xj8z6sgYRSc2zcxSy7UyhR6bNJrDd7gH3jcOHm2KVdE=; b=N9FYpBzY6+JvNpL5gI2E0dwm7c5Vuec7zFugyr8G4d1dRx2FaALkLrSo7O6e1S49gI dk3fe6q8F7bhiFS+4ZlgD/wNMLYFv5SL5yOJlQ72hGj2RVhpybaM9IHM2bRy6BveM84d JQMFMtxayNX4f980RAAZlMO5U+7H6CFwwfrHcdCL285rbKnATk41GvgPLlXIeyEp9wtO f833ZWrZA5d43beXGsoeqSL8fnMXiZt3TRWpEYXrmVYSMKdC7hUu4htEbVgWMqoQXJ1I pO9Vo+tu3JXmlh2V9rUx563xw/6VmcOH1+Un3YiUa1mLl1XzMOqeQ86+mGWrhNIorgME SpYw== X-Forwarded-Encrypted: i=1; AJvYcCVQP1WLtrM2YtGVBh06fEIF3T8aPGmVBGY2Ygazx4XdNe4icq/vSn0qJUrTf7P28R68zrg0SAdGqPHS1JA=@vger.kernel.org X-Gm-Message-State: AOJu0YyZOSW+4UFFD9i5D4Onl9I/J7XeZnieNBaVtR7HRWHb8bt/z3jt 8AhHOoPhcEzHLs9jWiXJ2a7GaOTm1PAuKFpoDeGCBwb46at9MfW+/tbz X-Gm-Gg: AZuq6aI6TRyzfcmn3NrOYzase+wZg19y8TIkHiqnC8t2Azdnt2WDzw4XsrTveaIQbMW m9ScfF+v0q1PaMs+Sl4vcB5o5XN0pgr5WCAauR3EVpKVWC9UYvpG9wnTpOQodzbxeDAvwZ8zk5s hUIBhpy/++/PIVjkoBqE/y8fOHQxcRvws5u9d0Ujdb07tC6fDtuf3wh0f3oC9iZTcDSewM/s614 e5puIdKhpXRkCAziHdB2ZiBJYrqEvf/CKPUY4OvYIh3QLb0PbbicP68ec2hHloyLPE311EkndnB FXaiBPtRWR3x91+JG5LlXncNmDDBweKBhywdbIf1W1uRGYpshtuBqEBbRkvZN8jyT455W0iEzNv AaKYtBGzpaCHnvuZ1PD29eIMQGzzlFF97z/rEYHd0uqL21sHLKXA7C/xpiQzCCSX3GFdel1OseV tsR57YnGIH9m5Mr7Hd2Kv3SJx0jhB/NCrGdQ== X-Received: by 2002:a05:690c:f09:b0:78d:b1e9:85f0 with SMTP id 00721157ae682-793c6831d0dmr118307367b3.47.1768973378948; Tue, 20 Jan 2026 21:29:38 -0800 (PST) Received: from devvm11784.nha0.facebook.com ([2a03:2880:25ff:9::]) by smtp.gmail.com with ESMTPSA id 00721157ae682-793c6888b83sm61022937b3.48.2026.01.20.21.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 21:29:38 -0800 (PST) Date: Tue, 20 Jan 2026 21:29:36 -0800 From: Bobby Eshleman To: Jakub Kicinski Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Neal Cardwell , David Ahern , Mina Almasry , Arnd Bergmann , Jonathan Corbet , Andrew Lunn , Shuah Khan , Donald Hunter , Stanislav Fomichev , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, asml.silence@gmail.com, matttbe@kernel.org, skhawaja@google.com, Bobby Eshleman Subject: Re: [PATCH net-next v10 0/5] net: devmem: improve cpu cost of RX token management Message-ID: References: <20260115-scratch-bobbyeshleman-devmem-tcp-token-upstream-v10-0-686d0af71978@meta.com> <20260120170749.101e8bcc@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260120170749.101e8bcc@kernel.org> On Tue, Jan 20, 2026 at 05:07:49PM -0800, Jakub Kicinski wrote: > On Thu, 15 Jan 2026 21:02:11 -0800 Bobby Eshleman wrote: > > This series improves the CPU cost of RX token management by adding an > > attribute to NETDEV_CMD_BIND_RX that configures sockets using the > > binding to avoid the xarray allocator and instead use a per-binding niov > > array and a uref field in niov. > > > > Improvement is ~13% cpu util per RX user thread. > > > > Using kperf, the following results were observed: > > > > Before: > > Average RX worker idle %: 13.13, flows 4, test runs 11 > > After: > > Average RX worker idle %: 26.32, flows 4, test runs 11 > > > > Two other approaches were tested, but with no improvement. Namely, 1) > > using a hashmap for tokens and 2) keeping an xarray of atomic counters > > but using RCU so that the hotpath could be mostly lockless. Neither of > > these approaches proved better than the simple array in terms of CPU. > > > > The attribute NETDEV_A_DMABUF_AUTORELEASE is added to toggle the > > optimization. It is an optional attribute and defaults to 0 (i.e., > > optimization on). > > IDK if the cmsg approach is still right for this flow TBH. > IIRC when Stan talked about this a while back we were considering doing > this via Netlink. Anything that proves that the user owns the binding > would work. IIUC the TCP socket in this design just proves that socket > has received a token from a given binding right? In both designs the owner of the binding starts of as the netlink opener, and then ownership spreads out to TCP sockets as packets are steered to them. Tokens are received by the user which gives them a share in the form of references on the pp and binding. This design follows the same approach... but I may be misinterpreting what you mean by ownership? Best, Bobby