Commit 72d09633 authored by Eric Dumazet's avatar Eric Dumazet Committed by Linus Torvalds

mm/zswap: NUMA aware allocation for zswap_dstmem

zswap_dstmem is a percpu block of memory, which should be allocated using
kmalloc_node(), to get better NUMA locality.

Without it, all the blocks are allocated from a single node.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarSeth Jennings <sjennings@variantweb.net>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d867f203
...@@ -347,7 +347,7 @@ static int __zswap_cpu_notifier(unsigned long action, unsigned long cpu) ...@@ -347,7 +347,7 @@ static int __zswap_cpu_notifier(unsigned long action, unsigned long cpu)
return NOTIFY_BAD; return NOTIFY_BAD;
} }
*per_cpu_ptr(zswap_comp_pcpu_tfms, cpu) = tfm; *per_cpu_ptr(zswap_comp_pcpu_tfms, cpu) = tfm;
dst = kmalloc(PAGE_SIZE * 2, GFP_KERNEL); dst = kmalloc_node(PAGE_SIZE * 2, GFP_KERNEL, cpu_to_node(cpu));
if (!dst) { if (!dst) {
pr_err("can't allocate compressor buffer\n"); pr_err("can't allocate compressor buffer\n");
crypto_free_comp(tfm); crypto_free_comp(tfm);
......
Markdown is supported
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