lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202205101914.mxQiTOkX-lkp@intel.com>
Date:   Tue, 10 May 2022 20:00:51 +0800
From:   kernel test robot <lkp@...el.com>
To:     Chen Yu <yu.c.chen@...el.com>
Cc:     kbuild-all@...ts.01.org, Chen Yu <yu.c.chen@...el.com>,
        linux-kernel@...r.kernel.org
Subject: [yu-chen-surf:sis 1/1] kernel/sched/fair.c:9317:19: sparse: sparse:
 incompatible types in comparison expression (different type sizes):

tree:   https://github.com/yu-chen-surf/linux.git sis
head:   e59a4ccc3962b54c5488c142b073dcf9b85b5843
commit: e59a4ccc3962b54c5488c142b073dcf9b85b5843 [1/1] sched/fair: Introduce SIS_UTIL to search idle CPU based on sum of util_avg
config: arc-randconfig-s031-20220509 (https://download.01.org/0day-ci/archive/20220510/202205101914.mxQiTOkX-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.3.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-dirty
        # https://github.com/yu-chen-surf/linux/commit/e59a4ccc3962b54c5488c142b073dcf9b85b5843
        git remote add yu-chen-surf https://github.com/yu-chen-surf/linux.git
        git fetch --no-tags yu-chen-surf sis
        git checkout e59a4ccc3962b54c5488c142b073dcf9b85b5843
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash kernel/sched/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


sparse warnings: (new ones prefixed by >>)
   kernel/sched/fair.c:918:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct sched_entity *se @@     got struct sched_entity [noderef] __rcu * @@
   kernel/sched/fair.c:918:34: sparse:     expected struct sched_entity *se
   kernel/sched/fair.c:918:34: sparse:     got struct sched_entity [noderef] __rcu *
   kernel/sched/fair.c:11027:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sched_domain *[assigned] sd @@     got struct sched_domain [noderef] __rcu *parent @@
   kernel/sched/fair.c:11027:9: sparse:     expected struct sched_domain *[assigned] sd
   kernel/sched/fair.c:11027:9: sparse:     got struct sched_domain [noderef] __rcu *parent
   kernel/sched/fair.c:5053:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/sched/fair.c:5053:22: sparse:    struct task_struct [noderef] __rcu *
   kernel/sched/fair.c:5053:22: sparse:    struct task_struct *
   kernel/sched/fair.c:5834:1: sparse: sparse: symbol '__pcpu_scope_load_balance_mask' was not declared. Should it be static?
   kernel/sched/fair.c:5835:1: sparse: sparse: symbol '__pcpu_scope_select_idle_mask' was not declared. Should it be static?
   kernel/sched/fair.c:6817:20: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sched_domain *[assigned] sd @@     got struct sched_domain [noderef] __rcu *parent @@
   kernel/sched/fair.c:6817:20: sparse:     expected struct sched_domain *[assigned] sd
   kernel/sched/fair.c:6817:20: sparse:     got struct sched_domain [noderef] __rcu *parent
   kernel/sched/fair.c:6951:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sched_domain *[assigned] tmp @@     got struct sched_domain [noderef] __rcu *parent @@
   kernel/sched/fair.c:6951:9: sparse:     expected struct sched_domain *[assigned] tmp
   kernel/sched/fair.c:6951:9: sparse:     got struct sched_domain [noderef] __rcu *parent
   kernel/sched/fair.c:7149:38: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct task_struct *curr @@     got struct task_struct [noderef] __rcu *curr @@
   kernel/sched/fair.c:7149:38: sparse:     expected struct task_struct *curr
   kernel/sched/fair.c:7149:38: sparse:     got struct task_struct [noderef] __rcu *curr
   kernel/sched/fair.c:7447:38: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct task_struct *curr @@     got struct task_struct [noderef] __rcu *curr @@
   kernel/sched/fair.c:7447:38: sparse:     expected struct task_struct *curr
   kernel/sched/fair.c:7447:38: sparse:     got struct task_struct [noderef] __rcu *curr
   kernel/sched/fair.c:8432:40: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sched_domain *child @@     got struct sched_domain [noderef] __rcu *child @@
   kernel/sched/fair.c:8432:40: sparse:     expected struct sched_domain *child
   kernel/sched/fair.c:8432:40: sparse:     got struct sched_domain [noderef] __rcu *child
   kernel/sched/fair.c:8976:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/sched/fair.c:8976:22: sparse:    struct task_struct [noderef] __rcu *
   kernel/sched/fair.c:8976:22: sparse:    struct task_struct *
   kernel/sched/fair.c:10302:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sched_domain *[assigned] sd @@     got struct sched_domain [noderef] __rcu *parent @@
   kernel/sched/fair.c:10302:9: sparse:     expected struct sched_domain *[assigned] sd
   kernel/sched/fair.c:10302:9: sparse:     got struct sched_domain [noderef] __rcu *parent
   kernel/sched/fair.c:9962:44: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sched_domain *sd_parent @@     got struct sched_domain [noderef] __rcu *parent @@
   kernel/sched/fair.c:9962:44: sparse:     expected struct sched_domain *sd_parent
   kernel/sched/fair.c:9962:44: sparse:     got struct sched_domain [noderef] __rcu *parent
   kernel/sched/fair.c:10398:9: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sched_domain *[assigned] sd @@     got struct sched_domain [noderef] __rcu *parent @@
   kernel/sched/fair.c:10398:9: sparse:     expected struct sched_domain *[assigned] sd
   kernel/sched/fair.c:10398:9: sparse:     got struct sched_domain [noderef] __rcu *parent
   kernel/sched/fair.c:4693:31: sparse: sparse: marked inline, but without a definition
   kernel/sched/fair.c: note: in included file:
   kernel/sched/sched.h:2169:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/sched/sched.h:2169:9: sparse:    struct task_struct [noderef] __rcu *
   kernel/sched/sched.h:2169:9: sparse:    struct task_struct *
>> kernel/sched/fair.c:9317:19: sparse: sparse: incompatible types in comparison expression (different type sizes):
>> kernel/sched/fair.c:9317:19: sparse:    int *
>> kernel/sched/fair.c:9317:19: sparse:    long *
   kernel/sched/sched.h:2011:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/sched/sched.h:2011:25: sparse:    struct task_struct [noderef] __rcu *
   kernel/sched/sched.h:2011:25: sparse:    struct task_struct *
   kernel/sched/sched.h:2011:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/sched/sched.h:2011:25: sparse:    struct task_struct [noderef] __rcu *
   kernel/sched/sched.h:2011:25: sparse:    struct task_struct *

vim +9317 kernel/sched/fair.c

  9267	
  9268	static inline void update_idle_cpu_scan(struct lb_env *env,
  9269						unsigned long sum_util)
  9270	{
  9271		struct sched_domain_shared *sd_share;
  9272		int nr_scan, nr_llc, x, y;
  9273	
  9274		if (!sched_feat(SIS_UTIL))
  9275			return;
  9276		/*
  9277		 * Update the number of CPUs to scan in LLC domain, which could
  9278		 * be used as a hint in select_idle_cpu(). The update of this hint
  9279		 * occurs during periodic load balancing, rather than frequent
  9280		 * newidle balance.
  9281		 */
  9282		nr_llc = per_cpu(sd_llc_size, env->dst_cpu);
  9283		if (env->idle == CPU_NEWLY_IDLE ||
  9284		    env->sd->span_weight != nr_llc)
  9285			return;
  9286	
  9287		sd_share = rcu_dereference(per_cpu(sd_llc_shared, env->dst_cpu));
  9288		if (!sd_share)
  9289			return;
  9290	
  9291		/*
  9292		 * The number of CPUs to search drops as sum_util increases, when
  9293		 * sum_util hits 85% or above, the scan stops.
  9294		 * The reason to choose 85% as the threshold is because this is the
  9295		 * imbalance_pct(117) when a LLC sched group is overloaded.
  9296		 *
  9297		 * let y = 1 - (x/0.85)^2                                         [1]
  9298		 *
  9299		 * y is the ratio of CPUs to be scanned in the LLC
  9300		 * domain, x is the ratio of sum_util compared to the
  9301		 * CPU capacity:
  9302		 *
  9303		 * x = sum_util / (nr_llc * SCHED_CAPACITY_SCALE)                 [2]
  9304		 *
  9305		 * Scale x by SCHED_CAPACITY_SCALE and [2] becomes:
  9306		 *
  9307		 * x = sum_util / nr_llc                                          [3]
  9308		 *
  9309		 * and [1] becomes:
  9310		 *
  9311		 * y = (SCHED_CAPACITY_SCALE - (x*x)/740) / SCHED_CAPACITY_SCALE  [4]
  9312		 *
  9313		 * then the number of CPUs to scan is nr_scan = nr_llc * y
  9314		 */
  9315		x = sum_util / nr_llc;
  9316		y = SCHED_CAPACITY_SCALE - (x * x) / 740;
> 9317		nr_scan = max(0, nr_llc * y  / SCHED_CAPACITY_SCALE);
  9318		WRITE_ONCE(sd_share->nr_idle_scan, nr_scan);
  9319	}
  9320	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ