[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202109171316.1J0bOfpZ-lkp@intel.com>
Date: Fri, 17 Sep 2021 13:19:32 +0800
From: kernel test robot <lkp@...el.com>
To: Daniel Thompson <daniel.thompson@...aro.org>,
Jason Wessel <jason.wessel@...driver.com>,
Douglas Anderson <dianders@...omium.org>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
Xiang wangx <wangxiang@...rlc.com>,
jing yangyang <jing.yangyang@....com.cn>,
kgdb-bugreport@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
patches@...aro.org
Subject: Re: [PATCH] kdb: Adopt scheduler's task clasification
Hi Daniel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f]
url: https://github.com/0day-ci/linux/commits/Daniel-Thompson/kdb-Adopt-scheduler-s-task-clasification/20210917-004549
base: 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
config: hexagon-randconfig-r001-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/d315f14b7a044983f76f08221be33c2900c58e37
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Daniel-Thompson/kdb-Adopt-scheduler-s-task-clasification/20210917-004549
git checkout d315f14b7a044983f76f08221be33c2900c58e37
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> kernel/debug/kdb/kdb_support.c:512:41: warning: variable 'cpu' is uninitialized when used here [-Wuninitialized]
if (!kdb_task_has_cpu(p) || kgdb_info[cpu].irq_depth == 1) {
^~~
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
kernel/debug/kdb/kdb_support.c:489:9: note: initialize the variable 'cpu' to silence this warning
int cpu;
^
= 0
1 warning generated.
vim +/cpu +512 kernel/debug/kdb/kdb_support.c
5d5314d6795f3c1 Jason Wessel 2010-05-20 475
5d5314d6795f3c1 Jason Wessel 2010-05-20 476
5d5314d6795f3c1 Jason Wessel 2010-05-20 477
5d5314d6795f3c1 Jason Wessel 2010-05-20 478 /*
5d5314d6795f3c1 Jason Wessel 2010-05-20 479 * kdb_task_state_char - Return the character that represents the task state.
5d5314d6795f3c1 Jason Wessel 2010-05-20 480 * Inputs:
5d5314d6795f3c1 Jason Wessel 2010-05-20 481 * p struct task for the process
5d5314d6795f3c1 Jason Wessel 2010-05-20 482 * Returns:
5d5314d6795f3c1 Jason Wessel 2010-05-20 483 * One character to represent the task state.
5d5314d6795f3c1 Jason Wessel 2010-05-20 484 */
5d5314d6795f3c1 Jason Wessel 2010-05-20 485 char kdb_task_state_char (const struct task_struct *p)
5d5314d6795f3c1 Jason Wessel 2010-05-20 486 {
5d5314d6795f3c1 Jason Wessel 2010-05-20 487 unsigned long tmp;
2f064a59a11ff9b Peter Zijlstra 2021-06-11 488 char state;
2f064a59a11ff9b Peter Zijlstra 2021-06-11 489 int cpu;
5d5314d6795f3c1 Jason Wessel 2010-05-20 490
fe557319aa06c23 Christoph Hellwig 2020-06-17 491 if (!p ||
fe557319aa06c23 Christoph Hellwig 2020-06-17 492 copy_from_kernel_nofault(&tmp, (char *)p, sizeof(unsigned long)))
5d5314d6795f3c1 Jason Wessel 2010-05-20 493 return 'E';
5d5314d6795f3c1 Jason Wessel 2010-05-20 494
d315f14b7a04498 Daniel Thompson 2021-09-16 495 state = task_state_to_char((struct task_struct *) p);
d315f14b7a04498 Daniel Thompson 2021-09-16 496
d315f14b7a04498 Daniel Thompson 2021-09-16 497 /*
d315f14b7a04498 Daniel Thompson 2021-09-16 498 * task_state_to_char() uses I(dle) differently to is_idle_task().
d315f14b7a04498 Daniel Thompson 2021-09-16 499 * I(dle) tasks are (U)ninterruptible tasks that do not
d315f14b7a04498 Daniel Thompson 2021-09-16 500 * contribute to the load average and have nothing to do with
d315f14b7a04498 Daniel Thompson 2021-09-16 501 * code that runs on idle CPUs.
d315f14b7a04498 Daniel Thompson 2021-09-16 502 *
d315f14b7a04498 Daniel Thompson 2021-09-16 503 * For historic reasons we'd like to reserve I for idle CPUs in
d315f14b7a04498 Daniel Thompson 2021-09-16 504 * kdb so we must reclassify (I)dle tasks.
d315f14b7a04498 Daniel Thompson 2021-09-16 505 */
d315f14b7a04498 Daniel Thompson 2021-09-16 506 if (state == 'I')
d315f14b7a04498 Daniel Thompson 2021-09-16 507 state = 'U';
d315f14b7a04498 Daniel Thompson 2021-09-16 508
7fc20c5cbdd184f Paul E. McKenney 2011-11-10 509 if (is_idle_task(p)) {
5d5314d6795f3c1 Jason Wessel 2010-05-20 510 /* Idle task. Is it really idle, apart from the kdb
5d5314d6795f3c1 Jason Wessel 2010-05-20 511 * interrupt? */
5d5314d6795f3c1 Jason Wessel 2010-05-20 @512 if (!kdb_task_has_cpu(p) || kgdb_info[cpu].irq_depth == 1) {
5d5314d6795f3c1 Jason Wessel 2010-05-20 513 if (cpu != kdb_initial_cpu)
5d5314d6795f3c1 Jason Wessel 2010-05-20 514 state = 'I'; /* idle task */
5d5314d6795f3c1 Jason Wessel 2010-05-20 515 }
5d5314d6795f3c1 Jason Wessel 2010-05-20 516 } else if (!p->mm && state == 'S') {
5d5314d6795f3c1 Jason Wessel 2010-05-20 517 state = 'M'; /* sleeping system daemon */
5d5314d6795f3c1 Jason Wessel 2010-05-20 518 }
5d5314d6795f3c1 Jason Wessel 2010-05-20 519 return state;
5d5314d6795f3c1 Jason Wessel 2010-05-20 520 }
5d5314d6795f3c1 Jason Wessel 2010-05-20 521
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (27402 bytes)
Powered by blists - more mailing lists