Commit 5ca62d65 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

revert "cpumask: don't perform while loop in cpumask_next_and()"

Revert commit 534b483a

 ("cpumask: don't perform while loop in

This was a minor optimization, but it puts a `struct cpumask' on the
stack, which consumes too much stack space.

Sergey Senozhatsky <>
Reported-by: default avatarPeter Zijlstra <>
Cc: Sergey Senozhatsky <>
Cc: Tejun Heo <>
Cc: "David S. Miller" <>
Cc: Amir Vadai <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 17fda38f
......@@ -16,11 +16,10 @@
int cpumask_next_and(int n, const struct cpumask *src1p,
const struct cpumask *src2p)
struct cpumask tmp;
if (cpumask_and(&tmp, src1p, src2p))
return cpumask_next(n, &tmp);
return nr_cpu_ids;
while ((n = cpumask_next(n, src1p)) < nr_cpu_ids)
if (cpumask_test_cpu(n, src2p))
return n;
Supports Markdown
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