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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73373C433EF for ; Tue, 28 Dec 2021 16:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235556AbhL1QPF (ORCPT ); Tue, 28 Dec 2021 11:15:05 -0500 Received: from mga11.intel.com ([192.55.52.93]:11155 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235159AbhL1QPE (ORCPT ); Tue, 28 Dec 2021 11:15:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640708104; x=1672244104; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=vD34BvYBr7K6ySutnohM2Grn1RkmZJLe6AIv33TdiOM=; b=liHHCqAYlgTFFzT6Mv32bNaTHNC9x5vifpR41g1hZMM3Rq55IkE3FJv4 XQzhpabAjktmAlabez+/CnsbFMx8e5CFMX2U9ioaXbUun1K7t3vL7S149 qtN0bpmr8BXRbeCuXFjfl7tvH8b676xqi9N/E/Eik8cv+YeBGuZyHAWFX +I8WEsAjpKwUGyP51Zh+uy3RGnXrPw65FOgOpgot+afitw76DUSxmyrCz j4i2pmaOXtWbctX7iP0F4uNYZyZjNHBCqIjFpGvdqE/VnfvCUbY+PoyW5 svzCWUVF/92l0exF5+ww2DzCbksOfGAQP8ENbt2dbwiIwuKW2fRsW4D7I g==; X-IronPort-AV: E=McAfee;i="6200,9189,10210"; a="238931395" X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="238931395" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 08:15:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="470066185" Received: from jseaman-mobl.amr.corp.intel.com (HELO [10.252.133.172]) ([10.252.133.172]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 08:15:01 -0800 Subject: Re: [PATCH v2 3/3] x86: Support huge vmalloc mappings To: Kefeng Wang , Jonathan Corbet , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org Cc: Nicholas Piggin , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , 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> From: Dave Hansen Message-ID: <31a75f95-6e6e-b640-2d95-08a95ea8cf51@intel.com> Date: Tue, 28 Dec 2021 08:14:56 -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: <3858de1f-cdbc-ff52-2890-4254d0f48b0a@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 12/28/21 2:26 AM, Kefeng Wang wrote: >>> There are some disadvantages about this feature[2], one of the main >>> concerns is the possible memory fragmentation/waste in some scenarios, >>> also archs must ensure that any arch specific vmalloc allocations that >>> require PAGE_SIZE mappings(eg, module alloc with STRICT_MODULE_RWX) >>> use the VM_NO_HUGE_VMAP flag to inhibit larger mappings. >> That just says that x86 *needs* PAGE_SIZE allocations.  But, what >> happens if VM_NO_HUGE_VMAP is not passed (like it was in v1)?  Will the >> subsequent permission changes just fragment the 2M mapping? > > Yes, without VM_NO_HUGE_VMAP, it could fragment the 2M mapping. > > When module alloc with STRICT_MODULE_RWX on x86, it calls > __change_page_attr() > > from set_memory_ro/rw/nx which will split large page, so there is no > need to make > > module alloc with HUGE_VMALLOC. 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. They next guy is going to forget, just like you did. Considering that this is not a hot path, a weak function would be a nice choice: /* vmalloc() flags used for all module allocations. */ unsigned long __weak arch_module_vm_flags() { /* * Modules use a single, large vmalloc(). Different * permissions are applied later and will fragment * huge mappings. Avoid using huge pages for modules. */ return VM_NO_HUGE_VMAP; } Stick that in some the common module code, next to: > void * __weak module_alloc(unsigned long size) > { > return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END, ... Then, put arch_module_vm_flags() in *all* of the module_alloc() implementations, including the generic one. That way (even with a new architecture) whoever copies-and-pastes their module_alloc() implementation is likely to get it right. The next guy who just does a "select HAVE_ARCH_HUGE_VMALLOC" will hopefully just work. VM_FLUSH_RESET_PERMS could probably be dealt with in the same way. 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BA8BC433EF for ; Tue, 28 Dec 2021 16:16:56 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JNfn22KN4z3bP4 for ; Wed, 29 Dec 2021 03:16:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=PiVEc1Gq; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=intel.com (client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=dave.hansen@intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=PiVEc1Gq; dkim-atps=neutral Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JNfmF0l37z2ywZ for ; Wed, 29 Dec 2021 03:16:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640708173; x=1672244173; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=vD34BvYBr7K6ySutnohM2Grn1RkmZJLe6AIv33TdiOM=; b=PiVEc1Gqg4WgEl/j218KJV/GFMXRG6xkQ3Dd7gAvFKMnKPDHYSW+JvB1 XKBinA58d3uffLrBenV3jkoUreq/rzRIdKa4TUTAtLbrR7fjwcjmfMoRC UPkeF/mo6FVwoIXshoNci17nx0IIYADgdxie8Vq7iXHL7IU381P38cunl pzGFRi/T5jcS8c+Yl3qUYnfTpGlbZXpISgZvhrz01lxjuaIs72nMWBQsM cjHH86KpW8KtuqplUJ5vQnF/ygHhPE+efU0frG5PMC0lMEvYvUsvO/IaJ L/V2e+ZiaXfVIzobXGcZbYYElYgwAVBAP7tLWShYYP+EAivUbidmfwNAW Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10210"; a="238931397" X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="238931397" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 08:15:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="470066185" Received: from jseaman-mobl.amr.corp.intel.com (HELO [10.252.133.172]) ([10.252.133.172]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 08:15:01 -0800 Subject: Re: [PATCH v2 3/3] x86: Support huge vmalloc mappings To: Kefeng Wang , Jonathan Corbet , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org 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> From: Dave Hansen Message-ID: <31a75f95-6e6e-b640-2d95-08a95ea8cf51@intel.com> Date: Tue, 28 Dec 2021 08:14:56 -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: <3858de1f-cdbc-ff52-2890-4254d0f48b0a@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthew Wilcox , Catalin Marinas , Dave Hansen , Nicholas Piggin , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Paul Mackerras , Thomas Gleixner , Will Deacon Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 12/28/21 2:26 AM, Kefeng Wang wrote: >>> There are some disadvantages about this feature[2], one of the main >>> concerns is the possible memory fragmentation/waste in some scenarios, >>> also archs must ensure that any arch specific vmalloc allocations that >>> require PAGE_SIZE mappings(eg, module alloc with STRICT_MODULE_RWX) >>> use the VM_NO_HUGE_VMAP flag to inhibit larger mappings. >> That just says that x86 *needs* PAGE_SIZE allocations.  But, what >> happens if VM_NO_HUGE_VMAP is not passed (like it was in v1)?  Will the >> subsequent permission changes just fragment the 2M mapping? > > Yes, without VM_NO_HUGE_VMAP, it could fragment the 2M mapping. > > When module alloc with STRICT_MODULE_RWX on x86, it calls > __change_page_attr() > > from set_memory_ro/rw/nx which will split large page, so there is no > need to make > > module alloc with HUGE_VMALLOC. 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. They next guy is going to forget, just like you did. Considering that this is not a hot path, a weak function would be a nice choice: /* vmalloc() flags used for all module allocations. */ unsigned long __weak arch_module_vm_flags() { /* * Modules use a single, large vmalloc(). Different * permissions are applied later and will fragment * huge mappings. Avoid using huge pages for modules. */ return VM_NO_HUGE_VMAP; } Stick that in some the common module code, next to: > void * __weak module_alloc(unsigned long size) > { > return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END, ... Then, put arch_module_vm_flags() in *all* of the module_alloc() implementations, including the generic one. That way (even with a new architecture) whoever copies-and-pastes their module_alloc() implementation is likely to get it right. The next guy who just does a "select HAVE_ARCH_HUGE_VMALLOC" will hopefully just work. VM_FLUSH_RESET_PERMS could probably be dealt with in the same way. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 365A3C433EF for ; Tue, 28 Dec 2021 16:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DoYMGSehF9cs1xyNrmt1zRyPgG72YdkY606J0Qq2mII=; b=4/8Zp3aWdD4IfQgOsVWpV2nWMe EZ5Wk5hb2Zml3uzK+y7nn8F9DOFVVslcfqC94f4BaqgIWWeW/+10lT0UCv3eirLdcKTC3qZJTuvYu C1SarpIFG0T/K3rRjwK91vfRc3mj0T+JVB3c2DnxMDxJ0iC0ec0RyLPbBRTDI2qIMYg2bdvqsKfoI SW4M6q6RsSjHfOaadcim9UHprofhAG+t7bWmEjWpX/bGvxOX/Xr20e2qC5PuPKTrQMppmKCXO2WuG RU49tmdDrTTvyVjHyGFN9XErebZNcnhy8QgtUTPXNp2Jf+Qp+OS49wF9yt/vX/A4TCFe08VoVmndU OVuN4xdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2F84-001V9C-Qr; Tue, 28 Dec 2021 16:15:12 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2F81-001V7A-Bq for linux-arm-kernel@lists.infradead.org; Tue, 28 Dec 2021 16:15:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640708109; x=1672244109; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=vD34BvYBr7K6ySutnohM2Grn1RkmZJLe6AIv33TdiOM=; b=IEi2qzZSR5ysfrCQCF3evkpscSJDoejUs1xr7wiTkj5I1kfXga8EFXOR WeAIFxVXsvMOKdlkdsTuVe8rRfLu3DDrj6/EgdQtpteD5omM7J9dWvyj6 Wege4afJaP4qrf2x4aaZMaJDhgpha8mf67liKknyVLu+dxYCJh7GTMzZj xyY+21r8noYIZgnu+z0Tb++MsL2i3X1xGtKRC3T3IctHTNx4hq7zwwJfd tyLHBMMacAyjMCtI8R7p9pHccA23lmLxm7RTrHQBLmg3V7wggmrv4l4BA cwcNxgIcAcdy3jFn0DK+rpsMsJW1yb/Yq72/G2+agswgYv9AE7r1u6jIL Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10210"; a="240169319" X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="240169319" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 08:15:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="470066185" Received: from jseaman-mobl.amr.corp.intel.com (HELO [10.252.133.172]) ([10.252.133.172]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 08:15:01 -0800 Subject: Re: [PATCH v2 3/3] x86: Support huge vmalloc mappings To: Kefeng Wang , Jonathan Corbet , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org Cc: Nicholas Piggin , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , 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> From: Dave Hansen Message-ID: <31a75f95-6e6e-b640-2d95-08a95ea8cf51@intel.com> Date: Tue, 28 Dec 2021 08:14:56 -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: <3858de1f-cdbc-ff52-2890-4254d0f48b0a@huawei.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_081509_451582_15798AAB X-CRM114-Status: GOOD ( 17.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org T24gMTIvMjgvMjEgMjoyNiBBTSwgS2VmZW5nIFdhbmcgd3JvdGU6Cj4+PiBUaGVyZSBhcmUgc29t ZSBkaXNhZHZhbnRhZ2VzIGFib3V0IHRoaXMgZmVhdHVyZVsyXSwgb25lIG9mIHRoZSBtYWluCj4+ PiBjb25jZXJucyBpcyB0aGUgcG9zc2libGUgbWVtb3J5IGZyYWdtZW50YXRpb24vd2FzdGUgaW4g c29tZSBzY2VuYXJpb3MsCj4+PiBhbHNvIGFyY2hzIG11c3QgZW5zdXJlIHRoYXQgYW55IGFyY2gg c3BlY2lmaWMgdm1hbGxvYyBhbGxvY2F0aW9ucyB0aGF0Cj4+PiByZXF1aXJlIFBBR0VfU0laRSBt YXBwaW5ncyhlZywgbW9kdWxlIGFsbG9jIHdpdGggU1RSSUNUX01PRFVMRV9SV1gpCj4+PiB1c2Ug dG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