From patchwork Sun Jan 24 08:22:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12042169 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 6FFF2C433DB for ; Sun, 24 Jan 2021 08:24:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 17ADF22838 for ; Sun, 24 Jan 2021 08:24:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17ADF22838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF32C6B0026; Sun, 24 Jan 2021 03:24:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AA3986B0027; Sun, 24 Jan 2021 03:24:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B9FA6B0028; Sun, 24 Jan 2021 03:24:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 85C646B0026 for ; Sun, 24 Jan 2021 03:24:03 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5AF4D180ACF84 for ; Sun, 24 Jan 2021 08:24:03 +0000 (UTC) X-FDA: 77739980766.24.crowd13_0a084ec2757b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 3003F1A4A0 for ; Sun, 24 Jan 2021 08:24:03 +0000 (UTC) X-HE-Tag: crowd13_0a084ec2757b X-Filterd-Recvd-Size: 5545 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Sun, 24 Jan 2021 08:24:02 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id r4so5721408pls.11 for ; Sun, 24 Jan 2021 00:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X4PdAkKAj1M/Yo1TeEkwcmE5+wLYrx2vqWkun80SjU4=; b=SFxxpwF4aZqAtiyha8DpNwD8NhP2VPk/75SmbcOcUMe8/tsdfJEhfXIo72nG1U14DU /Lfme/sKGozWIGX0E2hSH8Mi7eKm/t+eYpIlLC1+AGsIAouFEPWAWEPQ5E2m1pe4ABGR 35pNfkvvqCINxLbhZT5Hq4lI7a3fhieQBBuWzw14T0cITiJIeHWoZrFD0AVaieTifYF3 jM6UOz0iA0NrXmVRl77vIVdAkSKXjl4Bf57i/GvL3hmvpx0acyI1x74L9491tfkkkeMK zEfDoR3CJ3WHkKTAVtJmYF4vJM1atUQiY108Xs6ol5GzVxQ9tLCHsdLKFzL4raSrcER4 X60g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X4PdAkKAj1M/Yo1TeEkwcmE5+wLYrx2vqWkun80SjU4=; b=eYGqnxM82scQdznmyGJkrK+SlBeh/kXWqypn/C8STTo6/BgXd530+tvE1Ff2XdCiuV zxxfasettYD5yht4CRZ5uovWN6YLMpXVN8M9wMMXO/3C/0Zp0gAjrxF8vnuOcvZWOP0h HyoAPZnRm5L79bofN2r8C3pRZZJu0/C149Ou6CSySYMXDLISXhKBOjkS8xB4LZw5H5dh PsAQ0X+RngLKwR33b3UQ7TDEmPVp6+gD/lpYfKNcBpXHgewhBfHftiP9OBUbdEXKQdrB WTflV1t38P6DG0sfOVXXIfC67WuUmytL06VHTHfmW1UnTiIOEaj3lHel7TpS9wjP5JIs paUg== X-Gm-Message-State: AOAM532BgMOItcAxAISrVCXIhUreX4QcSaHGBxhjH855/odQHGgA/ybA My1k/4LMiH2NQjxBq97zXQZDdB/Ec38= X-Google-Smtp-Source: ABdhPJwWSI9slFc6FiGRew3Dj4/h6/vkxLw9qnQk1wa1Zw10/YWu1xYbDC+boiJwyVxb/47ASvxmaA== X-Received: by 2002:a17:902:e84e:b029:de:45bf:1296 with SMTP id t14-20020a170902e84eb02900de45bf1296mr7950370plg.49.1611476641776; Sun, 24 Jan 2021 00:24:01 -0800 (PST) Received: from bobo.ozlabs.ibm.com ([124.170.13.62]) by smtp.gmail.com with ESMTPSA id gb12sm11799757pjb.51.2021.01.24.00.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 00:24:01 -0800 (PST) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Rick Edgecombe , Ding Tianhong Subject: [PATCH v10 12/12] powerpc/64s/radix: Enable huge vmalloc mappings Date: Sun, 24 Jan 2021 18:22:30 +1000 Message-Id: <20210124082230.2118861-13-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210124082230.2118861-1-npiggin@gmail.com> References: <20210124082230.2118861-1-npiggin@gmail.com> MIME-Version: 1.0 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: Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/module.c | 13 +++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a10b545c2070..d62df53e5200 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3225,6 +3225,8 @@ nohugeiomap [KNL,X86,PPC,ARM64] Disable kernel huge I/O mappings. + nohugevmalloc [PPC] Disable kernel huge vmalloc mappings. + nosmt [KNL,S390] Disable symmetric multithreading (SMT). Equivalent to smt=1. diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 107bb4319e0e..781da6829ab7 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -181,6 +181,7 @@ config PPC select GENERIC_GETTIMEOFDAY select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_HUGE_VMAP if PPC_BOOK3S_64 && PPC_RADIX_MMU + select HAVE_ARCH_HUGE_VMALLOC if HAVE_ARCH_HUGE_VMAP select HAVE_ARCH_JUMP_LABEL select HAVE_ARCH_KASAN if PPC32 && PPC_PAGE_SHIFT <= 14 select HAVE_ARCH_KASAN_VMALLOC if PPC32 && PPC_PAGE_SHIFT <= 14 diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c index a211b0253cdb..bc2695eeeb4c 100644 --- a/arch/powerpc/kernel/module.c +++ b/arch/powerpc/kernel/module.c @@ -92,8 +92,17 @@ void *module_alloc(unsigned long size) { BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR); - return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, GFP_KERNEL, - PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, NUMA_NO_NODE, + /* + * 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_NOHUGE | VM_FLUSH_RESET_PERMS, + NUMA_NO_NODE, __builtin_return_address(0)); } #endif