Re: [PATCH v6 12/20] sched: Fix runtime accounting w/ split exec & sched contexts

From: kernel test robot
Date: Sat Nov 11 2023 - 06:40:09 EST


Hi John,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/locking/core]
[also build test WARNING on v6.6]
[cannot apply to tip/sched/core tip/master linus/master tip/auto-latest next-20231110]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/John-Stultz/sched-Unify-runtime-accounting-across-classes/20231107-033946
base: tip/locking/core
patch link: https://lore.kernel.org/r/20231106193524.866104-13-jstultz%40google.com
patch subject: [PATCH v6 12/20] sched: Fix runtime accounting w/ split exec & sched contexts
config: x86_64-randconfig-121-20231111 (https://download.01.org/0day-ci/archive/20231111/202311111917.FfLLB7kQ-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231111/202311111917.FfLLB7kQ-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311111917.FfLLB7kQ-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> kernel/sched/fair.c:1116:49: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *running @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:1116:49: sparse: expected struct task_struct *running
kernel/sched/fair.c:1116:49: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:1145:36: 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:1145:36: sparse: expected struct task_struct *curr
kernel/sched/fair.c:1145:36: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:1191:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity const *se @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:1191:32: sparse: expected struct sched_entity const *se
kernel/sched/fair.c:1191:32: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:8053:36: 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:8053:36: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8053:36: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:8086:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:8086:37: sparse: expected struct task_struct *tsk
kernel/sched/fair.c:8086:37: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:8333: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:8333:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8333:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:6369:35: sparse: sparse: marked inline, but without a definition
kernel/sched/fair.c: note: in included file:
kernel/sched/sched.h:2344:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2344:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2344:9: sparse: struct task_struct *
kernel/sched/sched.h:2166:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2166:32: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2166:32: sparse: struct task_struct *
kernel/sched/sched.h:2166:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2166:32: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2166:32: sparse: struct task_struct *

vim +1116 kernel/sched/fair.c

1102
1103 static s64 update_curr_se(struct rq *rq, struct sched_entity *se)
1104 {
1105 u64 now = rq_clock_task(rq);
1106 s64 delta_exec;
1107
1108 /* Calculate the delta from selected se */
1109 delta_exec = now - se->exec_start;
1110 if (unlikely(delta_exec <= 0))
1111 return delta_exec;
1112
1113 /* Update selected se's exec_start */
1114 se->exec_start = now;
1115 if (entity_is_task(se)) {
> 1116 struct task_struct *running = rq->curr;
1117 /*
1118 * If se is a task, we account the time
1119 * against the running task, as w/ proxy-exec
1120 * they may not be the same.
1121 */
1122 running->se.exec_start = now;
1123 running->se.sum_exec_runtime += delta_exec;
1124 } else {
1125 /* If not task, account the time against se */
1126 se->sum_exec_runtime += delta_exec;
1127 }
1128
1129 if (schedstat_enabled()) {
1130 struct sched_statistics *stats;
1131
1132 stats = __schedstats_from_se(se);
1133 __schedstat_set(stats->exec_max,
1134 max(delta_exec, stats->exec_max));
1135 }
1136
1137 return delta_exec;
1138 }
1139

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