Re: [PATCH 1/1] sched/fair: improve yield_to vs fairness

kernel test robot
2021-07-07T18:08:18Z

[-- Attachment #1: Type: text/plain, Size: 5601 bytes --]

Hi Christian,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/sched/core]
[also build test WARNING on v5.13 next-20210707]
[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]

url: https://github.com/0day-ci/linux/commits/Christian-Borntraeger/sched-fair-improve-yield_to-vs-fairness/20210707-213440
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 031e3bd8986fffe31e1ddbf5264cccfe30c9abd7
config: i386-randconfig-s002-20210707 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/75196412f9c36f51144f4c333b2b02d57bb0ebde
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christian-Borntraeger/sched-fair-improve-yield_to-vs-fairness/20210707-213440
git checkout 75196412f9c36f51144f4c333b2b02d57bb0ebde
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

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

sparse warnings: (new ones prefixed by >>)
kernel/sched/fair.c:830: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:830:34: sparse: expected struct sched_entity *se
kernel/sched/fair.c:830:34: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:5458: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:5458:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:5458:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7048: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:7048:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:7048:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7332: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:7332:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:7332:38: sparse: got struct task_struct [noderef] __rcu *curr
>> kernel/sched/fair.c:7364:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_entity *curr @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:7364:40: sparse: expected struct sched_entity *curr
kernel/sched/fair.c:7364:40: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:5387:35: sparse: sparse: marked inline, but without a definition
kernel/sched/fair.c: note: in included file:
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: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/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 +7364 kernel/sched/fair.c

7360
7361 static bool yield_to_task_fair(struct rq *rq, struct task_struct *p)
7362 {
7363 struct sched_entity *se = &p->se;
> 7364 struct sched_entity *curr = &rq->curr->se;
7365
7366 /* throttled hierarchies are not runnable */
7367 if (!se->on_rq || throttled_hierarchy(cfs_rq_of(se)))
7368 return false;
7369
7370 /* Tell the scheduler that we'd really like pse to run next. */
7371 set_next_buddy(se);
7372
7373 yield_task_fair(rq);
7374
7375 /*
7376 * This path is special and only called from KVM. In contrast to yield,
7377 * in yield_to we really know that current is spinning and we know
7378 * (s390) or have good heuristics whom are we waiting for. There is
7379 * absolutely no point in continuing the current task, even if this
7380 * means to become unfairer. Let us give the current process some
7381 * "fake" penalty.
7382 */
7383 curr->vruntime += sched_slice(cfs_rq_of(curr), curr);
7384
7385 return true;
7386 }
7387

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36153 bytes --]