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 EF37AC71135 for ; Sat, 14 Jun 2025 02:19:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A9FF6B0088; Fri, 13 Jun 2025 22:19:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05B356B0089; Fri, 13 Jun 2025 22:19:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8CAA6B008A; Fri, 13 Jun 2025 22:19:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C90C16B0088 for ; Fri, 13 Jun 2025 22:19:24 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 313A981A4C for ; Sat, 14 Jun 2025 02:19:24 +0000 (UTC) X-FDA: 83552399448.29.1688296 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf13.hostedemail.com (Postfix) with ESMTP id 564F920008 for ; Sat, 14 Jun 2025 02:19:22 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=k2RbaeRj; spf=pass (imf13.hostedemail.com: domain of almasrymina@google.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=almasrymina@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749867562; 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=gn7hQ4tKQxqRQgt1sWefNjIs0nazm1nLsrkpL0FkOCs=; b=3e5dz/Itztyr8dVEypt0d4asPqpX2V0hYUTrzxVazwCbUWUbUQ4rMi3b+3A8+z2Drih32t XPF2ABX0aRJZjKI2j0oWspqEb1/+tiWj8D0GBxdKssfOQpy8Vxfak3RKeOBzQzfHR2cFXv FVQEQH9woZ9waHXDPjGajojL2TJihUE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=k2RbaeRj; spf=pass (imf13.hostedemail.com: domain of almasrymina@google.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=almasrymina@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749867562; a=rsa-sha256; cv=none; b=eEmnMJNeT1Z7Ove+UXQlAzOI+KebfyYsftMaVLC9wczZ1XqzfKnJ68mhXyy8MlKHEBrdTj bLYaubX+8/AvmrBqE5wlpxQ/CLKN89kt+ckeve4HJ4y99EiUXshkLcjxFgJ9gPngfzSTT0 4tPcXHfyhGXnTnijP55iidTpyTLW0KM= Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-235e389599fso89185ad.0 for ; Fri, 13 Jun 2025 19:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749867561; x=1750472361; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gn7hQ4tKQxqRQgt1sWefNjIs0nazm1nLsrkpL0FkOCs=; b=k2RbaeRj7y45bG2b34fU825Tg5cDFIFb4RWeKIs7KNXSDh3c6M+4aWqLQcehZmtZe4 6UpK70bd7PRYID8B1JabIOh93aMf5FSOkiDCVXvBHZDdzXEuFW+b9XGjzO7GY7LohQjn FQkosm2yq9e+RC7eBD/ydLFvegccY7EZnC9VSnfqqXi3E9gPVDp2ONMqtr1WSK8tlge9 nwnUCnuxg53GY5qEhzHly+p3YkeAVnwl7NMdEKWCVhEdpRazoydqMir7mqbcb21sSx7L 4ADSTg7rh9PHTlneBqRJUwvc8FZD5LtC68Y5dKMP5FV85nVAEjz7IDDpqUFMB7x1tiPF nvEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749867561; x=1750472361; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gn7hQ4tKQxqRQgt1sWefNjIs0nazm1nLsrkpL0FkOCs=; b=N6BDf3GzfwN6TSZ6mbOjc295I6gOF/yxt8Yzf1hioPm8hiun1V2eF8tunUbgsJ9wMs u6IPphnIsA/o2aS4feepGM70o3uDgDC9K6PRNuqxROWJW3E1GdlAFJsrF9oZK+vwdwy+ rWg2PtW8XolD4MeT7qAqXGdAc7IqGcdcuRxqaj0xos8ZBT4njAcbON1burW7njjIgFlE RFSLteAnzgdctU2vmccoQZcVBoScI20BC/nKoUeE0bdaKNTGu0JSYffB/b5q0qHMMcFn 3btHrV30xGl2RGtC2u/dF9XtvGlfN8TFTr0kVUPOn1Rm/6A18Cme3SyR0zdNZTqQcgBM 2sug== X-Forwarded-Encrypted: i=1; AJvYcCVCksHhVxSY/5voJ32TcgYJBYiWyBAy1nU8v0K+zwbZaQ2hIFjQGRxB5U3wiFNezapDf04joY/+Qg==@kvack.org X-Gm-Message-State: AOJu0YzcYafu+bT5HZjiL4StwYtk/8m5bpi3temOK+0xTJI3EIwJSJWn cgDEsKPMeBzQnhh0yaqPG3JKyeaihHOKhrb3DIHIi13sa5LS6bMyf1uqk8mBj9wFUXp26gzclrJ i5/hRp2/sFMbDm9DceoAt8+AGtyAWenm12nVq6tkX X-Gm-Gg: ASbGncvH2ar7bk+bjw0K9PXWVgwLxoYQrYZpKbTsxsOpm2ONKC1+lTP3beTNKAu1K9y RYNmo4T9O/3f5vuVDt+JIAmRNSRqv1r3MlPdW+APcvOsWrk2gQy0K/OreAQnmz1duqIJCq/TDoA hYpM4ywzjKF/QqzFBV2SnV3wCm7+A6ETe8csmudGkKnLaT X-Google-Smtp-Source: AGHT+IGYdXYi+poo/RbTJj3aTyp+thNZAzJ5yQqSIcmi+S8nbDQIjlrXV7TRD/xqSf9eS1uYlnMXOLt+1LwilFumYxA= X-Received: by 2002:a17:902:ef08:b0:215:65f3:27ef with SMTP id d9443c01a7336-2366c5a25dfmr1048025ad.12.1749867560457; Fri, 13 Jun 2025 19:19:20 -0700 (PDT) MIME-Version: 1.0 References: <20250609043225.77229-1-byungchul@sk.com> <20250609043225.77229-2-byungchul@sk.com> <20250609123255.18f14000@kernel.org> <20250610013001.GA65598@system.software.com> <20250611185542.118230c1@kernel.org> <20250613011305.GA18998@system.software.com> In-Reply-To: <20250613011305.GA18998@system.software.com> From: Mina Almasry Date: Fri, 13 Jun 2025 19:19:07 -0700 X-Gm-Features: AX0GCFuFHl8rGE_NSTG6eYqMKv1bvWBwteyyrelqyPJ0hyn_uDtWnwn8gbn2YYg Message-ID: Subject: Re: [PATCH net-next 1/9] netmem: introduce struct netmem_desc mirroring struct page To: Byungchul Park Cc: Jakub Kicinski , willy@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 564F920008 X-Rspamd-Server: rspam07 X-Stat-Signature: yty8eaoe8az9dra3qprtdja1unkx5ek4 X-Rspam-User: X-HE-Tag: 1749867562-437591 X-HE-Meta: U2FsdGVkX181EX4cGM+y5MFtb4cplELD5JK6woyWKdDxZk1YKl8YxbBAElXxbJTZIigle0+APvzw2MC9EEylhVDLP+aBv7kwKWxBA/T7+i0iPK3lww/Kba+f+/I1VUcAq+h9CAeLJYGfYiRHu33pGwyGkmjtnPcLvkXMgsm8oEqF9Wq8yPm5c0XFDDC+n+qlksF2OnbPh/qSyUO6Sdxcgw9EqTPrlI41tMpoVyBsU91y8aurcrX6obCSoBcb9StbrNZ4C+oDG5kR6ddlFvjTP12fWZu8aj8zZCX2kBQokBGha7d6sfydr64qPCObmeSc17mS1nQ9jRqlf6SXRzROFhF5sH49FQi8+QU5kQ1vS8Jjmwh7rPyinfxDz8DzlmZB5iEGAnPmLptsh7Nf8wR6rqh2c/XiXp50Sij1ChWM976T4KFrw8P4R6E8gW1QIZqtAb7sjkaX+k8J7zcnISijg0LBhnu7QLCK8uqja53Y//zmJNbPELOozSYPstMsN0b8looo1NlP3vOH9Yn+AUS2Ig1pHpG8xad61gH/g1odKAqcgGtkTJlf7Uzwmo913cnxvKjWENMccXKr77Bb2AR6Xdn2DBKNdrR9X5bBqGF6CAYhH8jlotZQFDtZelKn1d/vEHcmv25H5hDqR7/4jjTdF3mCGqQL22bHwTCkur3pncWnRn/6yupnSLyxeaOtZXOGPNHuvxw9LOYzwiAZcMr4PJ9yTnnQmq57SmX2d8QkP/NKGakjQ5bv4Z83JwDQIFmGD3RJOA/igemczEo9JCiNbiTPc2jJR8tbBwjh5aiV6CoINIecD9HW5AcxZHnEm+CfNTIYPFZ/AoZF+YJXQh/dxgfqGY1fgaz5+jNuhM/Zfwt8L1UvXgRL0vMxztq2cqUcaiGX/pvrYJdg5c/x6CYbftqt4/+exAg82VItPef7tidMViHV7wOGUcxq/XZF0qaYlzuikb9vMG3kuD10Omd 3yzcXTCD V2MZ1Pe1ItdNKS6PF8pgpS4OuzSKWdNni24S3lA/Sw9KWYpY0TQ/Xc/rb5Tv9mILHV0VsUGI0xwolVAKu1xFAyeyFH6A8ojfxZpYP7ac8pb39zVk66JskdGPdM4k3L56mUtk7+kB/Vp0WfSmCf03ZctZsqiQ70mQhfNVZoqjSmkGpxfjUqU8ayn3Cm65fsIzZF+2N7Oru/10NLUfdrqTSt3/DAUAW0ss4/aPAYmXu0L25JenLbiZM5XXCpRncX445VfaRKhz9SDBjJXRQlnbKLC0YuheJgv/lsF5cLWbuUapDRHcjgupI2C4dRhBkKyu7y1lbkovTMFY2Ws5JvZAOKY4e5ObRbSIizlb+/N7/xJHZjiD7f7TU1f/le8af7pHWLQS61WSMzRY7JCnGrwCdw5WUI+ZwdnjPbfhVOUx2BadUU8Jbe5TqlxzTXQ== 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 Thu, Jun 12, 2025 at 6:13=E2=80=AFPM Byungchul Park w= rote: > > On Wed, Jun 11, 2025 at 06:55:42PM -0700, Jakub Kicinski wrote: > > 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 pa= ge, > > > and make network code use struct netmem_desc { pp fields; } instead o= f > > > 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 readab= le. > > > > 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 bet= ter > > > 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. > > Do you mean the current patches do not? If yes, please point out one > as example, which would be helpful to extract action items. > I think one thing we could do to improve separation between readable (pages/netmem_desc) and unreadable (net_iov) is to remove the struct netmem_desc field inside the net_iov, and instead just duplicate the pp/pp_ref_count/etc fields. The current code gives off the impression that net_iov may be a container of netmem_desc which is not really accurate. But I don't think that's a major blocker. I think maybe the real issue is that there are no reviews from any mm maintainers? So I'm not 100% sure this is in line with their memdesc plans. I think probably patches 2->8 are generic netmem-ifications that are good to merge anyway, but I would say patch 1 and 9 need a reviewed by from someone on the mm side. Just my 2 cents. Btw, this series has been marked as changes requested on patchwork, so it is in need of a respin one way or another: https://patchwork.kernel.org/project/netdevbpf/list/?series=3D&submitter=3D= byungchul&state=3D*&q=3D&archive=3D&delegate=3D https://docs.kernel.org/process/maintainer-netdev.html#patch-status --=20 Thanks, Mina