From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0BC3C433B4 for ; Thu, 15 Apr 2021 10:24:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B4C561132 for ; Thu, 15 Apr 2021 10:24:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B4C561132 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B6266B0036; Thu, 15 Apr 2021 06:24:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0664A6B006C; Thu, 15 Apr 2021 06:24:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E48BA6B0070; Thu, 15 Apr 2021 06:24:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0209.hostedemail.com [216.40.44.209]) by kanga.kvack.org (Postfix) with ESMTP id C9FB36B0036 for ; Thu, 15 Apr 2021 06:24:00 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 85F9A1801B608 for ; Thu, 15 Apr 2021 10:24:00 +0000 (UTC) X-FDA: 78034215840.02.F463EEA Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf14.hostedemail.com (Postfix) with ESMTP id 76620C0001EE for ; Thu, 15 Apr 2021 10:23:51 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FLb6P11KFz9vBmb; Thu, 15 Apr 2021 12:23:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id UXyUUAwc-f7L; Thu, 15 Apr 2021 12:23:57 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FLb6P0B0nz9vBK7; Thu, 15 Apr 2021 12:23:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1299A8B7F6; Thu, 15 Apr 2021 12:23:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id wlkDENXExdjy; Thu, 15 Apr 2021 12:23:58 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 46D9D8B7F2; Thu, 15 Apr 2021 12:23:57 +0200 (CEST) Subject: Re: [PATCH v13 14/14] powerpc/64s/radix: Enable huge vmalloc mappings To: Nicholas Piggin , linux-mm@kvack.org, Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Jonathan Cameron , Christoph Hellwig , Rick Edgecombe , Ding Tianhong , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Stephen Rothwell References: <20210317062402.533919-1-npiggin@gmail.com> <20210317062402.533919-15-npiggin@gmail.com> From: Christophe Leroy Message-ID: Date: Thu, 15 Apr 2021 12:23:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210317062402.533919-15-npiggin@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 76620C0001EE X-Stat-Signature: z6yote1ehq73q6396u7hsuh97oom64a4 Received-SPF: none (csgroup.eu>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=pegase1.c-s.fr; client-ip=93.17.236.30 X-HE-DKIM-Result: none/none X-HE-Tag: 1618482231-390877 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Nick, Le 17/03/2021 =C3=A0 07:24, Nicholas Piggin a =C3=A9crit=C2=A0: > 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. >=20 > Cc: linuxppc-dev@lists.ozlabs.org > Acked-by: Michael Ellerman > Signed-off-by: Nicholas Piggin > --- > .../admin-guide/kernel-parameters.txt | 2 ++ > arch/powerpc/Kconfig | 1 + > arch/powerpc/kernel/module.c | 22 +++++++++++++++---= - > 3 files changed, 21 insertions(+), 4 deletions(-) >=20 > --- a/arch/powerpc/kernel/module.c > +++ b/arch/powerpc/kernel/module.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -87,13 +88,26 @@ int module_finalize(const Elf_Ehdr *hdr, > return 0; > } > =20 > -#ifdef MODULES_VADDR > void *module_alloc(unsigned long size) > { > + unsigned long start =3D VMALLOC_START; > + unsigned long end =3D VMALLOC_END; > + > +#ifdef MODULES_VADDR > BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR); > + start =3D MODULES_VADDR; > + end =3D 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. > + */ > =20 > - 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 #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 MODULE= S_VADDR and adding the=20 VM_NO_HUGE_VMAP flag) This would minimise the conflits with the changes I did in powerpc/next r= eported 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 >=20