Commit 3354781a authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-6ebt6x7u64pbbonq1khqu2z9@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 2739d3ee
...@@ -1493,28 +1493,28 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags, ...@@ -1493,28 +1493,28 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
tsk = ACCESS_ONCE(cpu_rq(cpu)->curr); tsk = ACCESS_ONCE(cpu_rq(cpu)->curr);
if (!cpupid_match_pid(tsk, cpupid)) if (!cpupid_match_pid(tsk, cpupid))
goto unlock; goto no_join;
grp = rcu_dereference(tsk->numa_group); grp = rcu_dereference(tsk->numa_group);
if (!grp) if (!grp)
goto unlock; goto no_join;
my_grp = p->numa_group; my_grp = p->numa_group;
if (grp == my_grp) if (grp == my_grp)
goto unlock; goto no_join;
/* /*
* Only join the other group if its bigger; if we're the bigger group, * Only join the other group if its bigger; if we're the bigger group,
* the other task will join us. * the other task will join us.
*/ */
if (my_grp->nr_tasks > grp->nr_tasks) if (my_grp->nr_tasks > grp->nr_tasks)
goto unlock; goto no_join;
/* /*
* Tie-break on the grp address. * Tie-break on the grp address.
*/ */
if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp) if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp)
goto unlock; goto no_join;
/* Always join threads in the same process. */ /* Always join threads in the same process. */
if (tsk->mm == current->mm) if (tsk->mm == current->mm)
...@@ -1528,9 +1528,8 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags, ...@@ -1528,9 +1528,8 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
*priv = !join; *priv = !join;
if (join && !get_numa_group(grp)) if (join && !get_numa_group(grp))
join = false; goto no_join;
unlock:
rcu_read_unlock(); rcu_read_unlock();
if (!join) if (!join)
...@@ -1555,6 +1554,11 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags, ...@@ -1555,6 +1554,11 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
rcu_assign_pointer(p->numa_group, grp); rcu_assign_pointer(p->numa_group, grp);
put_numa_group(my_grp); put_numa_group(my_grp);
return;
no_join:
rcu_read_unlock();
return;
} }
void task_numa_free(struct task_struct *p) void task_numa_free(struct task_struct *p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment