From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (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 73DE03DAAC5 for ; Fri, 25 Sep 2026 11:12:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790334726; cv=none; b=J/Am4+YPwAxvBPFly2BUTDT+yWPbUT4Pie6cHhN7C5b3wBRfI/aaW0ogOKWWvYqn0oue73WZzNx3A07AkcTIrXRUR3yf445Ju9uQUVtpnq28uaV120KuHx6tW1yMn5USR7Pd4kFbqEW2fK68V4uI4F1NFvq8iXXpFBQyUDGY5+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790334726; c=relaxed/simple; bh=GuW7eXEh2gVczNln7jtlJt8uCjI8l0C1PzUKgYCAbxY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=F9n8rhx2BwAz6gqRe8AdqmJsX5uaLeQt08XyBbtBaDqp3b2Szsd+BGKW5st69Kp/dfFps7fASGD9B6bAQx0y6OKFQTzbYdeyUosJ7qcBp6jE/7LhRotAKLviTyyC9GKJxXGXVAoKPE5+cxDpLRggVg0xrCCJShpdOfEGnn8OnVQ= 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=YmX9Rq0s; arc=none smtp.client-ip=74.125.225.141 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="YmX9Rq0s" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49cd38e0e5dso10019305e9.2 for ; Fri, 25 Sep 2026 04:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790334723; x=1790939523; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=QUYgotJhZ6LNOKd9OKnwgJyVznPrlzbQCA8QrOOaWH4=; b=YmX9Rq0sXPA2AUzkrD21A/2+kmiQUlAynaMsf08bZzRFzX1Bp+FV4Fs9H7rdvhqbE5 LinO2fYd+h1FbNWPb0R0Yn9rztwgKcd9EST3I+XWfJjn+Kw7MNQj2Jv2VxbJmgPLWd1H 5+lgwA+7wKlEi3mVK9+LkKEUzLDR6pfywrnZGYYSEdqwz4R/qMMpE1GANHsg1WrRGZA/ fpbsNIzC/7m4/CgqWVqZdR/5YLx98R9LNZnEh0uQqpElEGR/lEstMmPH5WmBHbC20nlj ETlbOBZYWuM1kLnAyvwEkLUU8u7eJqitNz15nwIBet8/NlnnUjx5kmmoNJsLiJTn/roO kD1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790334723; x=1790939523; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=QUYgotJhZ6LNOKd9OKnwgJyVznPrlzbQCA8QrOOaWH4=; b=e5OcRCPIuYWxmmt9c2//lUiXtH3YIhhAFJp5cp6w3TcfDNkhbJejo25gp0jpAW/Pk8 PozgtrwzKjlCIvdqBli6G81YdDnX7b9ldfyx02EvTYCvp3uz/bxs5TSpUr1gcTGmhhs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Hxu77mabTJ/aBJoRrM2kfeGuT//9Y X-Received: by 2002:a05:600c:6207:b0:49f:bd3c:bc20 with SMTP id 5b1f17b1804b1-49fe66ff476mr101883265e9.27.1790334722519; Fri, 25 Sep 2026 04:12:02 -0700 (PDT) Received: from ?IPV6:2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c? ([2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49ff0658747sm58978745e9.1.2026.09.25.04.12.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Sep 2026 04:12:01 -0700 (PDT) Message-ID: Date: Fri, 25 Sep 2026 12:11:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 1/3] net: netmem: add net_iov_area freelist helpers To: Mina Almasry Cc: Stanislav Fomichev , netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, hawk@kernel.org, ilias.apalodimas@linaro.org, axboe@kernel.dk, sdf@fomichev.me, bobbyeshleman@meta.com, kaiyuanz@google.com, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org References: <20260922204348.717198-1-sdf@fomichev.me> <20260922204348.717198-2-sdf@fomichev.me> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/24/26 17:46, Mina Almasry wrote: > On Thu, Sep 24, 2026 at 8:41 AM Pavel Begunkov wrote: >> >> On 9/24/26 16:02, Mina Almasry wrote: >>> On Tue, Sep 22, 2026 at 1:43 PM Stanislav Fomichev wrote: >>>> >>>> io_uring zero-copy receive and devmem both maintain a bounded LIFO for >>>> net_iovs in a contiguous area. Store the freelist in struct net_iov_area >>>> and provide common push and pop helpers. >>>> >>>> Leave synchronization to area owners. Keep devmem's area adjacent to its >>> >>> This could be a follow up change, but I think synchronization should >>> be provided by the netmem/niov infra, rather than the area owners. TBH >>> the infra providing an unsynchronized data structure and letting the >>> area owner use it and shoot themselves in the foot feels error prone. >>> For now we could use a comment. >> >> I don't think we want it. The duplication is minor, but I'm not set >> on the per area index array approach, and it'd make changing it >> more difficult. >> > > What is 'it'? I'm guessing you don't want the freelist array put in > the net_iov_area at all then? Because even that change will make > replacing the freelist array hard to swap? Or are you objecting to > just letting the netmem functions do the locking I meant this consolidation / patch. Yes, it adds more friction but I don't see much benefit. And I can guess why Stan didn't include locking, zcrx takes it for additional sync and keeps one lock for all areas. -- Pavel Begunkov