Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andrew Morton and committed by
Linus Torvalds
5ca62d65 17fda38f

+4 -5
+4 -5
lib/cpumask.c
··· 16 16 int cpumask_next_and(int n, const struct cpumask *src1p, 17 17 const struct cpumask *src2p) 18 18 { 19 - struct cpumask tmp; 20 - 21 - if (cpumask_and(&tmp, src1p, src2p)) 22 - return cpumask_next(n, &tmp); 23 - return nr_cpu_ids; 19 + while ((n = cpumask_next(n, src1p)) < nr_cpu_ids) 20 + if (cpumask_test_cpu(n, src2p)) 21 + break; 22 + return n; 24 23 } 25 24 EXPORT_SYMBOL(cpumask_next_and); 26 25