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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E461C71135 for ; Thu, 12 Jun 2025 01:55:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 782FF6B007B; Wed, 11 Jun 2025 21:55:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7346F6B0088; Wed, 11 Jun 2025 21:55:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64A316B0089; Wed, 11 Jun 2025 21:55:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 45F876B007B for ; Wed, 11 Jun 2025 21:55:48 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AC4541D8F27 for ; Thu, 12 Jun 2025 01:55:47 +0000 (UTC) X-FDA: 83545082334.08.961F759 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf19.hostedemail.com (Postfix) with ESMTP id F3C8A1A0006 for ; Thu, 12 Jun 2025 01:55:45 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Hr4N25lZ; spf=pass (imf19.hostedemail.com: domain of kuba@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=kuba@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749693346; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Y+MJVc2VbUfP4aAUxivUi07r5XWd7Ya8V9fz6k5cyGA=; b=1m19FMbNZT+A5v1CBy9OfdSk3Se41JizLZsyE9iKwbLBcjjs/S3y/KIWuF6GbYw3VtYtHG me0fZVZjj79TSvGv2H8CO1mRwKiD5sckcsDeH/6oCIWV59fyuVy4r6MJ2/x8iqSLs+Mo7d yNDbK/34kW8T2RdSK3G5rvbyUs2s2pA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Hr4N25lZ; spf=pass (imf19.hostedemail.com: domain of kuba@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=kuba@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749693346; a=rsa-sha256; cv=none; b=cEGD4j7DSfBBS5BO7+eFDNEZZMSqwBm4vthUKGRD7/w5sq5Dxvg7ywZfFbxUhv2qb5ltg0 ybc+5RTXKOPslEdPjtdYt/ucgtL/jv0LOSog6SPR4x8TPiFVSSTvUpqhCrmYvBvC6Gw1Hh EYPFV7Tpa9fX2EM7xfvrh35yUqNIHHs= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id B31B544086; Thu, 12 Jun 2025 01:55:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97CB6C4CEE3; Thu, 12 Jun 2025 01:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749693344; bh=/Z9gnkbErpmzSSGG757Uw928GIcAdBgrdkNeI0TZYYE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Hr4N25lZ/oEeSGftkotNZkm8IvShXojbQQmt4vAiXiQ6w28OzyeM6PqUEl+TOvoEx PqyNWIQXe0nf1UeMJwUbf9+HKHR1+Km1mhH7/QYsModYvu+ECP1UIz53D8NbYgkjNE 7gWA5xhFlHJWPHcPTYgmpJCObUcrOag0oOexDt2l9p3RHa5f1pElBJ9NJ48TdSjaIb mFRaFWelGov5E1gRsshY6RdQ/31ecBkrueieMBNJqS/Mh8mVsyhh9xHxBJ8Y2KXElK ANIHzv8NUJKt0zao7kX0RYWqkgjnsJtZGqR4uOZhJEs4GCdRfqKqJ8bijflblv1kvp GNkiV+itjUEkw== Date: Wed, 11 Jun 2025 18:55:42 -0700 From: Jakub Kicinski To: Byungchul Park Cc: willy@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, almasrymina@google.com, ilias.apalodimas@linaro.org, harry.yoo@oracle.com, hawk@kernel.org, akpm@linux-foundation.org, davem@davemloft.net, john.fastabend@gmail.com, andrew+netdev@lunn.ch, asml.silence@gmail.com, toke@redhat.com, tariqt@nvidia.com, edumazet@google.com, pabeni@redhat.com, saeedm@nvidia.com, leon@kernel.org, ast@kernel.org, daniel@iogearbox.net, david@redhat.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, horms@kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, vishal.moola@gmail.com Subject: Re: [PATCH net-next 1/9] netmem: introduce struct netmem_desc mirroring struct page Message-ID: <20250611185542.118230c1@kernel.org> In-Reply-To: <20250610013001.GA65598@system.software.com> References: <20250609043225.77229-1-byungchul@sk.com> <20250609043225.77229-2-byungchul@sk.com> <20250609123255.18f14000@kernel.org> <20250610013001.GA65598@system.software.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: F3C8A1A0006 X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: c1w87eshp1x7167pjxtkmfh1cnwqhj44 X-HE-Tag: 1749693345-79746 X-HE-Me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W8mxP/TbrqFvn18XPjaiepN7h/tpmRPtn9RUisQQROnD+xEMCIiP4jWx5qjrHzkzocgXLkVorWnf5BKjGUoH8YvzW8mCzdyawT3qSHBdXgW12sdq+ccBqtZ5SIWYMpXNsdyG/JNKfsLrUWQrceaMfOwAgjXHpy7+hsGfwJeftC7zECgezfDHxDcc3p56buSeKdgoGrx/QOjogbOViZoRXx8IHuI5PYRgsw/ja5yH0BM5YB/KeSwPymocgbscpoCuGmAzsffKCfEUrP2zlnE/MTNMXFD5YJf+WtpsL8Jf X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, 10 Jun 2025 10:30:01 +0900 Byungchul Park wrote: > > What's the intended relation between the types? > > One thing I'm trying to achieve is to remove pp fields from struct page, > and make network code use struct netmem_desc { pp fields; } instead of > sturc page for that purpose. > > The reason why I union'ed it with the existing pp fields in struct > net_iov *temporarily* for now is, to fade out the existing pp fields > from struct net_iov so as to make the final form like: I see, I may have mixed up the complaints there. I thought the effort was also about removing the need for the ref count. And Rx is relatively light on use of ref counting. > > netmem_ref exists to clearly indicate that memory may not be readable. > > Majority of memory we expect to allocate from page pool must be > > kernel-readable. What's the plan for reading the "single pointer" > > memory within the kernel? > > > > I think you're approaching this problem from the easiest and least > > No, I've never looked for the easiest way. My bad if there are a better > way to achieve it. What would you recommend? Sorry, I don't mean that the approach you took is the easiest way out. I meant that between Rx and Tx handling Rx is the easier part because we already have the suitable abstraction. It's true that we use more fields in page struct on Rx, but I thought Tx is also more urgent as there are open reports for networking taking references on slab pages. In any case, please make sure you maintain clear separation between readable and unreadable memory in the code you produce.