All of lore.kernel.org
 help / color / mirror / Atom feed
* [alobakin:iavf-pp-frag 11/28] net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2023-07-29 12:30 kernel test robot
  2023-08-01 13:46 ` Alexander Lobakin
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-07-29 12:30 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: oe-kbuild-all, Alexander Lobakin

tree:   https://github.com/alobakin/linux iavf-pp-frag
head:   0eccfd667ed84b425dc0c48eab06b0cb1d5fd8c4
commit: 67f0169041f76c28d399c2a63947e33a1ae1210d [11/28] page_pool: add a lockdep check for recycling in hardirq
config: loongarch-randconfig-r072-20230728 (https://download.01.org/0day-ci/archive/20230729/202307292029.cFz0s8Hh-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230729/202307292029.cFz0s8Hh-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/202307292029.cFz0s8Hh-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got unsigned int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *
>> net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   net/core/page_pool.c:582:9: sparse:     expected void *ptr
   net/core/page_pool.c:582:9: sparse:     got int [noderef] __percpu *

vim +582 net/core/page_pool.c

   571	
   572	/* If the page refcnt == 1, this will try to recycle the page.
   573	 * if pool->dma_sync_act is set, we'll try to sync the DMA area for
   574	 * the configured size min(dma_sync_size, pool->max_len).
   575	 * If the page refcnt != 1, then the page will be returned to memory
   576	 * subsystem.
   577	 */
   578	static __always_inline struct page *
   579	__page_pool_put_page(struct page_pool *pool, struct page *page,
   580			     unsigned int dma_sync_size, bool allow_direct)
   581	{
 > 582		lockdep_assert_no_hardirq();
   583	
   584		/* This allocator is optimized for the XDP mode that uses
   585		 * one-frame-per-page, but have fallbacks that act like the
   586		 * regular page allocator APIs.
   587		 *
   588		 * refcnt == 1 means page_pool owns page, and can recycle it.
   589		 *
   590		 * page is NOT reusable when allocated when system is under
   591		 * some pressure. (page_is_pfmemalloc)
   592		 */
   593		if (likely(page_ref_count(page) == 1 && !page_is_pfmemalloc(page))) {
   594			/* Read barrier done in page_ref_count / READ_ONCE */
   595	
   596			if (pool->dma_sync_act == PP_DMA_SYNC_ACT_DO)
   597				page_pool_dma_sync_for_device(pool, page,
   598							      dma_sync_size);
   599	
   600			if (allow_direct && in_softirq() &&
   601			    page_pool_recycle_in_cache(page, pool))
   602				return NULL;
   603	
   604			/* Page found as candidate for recycling */
   605			return page;
   606		}
   607		/* Fallback/non-XDP mode: API user have elevated refcnt.
   608		 *
   609		 * Many drivers split up the page into fragments, and some
   610		 * want to keep doing this to save memory and do refcnt based
   611		 * recycling. Support this use case too, to ease drivers
   612		 * switching between XDP/non-XDP.
   613		 *
   614		 * In-case page_pool maintains the DMA mapping, API user must
   615		 * call page_pool_put_page once.  In this elevated refcnt
   616		 * case, the DMA is unmapped/released, as driver is likely
   617		 * doing refcnt based recycle tricks, meaning another process
   618		 * will be invoking put_page.
   619		 */
   620		recycle_stat_inc(pool, released_refcnt);
   621		page_pool_return_page(pool, page);
   622	
   623		return NULL;
   624	}
   625	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-01 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-29 12:30 [alobakin:iavf-pp-frag 11/28] net/core/page_pool.c:582:9: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2023-08-01 13:46 ` Alexander Lobakin
2023-08-01 16:53   ` Jakub Kicinski
2023-08-01 17:03     ` Alexander Lobakin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.