Hi Xianglai,
First bad commit (maybe != root cause):
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 84404f248a61323e09909849803ea4efce81742f commit: 351aa968603500987e891b20cc97a677602ae7c2 [3778/13950] loongarch/kernel: Fix loongarch compilation error config: loongarch-randconfig-r133-20240913 (https://download.01.org/0day-ci/archive/20240916/202409161053.1Z3YaAWy-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.1.0 reproduce: (https://download.01.org/0day-ci/archive/20240916/202409161053.1Z3YaAWy-lkp@i...)
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/202409161053.1Z3YaAWy-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) kernel/sched/core.c:266:56: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:266:56: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:266:56: sparse: struct task_struct * kernel/sched/core.c:1046:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:1046:38: sparse: expected struct task_struct *curr kernel/sched/core.c:1046:38: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:2235:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:2235:33: sparse: expected struct task_struct *p kernel/sched/core.c:2235:33: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:2235:68: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:2235:68: sparse: expected struct task_struct *tsk kernel/sched/core.c:2235:68: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:3752:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@ kernel/sched/core.c:3752:17: sparse: expected struct sched_domain *[assigned] sd kernel/sched/core.c:3752:17: sparse: got struct sched_domain [noderef] __rcu *parent kernel/sched/core.c:3960:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct const *p @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:3960:36: sparse: expected struct task_struct const *p kernel/sched/core.c:3960:36: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:9529:43: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *push_task @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:9529:43: sparse: expected struct task_struct *push_task kernel/sched/core.c:9529:43: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:5700:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:5700:38: sparse: expected struct task_struct *curr kernel/sched/core.c:5700:38: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:6334:32: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:6334:32: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:6334:32: sparse: struct task_struct * kernel/sched/core.c:6365:23: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:6365:23: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:6365:23: sparse: struct task_struct * kernel/sched/core.c:6373:46: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:6373:46: sparse: struct task_struct * kernel/sched/core.c:6373:46: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:6432: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/core.c:6432:9: sparse: expected struct sched_domain *[assigned] sd kernel/sched/core.c:6432:9: sparse: got struct sched_domain [noderef] __rcu *parent kernel/sched/core.c:6645:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *prev @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:6645:14: sparse: expected struct task_struct *prev kernel/sched/core.c:6645:14: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:7170:17: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:7170:17: sparse: struct task_struct * kernel/sched/core.c:7170:17: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:7386:22: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:7386:22: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:7386:22: sparse: struct task_struct * kernel/sched/core.c:7433:48: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:7433:48: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:7433:48: sparse: struct task_struct *
kernel/sched/core.c:11392:5: sparse: sparse: symbol 'tg_set_dynamic_affinity_mode' was not declared. Should it be static? kernel/sched/core.c:11433:5: sparse: sparse: symbol 'tg_set_affinity_period' was not declared. Should it be static? kernel/sched/core.c:11447:5: sparse: sparse: symbol 'tg_get_affinity_period' was not declared. Should it be static?
kernel/sched/core.c:12140:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/core.c:12140:25: sparse: expected struct task_struct *p kernel/sched/core.c:12140:25: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:340:9: sparse: sparse: context imbalance in 'sched_core_lock' - different lock contexts for basic block kernel/sched/core.c:350:17: sparse: sparse: context imbalance in 'sched_core_unlock' - unexpected unlock kernel/sched/core.c:553:6: sparse: sparse: context imbalance in 'raw_spin_rq_lock_nested' - wrong count at exit kernel/sched/core.c:578:6: sparse: sparse: context imbalance in 'raw_spin_rq_trylock' - wrong count at exit kernel/sched/core.c: note: in included file: kernel/sched/sched.h:1364:30: sparse: sparse: context imbalance in 'raw_spin_rq_unlock' - unexpected unlock kernel/sched/core.c:640:36: sparse: sparse: context imbalance in '__task_rq_lock' - wrong count at exit kernel/sched/core.c:681:36: sparse: sparse: context imbalance in 'task_rq_lock' - wrong count at exit kernel/sched/core.c: note: in included file: kernel/sched/pelt.h:97:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct const *p @@ got struct task_struct [noderef] __rcu *curr @@ kernel/sched/pelt.h:97:13: sparse: expected struct task_struct const *p kernel/sched/pelt.h:97:13: sparse: got struct task_struct [noderef] __rcu *curr kernel/sched/core.c:2226:33: sparse: sparse: dereference of noderef expression kernel/sched/core.c:2227:19: sparse: sparse: dereference of noderef expression kernel/sched/core.c:2228:18: sparse: sparse: dereference of noderef expression kernel/sched/core.c:2288:15: sparse: sparse: context imbalance in 'wait_task_inactive' - different lock contexts for basic block kernel/sched/core.c: note: in included file: kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/core.c:2201:38: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/core.c:2201:38: sparse: struct task_struct [noderef] __rcu * kernel/sched/core.c:2201:38: sparse: struct task_struct const * kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/core.c: note: in included file (through include/linux/mmu_context.h, include/linux/cpuset.h): arch/loongarch/include/asm/mmu_context.h:86:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_w' arch/loongarch/include/asm/mmu_context.h:89:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/include/asm/mmu_context.h:91:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' kernel/sched/core.c: note: in included file (through arch/loongarch/include/asm/switch_to.h): arch/loongarch/include/asm/fpu.h:76:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' arch/loongarch/include/asm/fpu.h:85:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' kernel/sched/core.c: note: in included file (through arch/loongarch/include/asm/cpu-info.h, arch/loongarch/include/asm/processor.h, ...): arch/loongarch/include/asm/loongarch.h:1252:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' arch/loongarch/include/asm/loongarch.h:1252:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_w' kernel/sched/core.c: note: in included file (through arch/loongarch/include/asm/switch_to.h): arch/loongarch/include/asm/fpu.h:225:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrxchg_w' kernel/sched/core.c: note: in included file: kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct * kernel/sched/sched.h:2288:25: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2288:25: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2288:25: sparse: struct task_struct * kernel/sched/sched.h:2454:9: sparse: sparse: incompatible types in comparison expression (different address spaces): kernel/sched/sched.h:2454:9: sparse: struct task_struct [noderef] __rcu * kernel/sched/sched.h:2454:9: sparse: struct task_struct *
vim +/tg_set_dynamic_affinity_mode +11392 kernel/sched/core.c
304000390f88d0 Josh Don 2021-07-29 11390 6eb07f9925a906 Hui Tang 2024-01-17 11391 #ifdef CONFIG_QOS_SCHED_SMART_GRID 6eb07f9925a906 Hui Tang 2024-01-17 @11392 int tg_set_dynamic_affinity_mode(struct task_group *tg, u64 mode) 6eb07f9925a906 Hui Tang 2024-01-17 11393 { 6eb07f9925a906 Hui Tang 2024-01-17 11394 struct auto_affinity *auto_affi = tg->auto_affinity; 6eb07f9925a906 Hui Tang 2024-01-17 11395 6eb07f9925a906 Hui Tang 2024-01-17 11396 if (unlikely(!auto_affi)) 6eb07f9925a906 Hui Tang 2024-01-17 11397 return -EPERM; 6eb07f9925a906 Hui Tang 2024-01-17 11398 6eb07f9925a906 Hui Tang 2024-01-17 11399 /* auto mode */ 6eb07f9925a906 Hui Tang 2024-01-17 11400 if (mode == 1) 6eb07f9925a906 Hui Tang 2024-01-17 11401 start_auto_affinity(auto_affi); 6eb07f9925a906 Hui Tang 2024-01-17 11402 else if (mode == 0) 6eb07f9925a906 Hui Tang 2024-01-17 11403 stop_auto_affinity(auto_affi); 6eb07f9925a906 Hui Tang 2024-01-17 11404 else 6eb07f9925a906 Hui Tang 2024-01-17 11405 return -EINVAL; 6eb07f9925a906 Hui Tang 2024-01-17 11406 6eb07f9925a906 Hui Tang 2024-01-17 11407 return 0; 6eb07f9925a906 Hui Tang 2024-01-17 11408 } 6eb07f9925a906 Hui Tang 2024-01-17 11409 6eb07f9925a906 Hui Tang 2024-01-17 11410 static u64 cpu_affinity_mode_read_u64(struct cgroup_subsys_state *css, 6eb07f9925a906 Hui Tang 2024-01-17 11411 struct cftype *cft) 6eb07f9925a906 Hui Tang 2024-01-17 11412 { 6eb07f9925a906 Hui Tang 2024-01-17 11413 struct task_group *tg = css_tg(css); 6eb07f9925a906 Hui Tang 2024-01-17 11414 e76dedf2e4cc38 Yipeng Zou 2024-01-17 11415 if (!smart_grid_enabled()) 6eb07f9925a906 Hui Tang 2024-01-17 11416 return -EPERM; 6eb07f9925a906 Hui Tang 2024-01-17 11417 6eb07f9925a906 Hui Tang 2024-01-17 11418 if (unlikely(!tg->auto_affinity)) 6eb07f9925a906 Hui Tang 2024-01-17 11419 return -EPERM; 6eb07f9925a906 Hui Tang 2024-01-17 11420 6eb07f9925a906 Hui Tang 2024-01-17 11421 return tg->auto_affinity->mode; 6eb07f9925a906 Hui Tang 2024-01-17 11422 } 6eb07f9925a906 Hui Tang 2024-01-17 11423 6eb07f9925a906 Hui Tang 2024-01-17 11424 static int cpu_affinity_mode_write_u64(struct cgroup_subsys_state *css, 6eb07f9925a906 Hui Tang 2024-01-17 11425 struct cftype *cftype, u64 mode) 6eb07f9925a906 Hui Tang 2024-01-17 11426 { e76dedf2e4cc38 Yipeng Zou 2024-01-17 11427 if (!smart_grid_enabled()) 6eb07f9925a906 Hui Tang 2024-01-17 11428 return -EPERM; 6eb07f9925a906 Hui Tang 2024-01-17 11429 6eb07f9925a906 Hui Tang 2024-01-17 11430 return tg_set_dynamic_affinity_mode(css_tg(css), mode); 6eb07f9925a906 Hui Tang 2024-01-17 11431 } 6eb07f9925a906 Hui Tang 2024-01-17 11432 6eb07f9925a906 Hui Tang 2024-01-17 @11433 int tg_set_affinity_period(struct task_group *tg, u64 period_ms) 6eb07f9925a906 Hui Tang 2024-01-17 11434 { 6eb07f9925a906 Hui Tang 2024-01-17 11435 if (unlikely(!tg->auto_affinity)) 6eb07f9925a906 Hui Tang 2024-01-17 11436 return -EPERM; 6eb07f9925a906 Hui Tang 2024-01-17 11437 6eb07f9925a906 Hui Tang 2024-01-17 11438 if (!period_ms || period_ms > U64_MAX / NSEC_PER_MSEC) 6eb07f9925a906 Hui Tang 2024-01-17 11439 return -EINVAL; 6eb07f9925a906 Hui Tang 2024-01-17 11440 6eb07f9925a906 Hui Tang 2024-01-17 11441 raw_spin_lock_irq(&tg->auto_affinity->lock); 6eb07f9925a906 Hui Tang 2024-01-17 11442 tg->auto_affinity->period = ms_to_ktime(period_ms); 6eb07f9925a906 Hui Tang 2024-01-17 11443 raw_spin_unlock_irq(&tg->auto_affinity->lock); 6eb07f9925a906 Hui Tang 2024-01-17 11444 return 0; 6eb07f9925a906 Hui Tang 2024-01-17 11445 } 6eb07f9925a906 Hui Tang 2024-01-17 11446 6eb07f9925a906 Hui Tang 2024-01-17 @11447 u64 tg_get_affinity_period(struct task_group *tg) 6eb07f9925a906 Hui Tang 2024-01-17 11448 { 6eb07f9925a906 Hui Tang 2024-01-17 11449 if (unlikely(!tg->auto_affinity)) 6eb07f9925a906 Hui Tang 2024-01-17 11450 return -EPERM; 6eb07f9925a906 Hui Tang 2024-01-17 11451 6eb07f9925a906 Hui Tang 2024-01-17 11452 return ktime_to_ms(tg->auto_affinity->period); 6eb07f9925a906 Hui Tang 2024-01-17 11453 } 6eb07f9925a906 Hui Tang 2024-01-17 11454
:::::: The code at line 11392 was first introduced by commit :::::: 6eb07f9925a906d81f328c808ba25f7800888dce sched: Introduce smart grid scheduling strategy for cfs
:::::: TO: Hui Tang tanghui20@huawei.com :::::: CC: yanhaitao yanhaitao2@huawei.com