From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Uros Bizjak <ubizjak@gmail.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 3092/3266] kernel/smpboot.c:449 cpu_wait_death() error: uninitialized symbol 'oldstate'.
Date: Thu, 25 Aug 2022 16:52:08 +0300 [thread overview]
Message-ID: <202208251909.gOzRDLgL-lkp@intel.com> (raw)
Hi Uros,
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b5d939c951865f6fc229094e84b77c9a9e0ed0c7
commit: 2d1e07c7534c14e56ac3818fa24e7c1643a9b1dc [3092/3266] smpboot: use atomic_try_cmpxchg in cpu_wait_death and cpu_report_death
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20220825/202208251909.gOzRDLgL-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
kernel/smpboot.c:449 cpu_wait_death() error: uninitialized symbol 'oldstate'.
vim +/oldstate +449 kernel/smpboot.c
8038dad7e88858 Paul E. McKenney 2015-02-25 425 bool cpu_wait_death(unsigned int cpu, int seconds)
8038dad7e88858 Paul E. McKenney 2015-02-25 426 {
8038dad7e88858 Paul E. McKenney 2015-02-25 427 int jf_left = seconds * HZ;
8038dad7e88858 Paul E. McKenney 2015-02-25 428 int oldstate;
8038dad7e88858 Paul E. McKenney 2015-02-25 429 bool ret = true;
8038dad7e88858 Paul E. McKenney 2015-02-25 430 int sleep_jf = 1;
8038dad7e88858 Paul E. McKenney 2015-02-25 431
8038dad7e88858 Paul E. McKenney 2015-02-25 432 might_sleep();
8038dad7e88858 Paul E. McKenney 2015-02-25 433
8038dad7e88858 Paul E. McKenney 2015-02-25 434 /* The outgoing CPU will normally get done quite quickly. */
8038dad7e88858 Paul E. McKenney 2015-02-25 435 if (atomic_read(&per_cpu(cpu_hotplug_state, cpu)) == CPU_DEAD)
8038dad7e88858 Paul E. McKenney 2015-02-25 436 goto update_state;
Uninitialized.
8038dad7e88858 Paul E. McKenney 2015-02-25 437 udelay(5);
8038dad7e88858 Paul E. McKenney 2015-02-25 438
8038dad7e88858 Paul E. McKenney 2015-02-25 439 /* But if the outgoing CPU dawdles, wait increasingly long times. */
8038dad7e88858 Paul E. McKenney 2015-02-25 440 while (atomic_read(&per_cpu(cpu_hotplug_state, cpu)) != CPU_DEAD) {
8038dad7e88858 Paul E. McKenney 2015-02-25 441 schedule_timeout_uninterruptible(sleep_jf);
8038dad7e88858 Paul E. McKenney 2015-02-25 442 jf_left -= sleep_jf;
8038dad7e88858 Paul E. McKenney 2015-02-25 443 if (jf_left <= 0)
8038dad7e88858 Paul E. McKenney 2015-02-25 444 break;
8038dad7e88858 Paul E. McKenney 2015-02-25 445 sleep_jf = DIV_ROUND_UP(sleep_jf * 11, 10);
8038dad7e88858 Paul E. McKenney 2015-02-25 446 }
8038dad7e88858 Paul E. McKenney 2015-02-25 447 oldstate = atomic_read(&per_cpu(cpu_hotplug_state, cpu));
2d1e07c7534c14 Uros Bizjak 2022-08-23 448 update_state:
8038dad7e88858 Paul E. McKenney 2015-02-25 @449 if (oldstate == CPU_DEAD) {
^^^^^^^^^^^^^^^^^^^^
8038dad7e88858 Paul E. McKenney 2015-02-25 450 /* Outgoing CPU died normally, update state. */
8038dad7e88858 Paul E. McKenney 2015-02-25 451 smp_mb(); /* atomic_read() before update. */
8038dad7e88858 Paul E. McKenney 2015-02-25 452 atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_POST_DEAD);
8038dad7e88858 Paul E. McKenney 2015-02-25 453 } else {
8038dad7e88858 Paul E. McKenney 2015-02-25 454 /* Outgoing CPU still hasn't died, set state accordingly. */
2d1e07c7534c14 Uros Bizjak 2022-08-23 455 if (!atomic_try_cmpxchg(&per_cpu(cpu_hotplug_state, cpu),
2d1e07c7534c14 Uros Bizjak 2022-08-23 456 &oldstate, CPU_BROKEN))
8038dad7e88858 Paul E. McKenney 2015-02-25 457 goto update_state;
8038dad7e88858 Paul E. McKenney 2015-02-25 458 ret = false;
8038dad7e88858 Paul E. McKenney 2015-02-25 459 }
8038dad7e88858 Paul E. McKenney 2015-02-25 460 return ret;
8038dad7e88858 Paul E. McKenney 2015-02-25 461 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-08-25 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202208251909.gOzRDLgL-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox