diff options
author | Peter Zijlstra <peterz@infradead.org> | 2013-10-09 04:24:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-09 08:48:27 -0400 |
commit | 3354781a2184380046c8dd19144628d3c33991e6 (patch) | |
tree | 013a9f5584e5e4518374db44a20385ca062fb985 | |
parent | 2739d3eef3a93a92c366a3a0bb85a0afe09e8b8c (diff) |
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>
-rw-r--r-- | kernel/sched/fair.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e9149305c5fa..803e343d7c89 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, | |||
1493 | tsk = ACCESS_ONCE(cpu_rq(cpu)->curr); | 1493 | tsk = ACCESS_ONCE(cpu_rq(cpu)->curr); |
1494 | 1494 | ||
1495 | if (!cpupid_match_pid(tsk, cpupid)) | 1495 | if (!cpupid_match_pid(tsk, cpupid)) |
1496 | goto unlock; | 1496 | goto no_join; |
1497 | 1497 | ||
1498 | grp = rcu_dereference(tsk->numa_group); | 1498 | grp = rcu_dereference(tsk->numa_group); |
1499 | if (!grp) | 1499 | if (!grp) |
1500 | goto unlock; | 1500 | goto no_join; |
1501 | 1501 | ||
1502 | my_grp = p->numa_group; | 1502 | my_grp = p->numa_group; |
1503 | if (grp == my_grp) | 1503 | if (grp == my_grp) |
1504 | goto unlock; | 1504 | goto no_join; |
1505 | 1505 | ||
1506 | /* | 1506 | /* |
1507 | * Only join the other group if its bigger; if we're the bigger group, | 1507 | * Only join the other group if its bigger; if we're the bigger group, |
1508 | * the other task will join us. | 1508 | * the other task will join us. |
1509 | */ | 1509 | */ |
1510 | if (my_grp->nr_tasks > grp->nr_tasks) | 1510 | if (my_grp->nr_tasks > grp->nr_tasks) |
1511 | goto unlock; | 1511 | goto no_join; |
1512 | 1512 | ||
1513 | /* | 1513 | /* |
1514 | * Tie-break on the grp address. | 1514 | * Tie-break on the grp address. |
1515 | */ | 1515 | */ |
1516 | if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp) | 1516 | if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp) |
1517 | goto unlock; | 1517 | goto no_join; |
1518 | 1518 | ||
1519 | /* Always join threads in the same process. */ | 1519 | /* Always join threads in the same process. */ |
1520 | if (tsk->mm == current->mm) | 1520 | if (tsk->mm == current->mm) |
@@ -1528,9 +1528,8 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags, | |||
1528 | *priv = !join; | 1528 | *priv = !join; |
1529 | 1529 | ||
1530 | if (join && !get_numa_group(grp)) | 1530 | if (join && !get_numa_group(grp)) |
1531 | join = false; | 1531 | goto no_join; |
1532 | 1532 | ||
1533 | unlock: | ||
1534 | rcu_read_unlock(); | 1533 | rcu_read_unlock(); |
1535 | 1534 | ||
1536 | if (!join) | 1535 | if (!join) |
@@ -1555,6 +1554,11 @@ unlock: | |||
1555 | rcu_assign_pointer(p->numa_group, grp); | 1554 | rcu_assign_pointer(p->numa_group, grp); |
1556 | 1555 | ||
1557 | put_numa_group(my_grp); | 1556 | put_numa_group(my_grp); |
1557 | return; | ||
1558 | |||
1559 | no_join: | ||
1560 | rcu_read_unlock(); | ||
1561 | return; | ||
1558 | } | 1562 | } |
1559 | 1563 | ||
1560 | void task_numa_free(struct task_struct *p) | 1564 | void task_numa_free(struct task_struct *p) |