[PATCH 2/2] mm, netmem: remove the page pool members in struct page

Byungchul Park posted 2 patches 1 day, 16 hours ago
There is a newer version of this series
[PATCH 2/2] mm, netmem: remove the page pool members in struct page
Posted by Byungchul Park 1 day, 16 hours ago
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, since both struct netmem_desc and struct page still share the
same space, 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 adjust static checkers
for the offsets.

Signed-off-by: Byungchul Park <byungchul@sk.com>
---
 include/linux/mm_types.h | 11 -----------
 include/net/netmem.h     |  7 ++-----
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 9f6de068295d3..46d3c4b52cc10 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -114,17 +114,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 set */
 		};
diff --git a/include/net/netmem.h b/include/net/netmem.h
index 2a73b68f16b15..01d689de11511 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -42,11 +42,8 @@ struct netmem_desc {
 	static_assert(offsetof(struct page, pg) == \
 		      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
 
 /*
-- 
2.17.1
Re: [PATCH 2/2] mm, netmem: remove the page pool members in struct page
Posted by kernel test robot 1 day, 4 hours ago
Hi Byungchul,

kernel test robot noticed the following build errors:

[auto build test ERROR on d0a24447990a9d8212bfb3a692d59efa74ce9f86]

url:    https://github.com/intel-lab-lkp/linux/commits/Byungchul-Park/mm-introduce-a-new-page-type-for-page-pool-in-page-type/20251215-151232
base:   d0a24447990a9d8212bfb3a692d59efa74ce9f86
patch link:    https://lore.kernel.org/r/20251215071001.78263-3-byungchul%40sk.com
patch subject: [PATCH 2/2] mm, netmem: remove the page pool members in struct page
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20251215/202512152043.rdzLcS1a-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251215/202512152043.rdzLcS1a-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512152043.rdzLcS1a-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/ethernet/intel/ice/ice_ethtool.c: In function 'ice_lbtest_receive_frames':
>> drivers/net/ethernet/intel/ice/ice_ethtool.c:1254:36: error: 'struct page' has no member named 'pp'
    1254 |                                page->pp->p.offset;
         |                                    ^~


vim +1254 drivers/net/ethernet/intel/ice/ice_ethtool.c

0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1223  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1224  #define ICE_LB_FRAME_SIZE 64
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1225  /**
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1226   * ice_lbtest_receive_frames - receive and verify test frames
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1227   * @rx_ring: pointer to the receive ring
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1228   *
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1229   * Function receives loopback packets and verify their correctness.
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1230   * Returns number of received valid frames.
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1231   */
e72bba21355dbb Maciej Fijalkowski     2021-08-19  1232  static int ice_lbtest_receive_frames(struct ice_rx_ring *rx_ring)
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1233  {
93f53db9f9dc4a Michal Kubiak          2025-09-25  1234  	struct libeth_fqe *rx_buf;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1235  	int valid_frames, i;
93f53db9f9dc4a Michal Kubiak          2025-09-25  1236  	struct page *page;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1237  	u8 *received_buf;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1238  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1239  	valid_frames = 0;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1240  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1241  	for (i = 0; i < rx_ring->count; i++) {
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1242  		union ice_32b_rx_flex_desc *rx_desc;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1243  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1244  		rx_desc = ICE_RX_DESC(rx_ring, i);
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1245  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1246  		if (!(rx_desc->wb.status_error0 &
283d736ff7c7e9 Maciej Fijalkowski     2022-07-07  1247  		    (cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_DD_S)) |
283d736ff7c7e9 Maciej Fijalkowski     2022-07-07  1248  		     cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)))))
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1249  			continue;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1250  
93f53db9f9dc4a Michal Kubiak          2025-09-25  1251  		rx_buf = &rx_ring->rx_fqes[i];
93f53db9f9dc4a Michal Kubiak          2025-09-25  1252  		page = __netmem_to_page(rx_buf->netmem);
93f53db9f9dc4a Michal Kubiak          2025-09-25  1253  		received_buf = page_address(page) + rx_buf->offset +
93f53db9f9dc4a Michal Kubiak          2025-09-25 @1254  			       page->pp->p.offset;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1255  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1256  		if (ice_lbtest_check_frame(received_buf))
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1257  			valid_frames++;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1258  	}
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1259  
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1260  	return valid_frames;
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1261  }
0e674aeb0b7790 Anirudh Venkataramanan 2019-04-16  1262  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki