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

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: Eric Dumazet <edumazet@google.com>
Acked-by: Seth Jennings <sjennings@variantweb.net>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Eric Dumazet and committed by
Linus Torvalds
72d09633 d867f203

+1 -1
+1 -1
mm/zswap.c
··· 347 347 return NOTIFY_BAD; 348 348 } 349 349 *per_cpu_ptr(zswap_comp_pcpu_tfms, cpu) = tfm; 350 - dst = kmalloc(PAGE_SIZE * 2, GFP_KERNEL); 350 + dst = kmalloc_node(PAGE_SIZE * 2, GFP_KERNEL, cpu_to_node(cpu)); 351 351 if (!dst) { 352 352 pr_err("can't allocate compressor buffer\n"); 353 353 crypto_free_comp(tfm);