All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-6.6 1665/1665] net/core/page_pool.c:590:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Thu, 26 Dec 2024 23:40:04 +0800	[thread overview]
Message-ID: <202412262337.yFvf5ux1-lkp@intel.com> (raw)

tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   16a0cbac6609f8ba10a91a9d52b15bf28243c3ee
commit: ff4e538c8c3e675a15e1e49509c55951832e0451 [1665/1665] page_pool: add a lockdep check for recycling in hardirq
config: loongarch-randconfig-r132-20241226 (https://download.01.org/0day-ci/archive/20241226/202412262337.yFvf5ux1-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241226/202412262337.yFvf5ux1-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/202412262337.yFvf5ux1-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:[~2024-12-26 15:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202412262337.yFvf5ux1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kernel@openeuler.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 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.