From: Byungchul Park <byungchul@sk.com>
To: willy@infradead.org, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
kernel_team@skhynix.com, almasrymina@google.com,
ilias.apalodimas@linaro.org, harry.yoo@oracle.com,
akpm@linux-foundation.org, andrew+netdev@lunn.ch,
asml.silence@gmail.com, toke@redhat.com, david@redhat.com,
Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, linux-rdma@vger.kernel.org,
bpf@vger.kernel.org, vishal.moola@gmail.com, hannes@cmpxchg.org,
ziy@nvidia.com, jackmanb@google.com, wei.fang@nxp.com,
shenwei.wang@nxp.com, xiaoning.wang@nxp.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
hkelam@marvell.com, bbhushan2@marvell.com, tariqt@nvidia.com,
ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
john.fastabend@gmail.com, sdf@fomichev.me, saeedm@nvidia.com,
leon@kernel.org, mbloch@nvidia.com, danishanwar@ti.com,
rogerq@kernel.org, nbd@nbd.name, lorenzo@kernel.org,
ryder.lee@mediatek.com, shayne.chen@mediatek.com,
sean.wang@mediatek.com, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com,
aleksander.lobakin@intel.com, horms@kernel.org, m-malladi@ti.com,
krzysztof.kozlowski@linaro.org,
matthias.schiffer@ew.tq-group.com, robh@kernel.org,
imx@lists.linux.dev, intel-wired-lan@lists.osuosl.org,
linux-arm-kernel@lists.infradead.org,
linux-wireless@vger.kernel.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next v12 00/12] Split netmem from struct page
Date: Wed, 23 Jul 2025 13:49:33 +0900 [thread overview]
Message-ID: <20250723044933.GA8691@system.software.com> (raw)
In-Reply-To: <20250721021835.63939-1-byungchul@sk.com>
On Mon, Jul 21, 2025 at 11:18:23AM +0900, Byungchul Park wrote:
> 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@infradead.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 that removes the page pool fields will be posted once
> all the conversions are completed.
>
> Byungchul
> ---
> Changes from v11:
> 1. Rebase on net-next/main as of Jul 21.
> 2. Change page_pool_page_is_pp() to check for const type of
> page. For now that it's called along with every
> pp_page_to_nmdesc() call as Pavel suggested,
> page_pool_page_is_pp() should also cover const type of page.
I believe the curretn version is good enough.
Byungchul
> Changes from v10:
> 1. Introduce __netmem_to_nmdesc() and use it in
> __netmem_get_pp(). (feedbacked by Mina)
> 2. Fix a bug that fails on casting 'const page -> const
> netmem_desc', by using macros and _Generic. (feedbacked by
> test robot)
> 3. Add comment on pp_page_to_nmdesc() to ask for more attention
> before using the helper. (feedbacked by Mina)
>
> Changes from v9:
> 1. Remove the patch 'page_pool: access ->pp_magic through
> netmem_desc in page_pool_page_is_pp()' and decide to wait for
> Pavel's work of PageNetpp() to identify page type for page
> pool, that doesn't need to access ->pp_magic.
> 2. Rename page_to_nmdesc() to pp_page_to_nmdesc() and add
> DEBUG_NET_WARN_ON_ONCE(!page_pool_page_is_pp(page)) in it,
> just in case. (feedbacked by Pavel)
> 3. Apply just simple casting from page to netmem_desc for
> accessing ->pp and ->pp_ref_count, instead of full converting
> page to netmem_ref for network drivers e.g. mlx4, netdevsim,
> and mt76.
> 4. Expand the support for drivers to access ->pp and
> ->pp_ref_count to fec, octeontx2-pf, iavf, idpf, mlx5, ti,
> and xdp.
> 5. Squash each helper with its first user. (feedbacked by Mina)
>
> Changes from v8:
> 1. Rebase on net-next/main as of Jul 10.
> 2. Exclude non-controversial patches that have already been
> merged to net-next.
> 3. Re-add the patches that focus on removing accessing the page
> pool fields in struct page.
> 4. Add utility APIs e.g. casting, to use struct netmem_desc as
> descriptor, to support __netmem_get_pp() that has started to
> be used again e.g. by libeth.
>
> Changes from v7 (no actual updates):
> 1. Exclude "netmem: introduce struct netmem_desc mirroring
> struct page" that might be controversial.
> 2. Exclude "netmem: introduce a netmem API,
> virt_to_head_netmem()" since there are no users.
>
> Changes from v6 (no actual updates):
> 1. Rebase on net-next/main as of Jun 25.
> 2. Supplement a comment describing struct net_iov.
> 3. Exclude a controversial patch, "page_pool: access ->pp_magic
> through struct netmem_desc in page_pool_page_is_pp()".
> 4. Exclude "netmem: remove __netmem_get_pp()" since the API
> started to be used again by libeth.
>
> Changes from v5 (no actual updates):
> 1. Rebase on net-next/main as of Jun 20.
> 2. Add given 'Reviewed-by's and 'Acked-by's, thanks to all.
> 3. Add missing cc's.
>
> Changes from v4:
> 1. Add given 'Reviewed-by's, thanks to all.
> 2. Exclude potentially controversial patches.
>
> Changes from v3:
> 1. Relocates ->owner and ->type of net_iov out of netmem_desc
> and make them be net_iov specific.
> 2. Remove __force when casting struct page to struct netmem_desc.
>
> Changes from v2:
> 1. Introduce a netmem API, virt_to_head_netmem(), and use it
> when it's needed.
> 2. Introduce struct netmem_desc as a new struct and union'ed
> with the existing fields in struct net_iov.
> 3. Make page_pool_page_is_pp() access ->pp_magic through struct
> netmem_desc instead of struct page.
> 4. Move netmem alloc APIs from include/net/netmem.h to
> net/core/netmem_priv.h.
> 5. Apply trivial feedbacks, thanks to Mina, Pavel, and Toke.
> 6. Add given 'Reviewed-by's, thanks to Mina.
>
> Changes from v1:
> 1. Rebase on net-next's main as of May 26.
> 2. Check checkpatch.pl, feedbacked by SJ Park.
> 3. Add converting of page to netmem in mt76.
> 4. Revert 'mlx5: use netmem descriptor and APIs for page pool'
> since it's on-going by Tariq Toukan. I will wait for his
> work to be done.
> 5. Revert 'page_pool: use netmem APIs to access page->pp_magic
> in page_pool_page_is_pp()' since we need more discussion.
> 6. Revert 'mm, netmem: remove the page pool members in struct
> page' since there are some prerequisite works to remove the
> page pool fields from struct page. I can submit this patch
> separatedly later.
> 7. Cancel relocating a page pool member in struct page.
> 8. Modify static assert for offests and size of struct
> netmem_desc.
>
> Changes from rfc:
> 1. Rebase on net-next's main branch.
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/
> 2. Fix a build error reported by kernel test robot.
> https://lore.kernel.org/all/202505100932.uzAMBW1y-lkp@intel.com/
> 3. Add given 'Reviewed-by's, thanks to Mina and Ilias.
> 4. Do static_assert() on the size of struct netmem_desc instead
> of placing place-holder in struct page, feedbacked by
> Matthew.
> 5. Do struct_group_tagged(netmem_desc) on struct net_iov instead
> of wholly renaming it to strcut netmem_desc, feedbacked by
> Mina and Pavel.
>
> Byungchul Park (12):
> netmem: introduce struct netmem_desc mirroring struct page
> netmem: use netmem_desc instead of page to access ->pp in
> __netmem_get_pp()
> netmem, mlx4: access ->pp_ref_count through netmem_desc instead of
> page
> netdevsim: access ->pp through netmem_desc instead of page
> mt76: access ->pp through netmem_desc instead of page
> net: fec: access ->pp through netmem_desc instead of page
> octeontx2-pf: access ->pp through netmem_desc instead of page
> iavf: access ->pp through netmem_desc instead of page
> idpf: access ->pp through netmem_desc instead of page
> mlx5: access ->pp through netmem_desc instead of page
> net: ti: icssg-prueth: access ->pp through netmem_desc instead of page
> libeth: xdp: access ->pp through netmem_desc instead of page
>
> drivers/net/ethernet/freescale/fec_main.c | 10 +-
> drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
> drivers/net/ethernet/intel/idpf/idpf_txrx.c | 8 +-
> .../marvell/octeontx2/nic/otx2_txrx.c | 2 +-
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 +-
> .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 3 +-
> .../net/ethernet/ti/icssg/icssg_prueth_sr1.c | 4 +-
> drivers/net/netdevsim/netdev.c | 6 +-
> drivers/net/wireless/mediatek/mt76/mt76.h | 3 +-
> include/linux/mm.h | 4 +-
> include/net/libeth/xdp.h | 2 +-
> include/net/netmem.h | 153 +++++++++++++++---
> 12 files changed, 161 insertions(+), 40 deletions(-)
>
>
> base-commit: 4701ee5044fb3992f1c910630a9673c2dc600ce5
> --
> 2.17.1
next prev parent reply other threads:[~2025-07-23 4:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 2:18 [PATCH net-next v12 00/12] Split netmem from struct page Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 01/12] netmem: introduce struct netmem_desc mirroring " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 02/12] netmem: use netmem_desc instead of page to access ->pp in __netmem_get_pp() Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 03/12] netmem, mlx4: access ->pp_ref_count through netmem_desc instead of page Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 04/12] netdevsim: access ->pp " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 05/12] mt76: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 06/12] net: fec: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 07/12] octeontx2-pf: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 08/12] iavf: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 09/12] idpf: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 10/12] mlx5: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 11/12] net: ti: icssg-prueth: " Byungchul Park
2025-07-21 2:18 ` [PATCH net-next v12 12/12] libeth: xdp: " Byungchul Park
2025-07-23 4:49 ` Byungchul Park [this message]
2025-07-24 2:00 ` [PATCH net-next v12 00/12] Split netmem from struct page patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250723044933.GA8691@system.software.com \
--to=byungchul@sk.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=aleksander.lobakin@intel.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=anthony.l.nguyen@intel.com \
--cc=asml.silence@gmail.com \
--cc=ast@kernel.org \
--cc=bbhushan2@marvell.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=david@redhat.com \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hannes@cmpxchg.org \
--cc=harry.yoo@oracle.com \
--cc=hawk@kernel.org \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=imx@lists.linux.dev \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jackmanb@google.com \
--cc=john.fastabend@gmail.com \
--cc=kernel_team@skhynix.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=m-malladi@ti.com \
--cc=matthias.bgg@gmail.com \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=mbloch@nvidia.com \
--cc=mhocko@suse.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=robh@kernel.org \
--cc=rogerq@kernel.org \
--cc=rppt@kernel.org \
--cc=ryder.lee@mediatek.com \
--cc=saeedm@nvidia.com \
--cc=sbhatta@marvell.com \
--cc=sdf@fomichev.me \
--cc=sean.wang@mediatek.com \
--cc=sgoutham@marvell.com \
--cc=shayne.chen@mediatek.com \
--cc=shenwei.wang@nxp.com \
--cc=surenb@google.com \
--cc=tariqt@nvidia.com \
--cc=toke@redhat.com \
--cc=vbabka@suse.cz \
--cc=vishal.moola@gmail.com \
--cc=wei.fang@nxp.com \
--cc=willy@infradead.org \
--cc=xiaoning.wang@nxp.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).