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 D1B05C83F17 for ; Thu, 10 Jul 2025 18:35:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76EBD6B0099; Thu, 10 Jul 2025 14:35:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 746AD6B009A; Thu, 10 Jul 2025 14:35:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65C8C6B009B; Thu, 10 Jul 2025 14:35:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 56AA06B0099 for ; Thu, 10 Jul 2025 14:35:50 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1EC091DAC75 for ; Thu, 10 Jul 2025 18:35:50 +0000 (UTC) X-FDA: 83649208860.21.68A6D0A Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf02.hostedemail.com (Postfix) with ESMTP id 37CEA8000C for ; Thu, 10 Jul 2025 18:35:48 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=tbFtySb+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of almasrymina@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=almasrymina@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752172548; a=rsa-sha256; cv=none; b=rSXDhco2eDgZ+j4pYYGPDuxFl8OpLJHd7WGO179mDHVa1m43I5rkkC60WTbVrPv89144Iz oamgap79beHR9V7Nd1FLVq/tkazjkkHX+k8VMyEy32O8uclKKgtZhYs5/Pd+MYyTpM6+OS bP5JlpaGfJ4fRvn4zsl8fiCtYim99w8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=tbFtySb+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of almasrymina@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=almasrymina@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752172548; 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=sUFyFG64jchMDy9nJZhwnx6mFvVO2+1zDBN4KcsNtGQ=; b=1poOedLy8eWG78lpsu21nae3ozHPFbGHfztuWwr+3MVaiiRljodusZq2vwBPnKNsqbP73L 4LDL0NL3kwaJIWBVuTwKfpPA8Ws1Iajd20nFwYhHenntGKg3e16VrG4ULQDfhYVVprRWq4 wmMxGUYHMBfvoh8FhcCJc4iMVON/zRg= Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-23dd9ae5aacso25925ad.1 for ; Thu, 10 Jul 2025 11:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1752172547; x=1752777347; 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=sUFyFG64jchMDy9nJZhwnx6mFvVO2+1zDBN4KcsNtGQ=; b=tbFtySb+l/GKQaZ6PoUfRJ9OFDEafrgCO8fm1mERXoxf2GcaJ6su7xRR7xM+6pOxEN VGkqXRwhSdlEf6dNP/L/dyNVUI5L2Q42xo/1uvct+VAeW8IvxGfnV4feiocOno51GtLX b09NpZwEKgNKO60VPidcIVhMPwtiO+Zq98d2TSBPV00AA21+MIY7dKOhpecDCHzWZE8p VO/2r/wyLRm9uIfgXllEZ81rX0Y/a3kwkC0veyasZyTqoNdmJKKiLttyGBvX8tVR0iHf qqj9e4Xl2JJlOAKTMFS5DD3+gL5CuAw+3VVBJN7om1D4ojtDbZZA6hHUpK10qIOBN86a f4EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752172547; x=1752777347; 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=sUFyFG64jchMDy9nJZhwnx6mFvVO2+1zDBN4KcsNtGQ=; b=LuzP7AXm/MfcSENVEC17Wm//TKG0QVwJ254CspFg2qvIaxL7HbPoYTu7/KVdi2S5ZH QVVt3Evkd0IA6DdxjiCvRb8XswgQ/p8gs1PRxr/tgzW5NXetMLPIqmYCKtdwZvB1r/LJ oSZs5d80qrrh2DfdUugRHSKtmdiKekDNnOS8FX39kgJGQggCNrLFrmOygmp7xSuOxb1I qHvNSAC0oqre68ba8uj5brVNfJkUGpdH9ijzgthvf4Z3XLyicXCYC6mA0bRCD1qyZvyU YnXOzGjL9/vkRqNUlOPjp0lRfSuCPs2bdaxCurOizfMaI5TcorwQSckd49s2jf4bmi3c ikNA== X-Forwarded-Encrypted: i=1; AJvYcCW8b+7+G0eqrA+Fj7P2wjJG60MGnnsMcaykFgWkvZmf6/LGLBicAVFI/3ubLY2o7VjIEAm2p2f76w==@kvack.org X-Gm-Message-State: AOJu0YxTaFUcEDXBPLvLa6WtfT3fYh3Y4Yg37ns91jbTSSNmTY98n4P0 VzqDW9kvps2L3aXoNyxLbocU7Qjwqs5pq7lkqSYeu0Sl9hBc6YhgSUB0VvEwkYE+txHrQT5Tz5S Rd53EWkAX1KirewIGphuMSautAnu22Oa45L3h7Ygk X-Gm-Gg: ASbGnctKmdBGhKhALb0h6RWMjNCCdrL8Mzeyz3cO7o5ldavcXoVU2XnBKFyHfJgbkGz ixI4O2/HO0UJt0547Zr4+iKTfE0eKfSyJWXW2FUotZA00TYduc4duF51K7OQQ3ETjM/nrVwRLC1 QDiVanlEGyEpoC+UO3Xt+/+T5AzFDzsNbsCulxQxSwNu5fMO4CinXOWjIhXd+v4xzvVmqhadc= X-Google-Smtp-Source: AGHT+IEzZmw78/OSXjJWOTZycozUs1vUEUMKIB/o/lKBX8kmUgnw2fbBaI4EEfFVqfugsZvpbjLQdKz5IhYTiVxWNgo= X-Received: by 2002:a17:902:b095:b0:231:f6bc:5c84 with SMTP id d9443c01a7336-23dee18a914mr236695ad.8.1752172546684; Thu, 10 Jul 2025 11:35:46 -0700 (PDT) MIME-Version: 1.0 References: <20250710082807.27402-1-byungchul@sk.com> In-Reply-To: <20250710082807.27402-1-byungchul@sk.com> From: Mina Almasry Date: Thu, 10 Jul 2025 11:35:33 -0700 X-Gm-Features: Ac12FXzCBZV3mzo5-D0lWEghMlDgKwI9NFBNKAUpNVy6DriBk8SQ-mKMDpELnTI Message-ID: Subject: Re: [PATCH net-next v9 0/8] Split netmem from struct page To: Byungchul Park Cc: willy@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, kuba@kernel.org, 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, hannes@cmpxchg.org, ziy@nvidia.com, jackmanb@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam11 X-Rspam-User: X-Stat-Signature: nmpzp5sihg4nnsbu7s4c8xjdmuega6m1 X-Rspamd-Queue-Id: 37CEA8000C X-HE-Tag: 1752172548-884654 X-HE-Meta: U2FsdGVkX18RLcvtqpmxiKbZQahpHQi6SRxd/Ex0N7j3sOLq/GmVW/YE4WrcFnTWV+m7g59DKOeqi2DiU2lsJ5GOwqSX9+QWx6IKfnjp3NWgGICjiF+GltXh7UFuw95gpGCWoJOiNP1isz7tbNKciIZnIxE171GmyklJWSt1U6S4gvypEhr4VZS3Ujhe4PzDeRVl6ONBGHELb5JKZfE8ABmq9txfnrBLiAmh8WipjmMlMRLVNV1XIhQ3McJMU8a61z6kEIhFS9/8+uegE8IMTLLZs1JNboofhdI5DZBgPAZKMFjEAQ0PAcUwkde9JlayN7pOtkvx5N3xYhO0aVoKPSSDAu+Jv/l9KzTMC6fDMzOVgGrMuQLsYK1Xah2tV4kShyKImcHLANSY30+eCc8euHmIaHMV2SdYsbxjO1lAUNeGfX+XZgM74XeTTjqzg53fBVf8Zo3E5d2gMV7vkH+fVHTuWRqqAIq/OQeCYc0s3vS5IofyyiUXo4PULTW6EPs0S6nX2ln1qOgi3K0Vh7rq8tHe0h3Pu8qsZmUYTk/EkKU8vtKeXP4FpARyNAMyQdj4r+gB9QZRRkZCurK91t8bw0eKmZK2Yfj3JSb0+TUVegEFByIxKbpi/iVlQuf4S1GrMnI3QLQHe6SsoEY0ZE/QHbg/dOuDZtrRXEvG8OfbG4UIYPYGXCtZGO3ufdKdcs5FhD1AlO+9tddnOe/vuyjpRYF+Ju3I4PwWFpkKGjD5HroGVkDzQBzd4Af27L50wIaqp4fry6elLa4KmmuT15h1J/9/+noPEWQwN0pZsSsD6u/En+Fvm6GfF8woXTHrlITafUNYHulr08vo3qadt4NDwIN/D03Ic1i3F/50lSNgx/DCgORWLfhAcKOEFOwTymHWXA8lclL+zFo5Xv1KI7iabgGqXh7V9Nwad23bsVsJXo+46xoUTl6AAIOFBVA1FcEapRnvQXzj0K8b2gfWRly 2AU+N/LV 34DomFY4hp4jcVfdhprbdmI6VO0TQBGcrHGPxDOJO4J7jbXfRLBqdRp+xAY4/2w9eAQZcyhcdtv9K7RnZdeMKVrdVmgCR3zkNRGBklKUzg/fC4Bs1ai5jEtJtW3CWJHWHnb4GfWiOaDkkXiE0cWodPDmiGmr26qOomykX3g4bsujBo+VSyfom/wKwI5s2ccHJyM0IlXMYCw1H06vHZisnuT3q6wv/cmHXpuT7lEMc2bwPEZN38zSdPOHcKpTB3bbKI13ixoTHl5Z6pMSY5rUn2F5J7TavRcql+0Ta9iAG96Htl5JVfYKI6fdFkzF7+DLYPIsxs1vmKn4IiVQ0jXX4svI/dBjsaIdv1x06J/5+8fiLmBsca50VVU+zIZLrdmm1BGlUfVcttjUYa5kEXRGy53XmCo1NDWX0Fueom7KZXh5DvCL0vhkLLew7kg== 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, Jul 10, 2025 at 1:28=E2=80=AFAM Byungchul Park w= rote: > > Hi all, > > The MM subsystem is trying to reduce struct page to a single pointer. > See the following link for your information: > > https://kernelnewbies.org/MatthewWilcox/Memdescs/Path > > The first step towards that is splitting struct page by its individual > users, as has already been done with folio and slab. This patchset does > that for page pool. > > Matthew Wilcox tried and stopped the same work, you can see in: > > https://lore.kernel.org/linux-mm/20230111042214.907030-1-willy@infrade= ad.org/ > > I focused on removing the page pool members in struct page this time, > not moving the allocation code of page pool from net to mm. It can be > done later if needed. > > The final patch removing the page pool fields will be posted once all > the converting of page to netmem are done: > > 1. converting use of the pp fields in struct page in prueth_swdata. > 2. converting use of the pp fields in struct page in freescale driver. > > For our discussion, I'm sharing what the final patch looks like, in this > cover letter. > > Byungchul > --8<-- > commit 1847d9890f798456b21ccb27aac7545303048492 > Author: Byungchul Park > Date: Wed May 28 20:44:55 2025 +0900 > > mm, netmem: remove the page pool members in struct page > > Now that all the users of the page pool members in struct page have b= een > gone, the members can be removed from struct page. > > However, since struct netmem_desc still uses the space in struct page= , > the important offsets should be checked properly, until struct > netmem_desc has its own instance from slab. > > Remove the page pool members in struct page and modify static checker= s > for the offsets. > > Signed-off-by: Byungchul Park > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 32ba5126e221..db2fe0d0ebbf 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -120,17 +120,6 @@ struct page { > */ > unsigned long private; > }; > - struct { /* page_pool used by netstack */ > - /** > - * @pp_magic: magic value to avoid recycling non > - * page_pool allocated pages. > - */ > - unsigned long pp_magic; > - struct page_pool *pp; > - unsigned long _pp_mapping_pad; > - unsigned long dma_addr; > - atomic_long_t pp_ref_count; > - }; > struct { /* Tail pages of compound page */ > unsigned long compound_head; /* Bit zero is se= t */ > }; > diff --git a/include/net/netmem.h b/include/net/netmem.h > index 8f354ae7d5c3..3414f184d018 100644 > --- a/include/net/netmem.h > +++ b/include/net/netmem.h > @@ -42,11 +42,8 @@ struct netmem_desc { > static_assert(offsetof(struct page, pg) =3D=3D \ > offsetof(struct netmem_desc, desc)) > NETMEM_DESC_ASSERT_OFFSET(flags, _flags); > -NETMEM_DESC_ASSERT_OFFSET(pp_magic, pp_magic); > -NETMEM_DESC_ASSERT_OFFSET(pp, pp); > -NETMEM_DESC_ASSERT_OFFSET(_pp_mapping_pad, _pp_mapping_pad); > -NETMEM_DESC_ASSERT_OFFSET(dma_addr, dma_addr); > -NETMEM_DESC_ASSERT_OFFSET(pp_ref_count, pp_ref_count); > +NETMEM_DESC_ASSERT_OFFSET(lru, pp_magic); > +NETMEM_DESC_ASSERT_OFFSET(mapping, _pp_mapping_pad); > #undef NETMEM_DESC_ASSERT_OFFSET > > /* Can you remove the above patch/diff from the cover letter? --=20 Thanks, Mina