All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: mm/vmscan.c:4080:29: sparse: sparse: cast to non-scalar
Date: Thu, 19 Jan 2023 16:09:59 +0800	[thread overview]
Message-ID: <202301191605.XaYMfTFT-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "low confidence static check warning: mm/vmscan.c:4080:29: sparse: sparse: cast to non-scalar"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Yu Zhao <yuzhao@google.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7287904c8771b77b9504f53623bb477065c19a58
commit: bd74fdaea146029e4fa12c6de89adbe0779348a9 mm: multi-gen LRU: support page table walks
date:   4 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 4 months ago
config: alpha-randconfig-s051-20230118 (https://download.01.org/0day-ci/archive/20230119/202301191605.XaYMfTFT-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bd74fdaea146029e4fa12c6de89adbe0779348a9
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout bd74fdaea146029e4fa12c6de89adbe0779348a9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
>> mm/vmscan.c:4080:29: sparse: sparse: cast to non-scalar
>> mm/vmscan.c:4080:29: sparse: sparse: cast from non-scalar
   mm/vmscan.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, include/linux/mmzone.h, ...):
   include/linux/rcupdate.h:737:9: sparse: sparse: context imbalance in 'lru_gen_look_around' - different lock contexts for basic block
   mm/vmscan.c: note: in included file (through include/linux/swap.h):
   include/linux/memcontrol.h:1663:39: sparse: sparse: context imbalance in 'check_move_unevictable_folios' - unexpected unlock

vim +4080 mm/vmscan.c

bd74fdaea14602 Yu Zhao 2022-09-18  4065  
bd74fdaea14602 Yu Zhao 2022-09-18  4066  static int walk_pud_range(p4d_t *p4d, unsigned long start, unsigned long end,
bd74fdaea14602 Yu Zhao 2022-09-18  4067  			  struct mm_walk *args)
bd74fdaea14602 Yu Zhao 2022-09-18  4068  {
bd74fdaea14602 Yu Zhao 2022-09-18  4069  	int i;
bd74fdaea14602 Yu Zhao 2022-09-18  4070  	pud_t *pud;
bd74fdaea14602 Yu Zhao 2022-09-18  4071  	unsigned long addr;
bd74fdaea14602 Yu Zhao 2022-09-18  4072  	unsigned long next;
bd74fdaea14602 Yu Zhao 2022-09-18  4073  	struct lru_gen_mm_walk *walk = args->private;
bd74fdaea14602 Yu Zhao 2022-09-18  4074  
bd74fdaea14602 Yu Zhao 2022-09-18  4075  	VM_WARN_ON_ONCE(p4d_leaf(*p4d));
bd74fdaea14602 Yu Zhao 2022-09-18  4076  
bd74fdaea14602 Yu Zhao 2022-09-18  4077  	pud = pud_offset(p4d, start & P4D_MASK);
bd74fdaea14602 Yu Zhao 2022-09-18  4078  restart:
bd74fdaea14602 Yu Zhao 2022-09-18  4079  	for (i = pud_index(start), addr = start; addr != end; i++, addr = next) {
bd74fdaea14602 Yu Zhao 2022-09-18 @4080  		pud_t val = READ_ONCE(pud[i]);
bd74fdaea14602 Yu Zhao 2022-09-18  4081  
bd74fdaea14602 Yu Zhao 2022-09-18  4082  		next = pud_addr_end(addr, end);
bd74fdaea14602 Yu Zhao 2022-09-18  4083  
bd74fdaea14602 Yu Zhao 2022-09-18  4084  		if (!pud_present(val) || WARN_ON_ONCE(pud_leaf(val)))
bd74fdaea14602 Yu Zhao 2022-09-18  4085  			continue;
bd74fdaea14602 Yu Zhao 2022-09-18  4086  
bd74fdaea14602 Yu Zhao 2022-09-18  4087  		walk_pmd_range(&val, addr, next, args);
bd74fdaea14602 Yu Zhao 2022-09-18  4088  
bd74fdaea14602 Yu Zhao 2022-09-18  4089  		/* a racy check to curtail the waiting time */
bd74fdaea14602 Yu Zhao 2022-09-18  4090  		if (wq_has_sleeper(&walk->lruvec->mm_state.wait))
bd74fdaea14602 Yu Zhao 2022-09-18  4091  			return 1;
bd74fdaea14602 Yu Zhao 2022-09-18  4092  
bd74fdaea14602 Yu Zhao 2022-09-18  4093  		if (need_resched() || walk->batched >= MAX_LRU_BATCH) {
bd74fdaea14602 Yu Zhao 2022-09-18  4094  			end = (addr | ~PUD_MASK) + 1;
bd74fdaea14602 Yu Zhao 2022-09-18  4095  			goto done;
bd74fdaea14602 Yu Zhao 2022-09-18  4096  		}
bd74fdaea14602 Yu Zhao 2022-09-18  4097  	}
bd74fdaea14602 Yu Zhao 2022-09-18  4098  
bd74fdaea14602 Yu Zhao 2022-09-18  4099  	if (i < PTRS_PER_PUD && get_next_vma(P4D_MASK, PUD_SIZE, args, &start, &end))
bd74fdaea14602 Yu Zhao 2022-09-18  4100  		goto restart;
bd74fdaea14602 Yu Zhao 2022-09-18  4101  
bd74fdaea14602 Yu Zhao 2022-09-18  4102  	end = round_up(end, P4D_SIZE);
bd74fdaea14602 Yu Zhao 2022-09-18  4103  done:
bd74fdaea14602 Yu Zhao 2022-09-18  4104  	if (!end || !args->vma)
bd74fdaea14602 Yu Zhao 2022-09-18  4105  		return 1;
bd74fdaea14602 Yu Zhao 2022-09-18  4106  
bd74fdaea14602 Yu Zhao 2022-09-18  4107  	walk->next_addr = max(end, args->vma->vm_start);
bd74fdaea14602 Yu Zhao 2022-09-18  4108  
bd74fdaea14602 Yu Zhao 2022-09-18  4109  	return -EAGAIN;
bd74fdaea14602 Yu Zhao 2022-09-18  4110  }
bd74fdaea14602 Yu Zhao 2022-09-18  4111  

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

             reply	other threads:[~2023-01-19  8:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  8:09 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-11  2:47 mm/vmscan.c:4080:29: sparse: sparse: cast to non-scalar kernel test robot
2023-06-29 19:18 kernel test robot
2023-05-10 17:31 kernel test robot
2023-03-29 19:28 kernel test robot
2023-03-29 18:57 kernel test robot
2023-01-19  3:53 kernel test robot
2022-12-02  6:49 kernel test robot

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=202301191605.XaYMfTFT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@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.