public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Alexander Duyck <alexanderduyck@fb.com>
Subject: net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Thu, 16 Nov 2023 03:12:24 +0800	[thread overview]
Message-ID: <202311160339.DbhaH8LX-lkp@intel.com> (raw)

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

             reply	other threads:[~2023-11-15 19:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 19:12 kernel test robot [this message]
2023-11-16 12:06 ` net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces) Alexander Lobakin
2023-11-20  2:24   ` Yujie Liu

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=202311160339.DbhaH8LX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexanderduyck@fb.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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