Skip to content

Commit 72d0963

Browse files
edumazettorvalds
authored andcommitted
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>
1 parent d867f20 commit 72d0963

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎mm/zswap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static int __zswap_cpu_notifier(unsigned long action, unsigned long cpu)
347347
return NOTIFY_BAD;
348348
}
349349
*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));
351351
if (!dst) {
352352
pr_err("can't allocate compressor buffer\n");
353353
crypto_free_comp(tfm);

0 commit comments

Comments
 (0)