Re: [RFC 19/19] mm, netmem: remove the page pool members in struct page
From: Ilias Apalodimas
Date: Sat May 10 2025 - 03:26:45 EST
Hi Byungchul
On Fri, 9 May 2025 at 14:51, Byungchul Park <byungchul@xxxxxx> wrote:
>
> Now that all the users of the page pool members in struct page have been
> gone, the members can be removed from struct page. However, the space
> in struct page needs to be kept using a place holder with the same size,
> until struct netmem_desc has its own instance, not overlayed onto struct
> page, to avoid conficting with other members within struct page.
>
FWIW similar mirroring was intially proposed [0] a few years ago
> Remove the page pool members in struct page and replace with a place
> holder. The place holder should be removed once struct netmem_desc has
> its own instance.
instance? To make sure I understand this, the netmem_descs are
expected to be allocated in the future right?
[...]
> -
> static inline struct net_iov_area *net_iov_owner(const struct netmem_desc *niov)
> {
> return niov->owner;
> diff --git a/include/net/netmem_type.h b/include/net/netmem_type.h
> new file mode 100644
> index 0000000000000..6a3ac8e908515
> --- /dev/null
> +++ b/include/net/netmem_type.h
> @@ -0,0 +1,22 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + *
> + * Author: Byungchul Park <max.byungchul.park@xxxxxxxxx>
Shouldn't Minas authorship be preserved here?
> + */
> +
> +#ifndef _NET_NETMEM_TYPE_H
> +#define _NET_NETMEM_TYPE_H
> +
> +#include <linux/stddef.h>
> +
> +struct netmem_desc {
> + unsigned long __unused_padding;
> + struct_group_tagged(__netmem_desc, actual_data,
> + unsigned long pp_magic;
> + struct page_pool *pp;
> + struct net_iov_area *owner;
> + unsigned long dma_addr;
> + atomic_long_t pp_ref_count;
> + );
> +};
> +
> +#endif /* _NET_NETMEM_TYPE_H */
> --
> 2.17.1
>
[0] https://lore.kernel.org/netdev/1549550196-25581-1-git-send-email-ilias.apalodimas@xxxxxxxxxx/
Thanks
/Ilias