The patch titled Subject: lib-optimize-cpumask_local_spread-v3 has been removed from the -mm tree. Its filename was lib-optimize-cpumask_local_spread-v3.patch This patch was dropped because it was folded into lib-optimize-cpumask_local_spread.patch ------------------------------------------------------ From: yuqi jin <jinyuqi@xxxxxxxxxx> Subject: lib-optimize-cpumask_local_spread-v3 change variables to static and use spinlock to protect Link: http://lkml.kernel.org/r/1573091048-10595-1-git-send-email-zhangshaokun@xxxxxxxxxxxxx Signed-off-by: yuqi jin <jinyuqi@xxxxxxxxxx> Signed-off-by: Shaokun Zhang <zhangshaokun@xxxxxxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx> Cc: Paul Burton <paul.burton@xxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Anshuman Khandual <anshuman.khandual@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/cpumask.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- a/lib/cpumask.c~lib-optimize-cpumask_local_spread-v3 +++ a/lib/cpumask.c @@ -6,6 +6,7 @@ #include <linux/export.h> #include <linux/memblock.h> #include <linux/numa.h> +#include <linux/spinlock.h> /** * cpumask_next - get the next cpu in a cpumask @@ -253,6 +254,7 @@ static unsigned int __cpumask_local_spre BUG(); } +static DEFINE_SPINLOCK(spread_lock); /** * cpumask_local_spread - select the i'th cpu with local numa cpu's first * @i: index number @@ -266,8 +268,9 @@ static unsigned int __cpumask_local_spre */ unsigned int cpumask_local_spread(unsigned int i, int node) { - int node_dist[MAX_NUMNODES] = {0}; - bool used[MAX_NUMNODES] = {0}; + static int node_dist[MAX_NUMNODES]; + static bool used[MAX_NUMNODES]; + unsigned long flags; int cpu, j, id; /* Wrap: we always want a cpu. */ @@ -281,6 +284,8 @@ unsigned int cpumask_local_spread(unsign if (nr_node_ids > MAX_NUMNODES) return __cpumask_local_spread(i, node); + spin_lock_irqsave(&spread_lock, flags); + memset(used, 0, nr_node_ids * sizeof(bool)); calc_node_distance(node_dist, node); for (j = 0; j < nr_node_ids; j++) { id = find_nearest_node(node_dist, used); @@ -289,10 +294,14 @@ unsigned int cpumask_local_spread(unsign for_each_cpu_and(cpu, cpumask_of_node(id), cpu_online_mask) - if (i-- == 0) + if (i-- == 0) { + spin_unlock_irqrestore(&spread_lock, + flags); return cpu; + } used[id] = 1; } + spin_unlock_irqrestore(&spread_lock, flags); for_each_cpu(cpu, cpu_online_mask) if (i-- == 0) _ Patches currently in -mm which might be from jinyuqi@xxxxxxxxxx are lib-optimize-cpumask_local_spread.patch