From: tip-bot for Peter Zijlstra <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, tglx@linutronix.de
Subject: [tip:sched/core] sched/numa: Reflow task_numa_group() to avoid a compiler warning
Date: Wed, 9 Oct 2013 10:34:32 -0700 [thread overview]
Message-ID: <tip-6ebt6x7u64pbbonq1khqu2z9@git.kernel.org> (raw)
Commit-ID: 3354781a2184380046c8dd19144628d3c33991e6
Gitweb: http://git.kernel.org/tip/3354781a2184380046c8dd19144628d3c33991e6
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Wed, 9 Oct 2013 10:24:48 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 9 Oct 2013 14:48:27 +0200
sched/numa: Reflow task_numa_group() to avoid a compiler warning
Reflow the function a bit because GCC gets confused:
kernel/sched/fair.c: In function ‘task_numa_fault’:
kernel/sched/fair.c:1448:3: warning: ‘my_grp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
kernel/sched/fair.c:1463:27: note: ‘my_grp’ was declared here
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-6ebt6x7u64pbbonq1khqu2z9@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e914930..803e343 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1493,28 +1493,28 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
tsk = ACCESS_ONCE(cpu_rq(cpu)->curr);
if (!cpupid_match_pid(tsk, cpupid))
- goto unlock;
+ goto no_join;
grp = rcu_dereference(tsk->numa_group);
if (!grp)
- goto unlock;
+ goto no_join;
my_grp = p->numa_group;
if (grp == my_grp)
- goto unlock;
+ goto no_join;
/*
* Only join the other group if its bigger; if we're the bigger group,
* the other task will join us.
*/
if (my_grp->nr_tasks > grp->nr_tasks)
- goto unlock;
+ goto no_join;
/*
* Tie-break on the grp address.
*/
if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp)
- goto unlock;
+ goto no_join;
/* Always join threads in the same process. */
if (tsk->mm == current->mm)
@@ -1528,9 +1528,8 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
*priv = !join;
if (join && !get_numa_group(grp))
- join = false;
+ goto no_join;
-unlock:
rcu_read_unlock();
if (!join)
@@ -1555,6 +1554,11 @@ unlock:
rcu_assign_pointer(p->numa_group, grp);
put_numa_group(my_grp);
+ return;
+
+no_join:
+ rcu_read_unlock();
+ return;
}
void task_numa_free(struct task_struct *p)
reply other threads:[~2013-10-09 17:35 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=tip-6ebt6x7u64pbbonq1khqu2z9@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome