diff options
| author | Andrew Morton <akpm@linux-foundation.org> | 2015-06-18 14:01:11 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-18 23:00:23 -0400 |
| commit | 5ca62d65030d8295f54c490d2072563545dbd9d9 (patch) | |
| tree | 1066a7809df4d33cf64220a9358993d9050b4690 /lib | |
| parent | 17fda38f15953c398a2a0ae427928873c5c8c47c (diff) | |
revert "cpumask: don't perform while loop in cpumask_next_and()"
Revert commit 534b483a86e6 ("cpumask: don't perform while loop in
cpumask_next_and()").
This was a minor optimization, but it puts a `struct cpumask' on the
stack, which consumes too much stack space.
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cpumask.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c index 5f627084f2e9..5a70f6196f57 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c | |||
| @@ -16,11 +16,10 @@ | |||
| 16 | int cpumask_next_and(int n, const struct cpumask *src1p, | 16 | int cpumask_next_and(int n, const struct cpumask *src1p, |
| 17 | const struct cpumask *src2p) | 17 | const struct cpumask *src2p) |
| 18 | { | 18 | { |
| 19 | struct cpumask tmp; | 19 | while ((n = cpumask_next(n, src1p)) < nr_cpu_ids) |
| 20 | 20 | if (cpumask_test_cpu(n, src2p)) | |
| 21 | if (cpumask_and(&tmp, src1p, src2p)) | 21 | break; |
| 22 | return cpumask_next(n, &tmp); | 22 | return n; |
| 23 | return nr_cpu_ids; | ||
| 24 | } | 23 | } |
| 25 | EXPORT_SYMBOL(cpumask_next_and); | 24 | EXPORT_SYMBOL(cpumask_next_and); |
| 26 | 25 | ||
