From: kbuild test robot <lkp@intel.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: kernel/sched/psi.c:639:13: warning: 'rq' may be used uninitialized in this function
Date: Mon, 5 Nov 2018 13:30:05 +0800 [thread overview]
Message-ID: <201811051301.SWunPgSu%fengguang.wu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2599 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 651022382c7f8da46cb4872a545ee1da6d097d2a
commit: 2ce7135adc9ad081aa3c49744144376ac74fea60 psi: cgroup support
date: 9 days ago
config: x86_64-randconfig-s1-11051307 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
git checkout 2ce7135adc9ad081aa3c49744144376ac74fea60
# save the attached .config to linux build tree
make ARCH=x86_64
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
kernel/sched/psi.c: In function 'cgroup_move_task':
>> kernel/sched/psi.c:639:13: warning: 'rq' may be used uninitialized in this function [-Wmaybe-uninitialized]
struct rq *rq;
^~
vim +/rq +639 kernel/sched/psi.c
621
622 /**
623 * cgroup_move_task - move task to a different cgroup
624 * @task: the task
625 * @to: the target css_set
626 *
627 * Move task to a new cgroup and safely migrate its associated stall
628 * state between the different groups.
629 *
630 * This function acquires the task's rq lock to lock out concurrent
631 * changes to the task's scheduling state and - in case the task is
632 * running - concurrent changes to its stall state.
633 */
634 void cgroup_move_task(struct task_struct *task, struct css_set *to)
635 {
636 bool move_psi = !psi_disabled;
637 unsigned int task_flags = 0;
638 struct rq_flags rf;
> 639 struct rq *rq;
640
641 if (move_psi) {
642 rq = task_rq_lock(task, &rf);
643
644 if (task_on_rq_queued(task))
645 task_flags = TSK_RUNNING;
646 else if (task->in_iowait)
647 task_flags = TSK_IOWAIT;
648
649 if (task->flags & PF_MEMSTALL)
650 task_flags |= TSK_MEMSTALL;
651
652 if (task_flags)
653 psi_task_change(task, task_flags, 0);
654 }
655
656 /*
657 * Lame to do this here, but the scheduler cannot be locked
658 * from the outside, so we move cgroups from inside sched/.
659 */
660 rcu_assign_pointer(task->cgroups, to);
661
662 if (move_psi) {
663 if (task_flags)
664 psi_task_change(task, 0, task_flags);
665
666 task_rq_unlock(rq, task, &rf);
667 }
668 }
669 #endif /* CONFIG_CGROUPS */
670
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28449 bytes --]
reply other threads:[~2018-11-05 5:30 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=201811051301.SWunPgSu%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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;
as well as URLs for NNTP newsgroup(s).