linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2023-11-15 19:12 kernel test robot
  2023-11-16 12:06 ` Alexander Lobakin
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2023-11-15 19:12 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: oe-kbuild-all, linux-kernel, Alexander Lobakin, Alexander Duyck

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c42d9eeef8e5ba9292eda36fd8e3c11f35ee065c
commit: ff4e538c8c3e675a15e1e49509c55951832e0451 page_pool: add a lockdep check for recycling in hardirq
date:   3 months ago
config: loongarch-randconfig-r133-20231107 (https://download.01.org/0day-ci/archive/20231116/202311160339.DbhaH8LX-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231116/202311160339.DbhaH8LX-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/202311160339.DbhaH8LX-lkp@intel.com/

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

vim +590 net/core/page_pool.c

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

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

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

* Re: net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
  2023-11-15 19:12 net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
@ 2023-11-16 12:06 ` Alexander Lobakin
  2023-11-20  2:24   ` Yujie Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Lobakin @ 2023-11-16 12:06 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: kernel test robot, oe-kbuild-all, linux-kernel, Alexander Duyck

From: Kernel Test Robot <lkp@intel.com>
Date: Thu, 16 Nov 2023 03:12:24 +0800

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   c42d9eeef8e5ba9292eda36fd8e3c11f35ee065c
> commit: ff4e538c8c3e675a15e1e49509c55951832e0451 page_pool: add a lockdep check for recycling in hardirq
> date:   3 months ago
> config: loongarch-randconfig-r133-20231107 (https://download.01.org/0day-ci/archive/20231116/202311160339.DbhaH8LX-lkp@intel.com/config)
> compiler: loongarch64-linux-gcc (GCC) 13.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20231116/202311160339.DbhaH8LX-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/202311160339.DbhaH8LX-lkp@intel.com/
> 
> sparse warnings: (new ones prefixed by >>)
>>> net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
>    net/core/page_pool.c:590:9: sparse:     expected void *ptr
>    net/core/page_pool.c:590:9: sparse:     got unsigned int [noderef] __percpu *

Eeehhh... False-positive?

Thanks,
Olek

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

* Re: net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
  2023-11-16 12:06 ` Alexander Lobakin
@ 2023-11-20  2:24   ` Yujie Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Yujie Liu @ 2023-11-20  2:24 UTC (permalink / raw)
  To: Alexander Lobakin, Huacai Chen
  Cc: Jakub Kicinski, kernel test robot, oe-kbuild-all, linux-kernel,
	Alexander Duyck

Hi Olek,

On Thu, Nov 16, 2023 at 01:06:46PM +0100, Alexander Lobakin wrote:
> From: Kernel Test Robot <lkp@intel.com>
> Date: Thu, 16 Nov 2023 03:12:24 +0800
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   c42d9eeef8e5ba9292eda36fd8e3c11f35ee065c
> > commit: ff4e538c8c3e675a15e1e49509c55951832e0451 page_pool: add a lockdep check for recycling in hardirq
> > date:   3 months ago
> > config: loongarch-randconfig-r133-20231107 (https://download.01.org/0day-ci/archive/20231116/202311160339.DbhaH8LX-lkp@intel.com/config)
> > compiler: loongarch64-linux-gcc (GCC) 13.2.0
> > reproduce: (https://download.01.org/0day-ci/archive/20231116/202311160339.DbhaH8LX-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/202311160339.DbhaH8LX-lkp@intel.com/
> > 
> > sparse warnings: (new ones prefixed by >>)
> >>> net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
> >    net/core/page_pool.c:590:9: sparse:     expected void *ptr
> >    net/core/page_pool.c:590:9: sparse:     got unsigned int [noderef] __percpu *
> 
> Eeehhh... False-positive?

This is a loongarch-specific warning and should be fixed by [1].
We will configure the bot to avoid sending similar duplicate reports.

[1] https://lore.kernel.org/loongarch/20231113032511.860159-1-chenhuacai@loongson.cn/

Thanks,
Yujie

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

end of thread, other threads:[~2023-11-20  2:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 19:12 net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2023-11-16 12:06 ` Alexander Lobakin
2023-11-20  2:24   ` Yujie Liu

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).