[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a5c57276-737d-930b-670c-58dc0c815501@csgroup.eu>
Date: Thu, 15 Apr 2021 12:23:55 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Nicholas Piggin <npiggin@...il.com>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Christoph Hellwig <hch@...radead.org>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Ding Tianhong <dingtianhong@...wei.com>,
linuxppc-dev@...ts.ozlabs.org,
Michael Ellerman <mpe@...erman.id.au>,
Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH v13 14/14] powerpc/64s/radix: Enable huge vmalloc mappings
Hi Nick,
Le 17/03/2021 à 07:24, Nicholas Piggin a écrit :
> This reduces TLB misses by nearly 30x on a `git diff` workload on a
> 2-node POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%, due
> to vfs hashes being allocated with 2MB pages.
>
> Cc: linuxppc-dev@...ts.ozlabs.org
> Acked-by: Michael Ellerman <mpe@...erman.id.au>
> Signed-off-by: Nicholas Piggin <npiggin@...il.com>
> ---
> .../admin-guide/kernel-parameters.txt | 2 ++
> arch/powerpc/Kconfig | 1 +
> arch/powerpc/kernel/module.c | 22 +++++++++++++++----
> 3 files changed, 21 insertions(+), 4 deletions(-)
>
> --- a/arch/powerpc/kernel/module.c
> +++ b/arch/powerpc/kernel/module.c
> @@ -8,6 +8,7 @@
> #include <linux/moduleloader.h>
> #include <linux/err.h>
> #include <linux/vmalloc.h>
> +#include <linux/mm.h>
> #include <linux/bug.h>
> #include <asm/module.h>
> #include <linux/uaccess.h>
> @@ -87,13 +88,26 @@ int module_finalize(const Elf_Ehdr *hdr,
> return 0;
> }
>
> -#ifdef MODULES_VADDR
> void *module_alloc(unsigned long size)
> {
> + unsigned long start = VMALLOC_START;
> + unsigned long end = VMALLOC_END;
> +
> +#ifdef MODULES_VADDR
> BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
> + start = MODULES_VADDR;
> + end = MODULES_END;
> +#endif
> +
> + /*
> + * Don't do huge page allocations for modules yet until more testing
> + * is done. STRICT_MODULE_RWX may require extra work to support this
> + * too.
> + */
>
> - return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, GFP_KERNEL,
> - PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, NUMA_NO_NODE,
I think you should add the following in <asm/pgtable.h>
#ifndef MODULES_VADDR
#define MODULES_VADDR VMALLOC_START
#define MODULES_END VMALLOC_END
#endif
And leave module_alloc() as is (just removing the enclosing #ifdef MODULES_VADDR and adding the
VM_NO_HUGE_VMAP flag)
This would minimise the conflits with the changes I did in powerpc/next reported by Stephen R.
> + return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
> + PAGE_KERNEL_EXEC,
> + VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE,
> __builtin_return_address(0));
> }
> -#endif
>
Powered by blists - more mailing lists