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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E0E9C433F5 for ; Tue, 18 Jan 2022 17:28:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02EF66B0072; Tue, 18 Jan 2022 12:28:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F21BD6B0073; Tue, 18 Jan 2022 12:28:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC1C26B0074; Tue, 18 Jan 2022 12:28:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay036.a.hostedemail.com [64.99.140.36]) by kanga.kvack.org (Postfix) with ESMTP id CA4DB6B0072 for ; Tue, 18 Jan 2022 12:28:53 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8BC22204B8 for ; Tue, 18 Jan 2022 17:28:53 +0000 (UTC) X-FDA: 79044092946.01.B953669 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf15.hostedemail.com (Postfix) with ESMTP id 2729DA000A for ; Tue, 18 Jan 2022 17:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642526932; x=1674062932; h=to:cc:references:from:subject:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=k4eJH2zoU91Kl9uf4FCGcvt/8O88IEchGIaQVuOy/n8=; b=ARVoxMk1BNi7Ibh/0lnT62hIAPHirKNPtCK4aYGgpwFLrsyJYU8JpNfx gSftHGErrOYQSzPNbCbxdsTE1na5WQRm2DL1jj2BYP0/xy9CsdPLKOAKw 9/Zbeeua6//WAAt0h2Ve1Fwf/sOK2OPAJwm8gone+LLyHSYh3UXQdpQG/ tKYOPmQm7CpeLWRdJ6E6rVzXCfrpEfYkJhUZ7QpsFnOvBmnBfJfFs5tP+ Z13gTG3LzGPlOChqSveoBazOEZjOxZ5lflhyDS5WwvpZYviQr6lS4Qefd mqtUT7I3jd0TMK9pvWGF8xbHJ4H6DVOOoHsWUmtbiI3ihziRt2b9NjmmP Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10230"; a="244827592" X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="244827592" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 09:28:49 -0800 X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="764657295" Received: from ssrikan2-mobl2.amr.corp.intel.com (HELO [10.209.52.128]) ([10.209.52.128]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 09:28:47 -0800 To: Nicholas Piggin , Andrew Morton , Jonathan Corbet , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Kefeng Wang , x86@kernel.org Cc: Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Michael Ellerman , Paul Mackerras , Thomas Gleixner , Will Deacon , Matthew Wilcox References: <20211227145903.187152-1-wangkefeng.wang@huawei.com> <20211227145903.187152-4-wangkefeng.wang@huawei.com> <70ff58bc-3a92-55c2-2da8-c5877af72e44@intel.com> <3858de1f-cdbc-ff52-2890-4254d0f48b0a@huawei.com> <31a75f95-6e6e-b640-2d95-08a95ea8cf51@intel.com> <1642472965.lgfksp6krp.astroid@bobo.none> From: Dave Hansen Subject: Re: [PATCH v2 3/3] x86: Support huge vmalloc mappings Message-ID: <4488d39f-0698-7bfd-b81c-1e609821818f@intel.com> Date: Tue, 18 Jan 2022 09:28:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <1642472965.lgfksp6krp.astroid@bobo.none> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 2729DA000A X-Stat-Signature: dk9o9qa3hpb3qs53bwbd77ra39z871a6 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ARVoxMk1; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf15.hostedemail.com: domain of dave.hansen@intel.com has no SPF policy when checking 134.134.136.65) smtp.mailfrom=dave.hansen@intel.com X-HE-Tag: 1642526931-760452 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: On 1/17/22 6:46 PM, Nicholas Piggin wrote: >> This all sounds very fragile to me. Every time a new architecture would >> get added for huge vmalloc() support, the developer needs to know to go >> find that architecture's module_alloc() and add this flag. > This is documented in the Kconfig. > > # > # Archs that select this would be capable of PMD-sized vmaps (i.e., > # arch_vmap_pmd_supported() returns true), and they must make no assumptions > # that vmalloc memory is mapped with PAGE_SIZE ptes. The VM_NO_HUGE_VMAP flag > # can be used to prohibit arch-specific allocations from using hugepages to > # help with this (e.g., modules may require it). > # > config HAVE_ARCH_HUGE_VMALLOC > depends on HAVE_ARCH_HUGE_VMAP > bool > > Is it really fair to say it's *very* fragile? Surely it's reasonable to > read the (not very long) documentation ad understand the consequences for > the arch code before enabling it. Very fragile or not, I think folks are likely to get it wrong. It would be nice to have it default *everyone* to safe and slow and make *sure* they go look at the architecture modules code itself before enabling this for modules. Just from that Kconfig text, I don't think I'd know off the top of my head what do do for x86, or what code I needed to go touch.