From: Eric Dumazet Date: Wed, 4 Jun 2014 23:11:11 +0000 (-0700) Subject: mm/zswap: NUMA aware allocation for zswap_dstmem X-Git-Tag: v3.16-rc1~47^2~16^2~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72d09633c9afa02bea317d65eb8b8a4ce7659a2a;p=platform%2Fkernel%2Flinux-exynos.git 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 Acked-by: Seth Jennings Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/zswap.c b/mm/zswap.c index aeaef0f..008388fe 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -347,7 +347,7 @@ static int __zswap_cpu_notifier(unsigned long action, unsigned long cpu) return NOTIFY_BAD; } *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) { pr_err("can't allocate compressor buffer\n"); crypto_free_comp(tfm);