From patchwork Tue May 18 12:15:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12264709 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 BFE7AC433ED for ; Tue, 18 May 2021 12:17:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CFE261028 for ; Tue, 18 May 2021 12:17:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CFE261028 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc:To:From: References:In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CocMp6vopOZalzSehq3ANHJNchS4kHpIutPzIpUqYCw=; b=gE60TD3KiEGYj9NmheE8jePuE Be+reXcBrj1aPfpEH2oSnOsmIHSh3CUaX7taY8VYqG0CIynjRIsXnrvS1vfldiERFsP3poTp4JYRw 54VSH9QUlKI/h6onKMNOFkYoWCASAL18wUKSLEayr58rXt4SbIJAM2p7dXhDaO4tuKmQwbvi4auED gEvAPDvmflcQ9ZM1yVo7y9zgwFCDOtcZLBWSV/bJNUHwXSf/coAw0eWhpoPOCvdWHJ4i4bQHUdvkV xnOtZNtd8mdWICqpmEUWYrnX8yctYpg7aTI/axLjp62KZdyyY8yZywvQZIyX9/2FMV0vP3s803QcT eVgfQMWcw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liydc-000j0f-0d; Tue, 18 May 2021 12:15:52 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydZ-000j0C-PT for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 12:15:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description; bh=EVyVWL3Bw3em1SB7guIWDG8Dh2TRp8K8vFAoLmQuXg0=; b=wsJVxXym5GLWxLZniaf8JDA4Qq +3HM3bSXU/B9DPACmTNm/JIqjEBc1aFNiWJRnEJGldjp4y7GTUfSR+kqCU3gfoJejbHq84rzxeXgU 6CyjW/r+MTElKKHrKhcr5w77Q1WHSfadWomHT7Qa/oIBu2F5KVN5Rqhav9TSnDIa/mvq+TeiCbkFp aZzuGwmJSh0SfMtKI1GxcMjv4pwK7bIH0sxaFr5yCToou+4HmUKSpqBSa1OsAEYUv5bFblZcAKJMs pUYqXmDnaQM/EfW7LzjG9/jfqQZkUndB8p3yPE1XCa/ZiLcD0W7mUGkm7oIWszP6z0f+f3rxronlD jqcWtG8w==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydX-00Edms-Al for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 12:15:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EVyVWL3Bw3em1SB7guIWDG8Dh2TRp8K8vFAoLmQuXg0=; b=dK1razk150t4Tfj9gcVwpAGT5B AhGa2Peh9q7nPF9Z8/VTi/wqCEACgq7gerlbNloPcsbVqJemGywd5klfOMz8jwi/QuANCChnGD+Et 8yEYkc0SPRURXT0dCSqbBFKtHqp0mrP0ujlIB7Izx6ey8ZDH+EF36xuDq6v2Suc1dkSWL79Vy8V/r 2bzipjqOo+oHFCMuaO7mNNq8DVlhfhecerI4+7lcFaonA8rWIIqBVUDssssOgQzwH2sxeSG9tulCm aaT2PMROkDNkxT2Uj8VTZH37APoa47Yox3tFOnD4PmYWJPSMU6gep9dM4nP42U6wq/cT2eJTKR1fX ehUyzWBw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55062 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liydQ-0004GM-Jo; Tue, 18 May 2021 13:15:40 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1liydQ-0004Po-2c; Tue, 18 May 2021 13:15:40 +0100 In-Reply-To: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518120633.GW12395@shell.armlinux.org.uk> From: "Russell King (Oracle)" To: Yanfei Xu Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, carver4lio@163.com, tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] ARM: change vmalloc_min to be unsigned long MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 18 May 2021 13:15:40 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_051547_396679_0CBEF1E0 X-CRM114-Status: GOOD ( 12.20 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org vmalloc_min is currently a void pointer, but everywhere its used contains a cast - either to a void pointer when setting or back to an integer type when being used. Eliminate these casts by changing its type to unsigned long. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij --- arch/arm/mm/mmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index c06ebfbc48c4..206c345f063e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1123,8 +1123,8 @@ void __init debug_ll_io_init(void) } #endif -static void * __initdata vmalloc_min = - (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); +static unsigned long __initdata vmalloc_min = + VMALLOC_END - (240 << 20) - VMALLOC_OFFSET; /* * vmalloc=size forces the vmalloc area to be exactly 'size' @@ -1147,7 +1147,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve); + vmalloc_min = VMALLOC_END - vmalloc_reserve; return 0; } early_param("vmalloc", early_vmalloc); @@ -1167,7 +1167,7 @@ void __init adjust_lowmem_bounds(void) * and may itself be outside the valid range for which phys_addr_t * and therefore __pa() is defined. */ - vmalloc_limit = (u64)(uintptr_t)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET; + vmalloc_limit = (u64)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET; /* * The first usable region must be PMD aligned. Mark its start From patchwork Tue May 18 12:15:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12264707 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 2CD47C433B4 for ; Tue, 18 May 2021 12:17:36 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD2AD61028 for ; Tue, 18 May 2021 12:17:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD2AD61028 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc:To:From: References:In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SHbihmt88MKDSJmLyDkJ7D+AnMBpw253rwGa6u6VmNE=; b=DFdBIrQIWeBZKEga5X+HvHD3n 7t5qzKbTEgN4BKBc3CNLKo5FpUbCTo12BjgHAK2x1sa3EMOSjXChsUKVk+Kd44X/Vuj2n8bk5mXcn pSrcLr2j/hq2Nzn2Zuq8/hmh4mjRyAY1SnLhkFPwqN2MN1RvLPql5h78u2uqeB9PPTyY/AbtiBKHp fT6v44NUPNpkrcjzTcGtPzvM0QgEt46L1L6woLHLQJkylQo87xOJXXyhFL0jlEOaVKf/GzYd8/wqi XgP3kuJ9x8Fnjz27mLO+4kFdzNTaKr/4rDVlXM1h5b3nZf8qnpgEkDbpTJBKfJozYcVsHqUEPYZOm qm4hfxzAA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liydl-000j2B-9w; Tue, 18 May 2021 12:16:01 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liyda-000j0Q-S6 for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 12:15:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description; bh=hTF+YIpqNQ+WPQ0k08ocz/wpK6+OEUGLkUueFrzV3NE=; b=dZ1hJD2EnODMMx13QgD6SvtJ5J nobQCHy6VxG35ef6dc1cbnBS6NPjrxrjo+8ZmdqoD4bzfO6Yptve5uI94UyJpKJAInkIapkjASBMY B6sNzYCVnr1+zS8S52TF/eHWzsWAsfks3euYC1C65NQq8LtNVHehiR/Q6Tg7aKXeZu2emH9ZltOFU FMBenJt4rXOnHoYL70FsglZtgLP4Gco7Um7r/PPQjDLSzBJOe9ob+s306q2ComgRL0KxIPbB4MOZB b3aNS/XvQy5tWysesTA3m0U+cze1I0BS/0zc9qzgIBvAg0WNJRH4X8hRndEXoqt2VzhKc6joTTJMU COeL0ZMA==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydY-00EdnZ-Ea for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 12:15:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hTF+YIpqNQ+WPQ0k08ocz/wpK6+OEUGLkUueFrzV3NE=; b=ig1+8cQqoBmYEJRq7myeZ3yX6q KjXPTVap9hkpzTwyNd6pt3RaAn/km3U+BKOHU1WRLMVC+X5H5zodKIJi95BBpnX/NxMdOp0C+bSqn 7OPQcwrdPW9oWVz6QP1l1j3VdPNkJ4xln5Gqf23h3p70jHSMeQStLm2oa6imWFFF5oSxyBMeVjI5C 1mqmEKf03aVeAhnDaHNiwWUQn41tPRC28230mVDcmVusrqQQx0ZLRtR6jyQTaX9woHPr+WqOrT6py QxVxFBCMlckeouQqJ6hB7tsf/AQ7p/NJeuh+h8blpiEvawC01QuWm6cG9DP38HwAbzrZH9B/ySL2f 69/QC5vA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55064 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liydV-0004Gd-OP; Tue, 18 May 2021 13:15:45 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1liydV-0004rQ-Ed; Tue, 18 May 2021 13:15:45 +0100 In-Reply-To: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518120633.GW12395@shell.armlinux.org.uk> From: "Russell King (Oracle)" To: Yanfei Xu Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, carver4lio@163.com, tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ARM: use a temporary variable to hold maximum vmalloc size MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 18 May 2021 13:15:45 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_051548_510055_4E729B24 X-CRM114-Status: GOOD ( 12.31 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We calculate the maximum size of the vmalloc space twice in early_vmalloc(). Use a temporary variable to hold this value. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij --- arch/arm/mm/mmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 206c345f063e..d932c46a02e0 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1134,6 +1134,7 @@ static unsigned long __initdata vmalloc_min = static int __init early_vmalloc(char *arg) { unsigned long vmalloc_reserve = memparse(arg, NULL); + unsigned long vmalloc_max; if (vmalloc_reserve < SZ_16M) { vmalloc_reserve = SZ_16M; @@ -1141,8 +1142,9 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - if (vmalloc_reserve > VMALLOC_END - (PAGE_OFFSET + SZ_32M)) { - vmalloc_reserve = VMALLOC_END - (PAGE_OFFSET + SZ_32M); + vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M); + if (vmalloc_reserve > vmalloc_max) { + vmalloc_reserve = vmalloc_max; pr_warn("vmalloc area is too big, limiting to %luMB\n", vmalloc_reserve >> 20); } From patchwork Tue May 18 12:15:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12264711 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C3537C433B4 for ; Tue, 18 May 2021 12:17:45 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FAAB60FF1 for ; Tue, 18 May 2021 12:17:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FAAB60FF1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc:To:From: References:In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vyQ/YRDFKtB17tZipiNd5VSuJGCuh9XZDRBJdLyeUBM=; b=pIBOu0j0by476EcpFn3TEne1y ukhkB3T0DWu+iQ/JiGZcQtOHU82MBnMcCuxU5kPE89I/tep1rj4VGBENBy+8PVCvPrDxItQbcKgsc StCsTbWMlh0yJ1FlYZALor3SwEQpdVe1+WWGbMLMpTeSTuKn4ILjIzCj7Lm2aBAkon8jzi30WZOeR bGWNmxZxaqCQSIVc8XsOH7WYSBiOtYIm05yoVCLqxxDBndOSLZXDLwfvDrUAqAlYq0KAtTGgMsmhU 5OiOY6ObHIZhzrRY0kYtfJTma/faNo1MXJq0YpTzGtSxpnF1zUSDx/U/FtYVJz6yPmaNrYNERrv6o Wj3hdEWKw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liydw-000j4d-Pb; Tue, 18 May 2021 12:16:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydg-000j1J-3D for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 12:15:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description; bh=tXsdohr9dsfiFfYjt4EoeiJaXMMYDvnBILSMVxKeA40=; b=L43nH3Z0xdoluaDfNib5tVgyHc yGpKXF5NkUFVzhY9MxOHDi32+7czemhi1Kk1wen16zflWG77xVWU5xFK440q6SCeRASSE+I0tnmdK qvMvw2HrFaKaNSgSL6bCvRazw90nwS5E6rXHw04EHar8Ayru1M0SlzmdDgnlwCLVMfGkO8WuIZHou ii1YVdmqORVfOPwU+ro25kA5AJKUJzyIdwom1jE7wR9BXX1UagVfAFfDqnrtZsGteNSYZuCIwu2dY GLLGmfWhBJPukKnZE7YHgPtFtSVyuMke/+FmPZg8Zg8Br5J3fczTC8CLm4RNrsB72f4v6LadW3Ftp u2ChdxKg==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydd-00Edo8-Lx for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 12:15:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tXsdohr9dsfiFfYjt4EoeiJaXMMYDvnBILSMVxKeA40=; b=ntVXk9vQhlEMBA3K6nALoQffR3 5o0C1XtG5gRZ/dgoOY1q2bKmOgyvvS+hffoJ3k8M/L9FhPE+y7BzQ/hl6uj7lic9+4/2m+/oJOKis pOxZyGYuNQzwqcbOGqLUvJSZRT2RxeKqr20yL2ouVjH7Z1EYn55qVRcaySvuj3uXdBDCHmOQwzgAe psEAd7bqPUssNGTf/22hUGiGWN63Mjy6wMN+9pAhrSwzLbMEr2phgd0eEDz9hDaI8uLFS1qZoFxWs LmcN7KboonS5jokv28+aGXmaIQy9nRuyc3uiPVdReRgYg1w10b/G2plrQ83mvv4KHVRjSnBAuLCRM qmtyXQSQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55066 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liyda-0004H8-Sc; Tue, 18 May 2021 13:15:50 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1liyda-0005B4-Kk; Tue, 18 May 2021 13:15:50 +0100 In-Reply-To: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518120633.GW12395@shell.armlinux.org.uk> From: "Russell King (Oracle)" To: Yanfei Xu Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, carver4lio@163.com, tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 18 May 2021 13:15:50 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_051553_740797_F8AC0DAE X-CRM114-Status: GOOD ( 13.60 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Change the current vmalloc_min, which is supposed to be the lowest address of vmalloc space including the VMALLOC_OFFSET, to vmalloc_start which does not include VMALLOC_OFFSET. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij --- arch/arm/mm/mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index d932c46a02e0..457203b41ceb 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1123,8 +1123,7 @@ void __init debug_ll_io_init(void) } #endif -static unsigned long __initdata vmalloc_min = - VMALLOC_END - (240 << 20) - VMALLOC_OFFSET; +static unsigned long __initdata vmalloc_start = VMALLOC_END - (240 << 20); /* * vmalloc=size forces the vmalloc area to be exactly 'size' @@ -1142,14 +1141,14 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M); + vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M + VMALLOC_OFFSET); if (vmalloc_reserve > vmalloc_max) { vmalloc_reserve = vmalloc_max; pr_warn("vmalloc area is too big, limiting to %luMB\n", vmalloc_reserve >> 20); } - vmalloc_min = VMALLOC_END - vmalloc_reserve; + vmalloc_start = VMALLOC_END - vmalloc_reserve; return 0; } early_param("vmalloc", early_vmalloc); @@ -1169,7 +1168,8 @@ void __init adjust_lowmem_bounds(void) * and may itself be outside the valid range for which phys_addr_t * and therefore __pa() is defined. */ - vmalloc_limit = (u64)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET; + vmalloc_limit = (u64)vmalloc_start - + (PAGE_OFFSET + PHYS_OFFSET + VMALLOC_OFFSET); /* * The first usable region must be PMD aligned. Mark its start From patchwork Tue May 18 12:15:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12264713 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 8541AC433ED for ; Tue, 18 May 2021 12:17:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D6B260FF1 for ; Tue, 18 May 2021 12:17:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D6B260FF1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc:To:From: References:In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8BrM67Tkw+Vufe2nkb4qPkaK0iFZ1YoiHtp+FnyWCqg=; b=FaYpBlq8h56C2U1VgmVB+p4Yo +At0WDMUgMCyYDXw8aDHASL1raMmtA/yFLNB45KqVbDhozYaYPfF5nFp13S5gf+n4zk5PLNsETEbF NwHnskI5ioZOE30cRWz0kSrvJlluu3Upt7NYoI0/8VzxD3w8Z1soTgC5/obh8MNtn0coR8DVP17hr enzutua2Otkv8f4plgQ3UahR3XcmeCU0KeccV0Z24YKMYCfipullUtIiEmy9roaIxc3D1tLGn0qOB TpmrZD2I/4HNHKVSSm1/WpF8JFOi9+pGDu8ArDOFlXwUjGPw7Sx3PBZ9ktU9b4dfXmNj2GBveM8ab obdTkYt+w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liye7-000j7p-Jx; Tue, 18 May 2021 12:16:24 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydm-000j2R-Hu for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 12:16:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description; bh=c2+F1zL32ImCnk7eIDJcr6c8d1xl1EJQ2Q5jtE+xhe8=; b=UCkdvQWzmH4lB0guE3sIW9QTAU sKJIxkX5ADvUVE6LLe92Op2JMEBEUWx6sWOn76MMSWZpNNzhMJVuOQUjsVR4mSXDmo0Mb2x0CB2Uq vYO6h/i5Ht4Z/f9krdxv7L5530/I216hdZxlfaT3nOPR5/JEAs/W6bnOcGHsmvtuxK9mg2M+RQV5+ brZkJGK92Ib9I3EZheg7ZorxXH7oHa1e26Frcgr8LfV0WB+roP1zH1wvl5kS0sF8fjpp1eTP8LQfN gUcq+DQHvr1W+tS2gCCc57dliDYoO+H0AGYVaLK4e+cTajXA6gGZxj6JxlVhAMfKjtbGPDnrsyX7N lxNdr3Dw==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liydk-00EdoW-5U for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 12:16:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=c2+F1zL32ImCnk7eIDJcr6c8d1xl1EJQ2Q5jtE+xhe8=; b=qqVcKxdipNAJBlgI6I2/5CndBt ufDfSi768Za5cfaBlc9LPPE0WmqrzTSaReiLT9mgPbEa0SxyGTOSyaNg3EDN9U0W+hfqGxoBDsGsz Bd4aK+9sazpX9HkKOb/UV8wUb3Z1Z0eydI9Ow9es4C44r3OrIGQHsuF8uCLib4YqC4xPwIxHtWsdP i7lcs6arJm/2VKYnKEQlQKKXLO0ZKTRR0ILTVIiMR4x7moY/pDts6IAOqrM6h6gaAfL7VFNGTG1Sv utFcmRuHGIM20OeMxQ+k+7xbN4Y5mFKswRhYBBmKrZUtVDM4Fq4oG3RyXD0EiaPNaMt7Y85plLGa6 NCW2nBIw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55068 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liydg-0004HU-0u; Tue, 18 May 2021 13:15:56 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1liydf-0005BQ-PY; Tue, 18 May 2021 13:15:55 +0100 In-Reply-To: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518120633.GW12395@shell.armlinux.org.uk> From: "Russell King (Oracle)" To: Yanfei Xu Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, carver4lio@163.com, tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] ARM: change vmalloc_start to vmalloc_size MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 18 May 2021 13:15:55 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_051600_230968_A8375899 X-CRM114-Status: GOOD ( 12.75 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rather than storing the start of vmalloc space, store the size, and move the calculation into adjust_lowmem_limit(). We now have one single place where this calculation takes place. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij --- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 457203b41ceb..2c74f1230cc7 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1123,7 +1123,7 @@ void __init debug_ll_io_init(void) } #endif -static unsigned long __initdata vmalloc_start = VMALLOC_END - (240 << 20); +static unsigned long __initdata vmalloc_size = 240 << 20; /* * vmalloc=size forces the vmalloc area to be exactly 'size' @@ -1148,7 +1148,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_start = VMALLOC_END - vmalloc_reserve; + vmalloc_size = vmalloc_reserve; return 0; } early_param("vmalloc", early_vmalloc); @@ -1168,7 +1168,7 @@ void __init adjust_lowmem_bounds(void) * and may itself be outside the valid range for which phys_addr_t * and therefore __pa() is defined. */ - vmalloc_limit = (u64)vmalloc_start - + vmalloc_limit = (u64)(VMALLOC_END - vmalloc_size) - (PAGE_OFFSET + PHYS_OFFSET + VMALLOC_OFFSET); /* From patchwork Fri May 28 10:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12286731 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 4D74EC4708C for ; Fri, 28 May 2021 11:05:35 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id F2BEF6128D for ; Fri, 28 May 2021 11:05:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2BEF6128D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AfCpg4EEAOZ82WCcuQ/skfIdLgepfGDk+kZC4/62H7E=; b=Fm69ScIvXn5lhn 3pe2z610rSdCGXzz+VeYMSnjMxiz9tKLUMCW7EeTygD55ZeCXlzbkSwKS3EBeBo99DtdDnCmCvxt9 rmWMmWwLVuXq+PCpzekQlRCjj3EI/DFdp+iSmtuEk5LWOQSpwE6rxFkMvAhwWqVwiPAMVWJkh06uA PyH3Qb5hfHeBnxqBrw7MleEfK0tDgfB+BPf39KEizOmHTAN9a3QUA+2h6ZBkoTaYp7M+S6BrsYuow E9Vg3iLyA3bqMpzQ2UawjH41ZkvEil6207cQqdEtcCsKcTaiWkRgQCDB4/TUap4uJc01EXND8kQl+ UhU6X9IsIOBn6j5s486g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmaG4-00Edsa-8M; Fri, 28 May 2021 11:02:33 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmZT8-00EGtr-VN for linux-arm-kernel@lists.infradead.org; Fri, 28 May 2021 10:11:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=G6wkOh1WLxhd+f66+CKgFtR4EGi7L3gk2cUf6TM1Sec=; b=Y6FTvAenXvqUy+4V2Y4jmyA5ib gU/m/lejvRbXTsgDY7jsZQMw1p+1B3bDvdXgpz3acUPQigCnDkZ6l4+IGm/tD7R/KFbOHVXiDqq+s w9f1JDZcT7mFiXNP7bAs7bAMOwVN2G0n4FUoeiH2HW0h0rKICSEG7ltRliIdKIYhs/l8Uh7KX1TRT X0O+y6xjYOhJLjRVUgd/U11yVAyOX0GFELz7v8rytAR8TCGNj7jcfcDVxGYNctqqTrTslctLCifxk pnbF7B9wkgsmlRPHjCG9v3uDjAhCJ+ISLRfJ77xiCE7WqzTkbdJMjiIQw7ktoACl/bqX2Oj6fGdoW OQl79WhQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:57318 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmZT6-0008Gc-Ff; Fri, 28 May 2021 11:11:52 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lmZT6-0005U2-8e; Fri, 28 May 2021 11:11:52 +0100 In-Reply-To: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518120633.GW12395@shell.armlinux.org.uk> From: "Russell King (Oracle)" To: Yanfei Xu Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, carver4lio@163.com, tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] ARM: use "* SZ_1M" rather than "<< 20" MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 28 May 2021 11:11:52 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210528_031155_071443_2E6A0C21 X-CRM114-Status: GOOD ( 10.94 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Make the default vmalloc size clearer by using a more natural multiplication by SZ_1M rather than a shift left by 20 bits. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij Reviewed-by: Yanfei Xu --- arch/arm/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 5ae11e6f2a58..d52647b6261c 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1123,7 +1123,7 @@ void __init debug_ll_io_init(void) } #endif -static unsigned long __initdata vmalloc_size = 240 << 20; +static unsigned long __initdata vmalloc_size = 240 * SZ_1M; /* * vmalloc=size forces the vmalloc area to be exactly 'size' From patchwork Fri May 28 10:11:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12286737 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 62F28C4708C for ; Fri, 28 May 2021 11:07:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 21CF461090 for ; Fri, 28 May 2021 11:07:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21CF461090 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oduy06bB7DAXRwO3uqQrsBjfRJJVgAVzjfBLqVQRXow=; b=dzD0ak2PIvGHmb NRFC59m9nf1h2y2VKzB5jJgBCU4BMwdgOBe4Qj3F3z4N2kekygmrkeFbd73iwX3ZnGFhOHqTo5j7L S5GcYFzzMIflVnn4LCvuYZSRZIxmevgwPqfycMkyf5cTxxzG47+ENbmRD5lrTfp+s5eAdrRFUVWM1 WsXHO/rDA5uomCwT46JTvSKuLk9l0l1nB2qT7GPkvV7tCJIObHDgjolW0gs4YVbn3Fludyy9M9cPi mDcGmasonbv3w9RUcuAHeF8PfKYPfAGVySh1QwXdS+EUFz40IFnewXV9G4G3U7B4bfxEdx1gEEp4H 86KI+nS/isGEZmfUY8eA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmaIj-00Eesw-Gw; Fri, 28 May 2021 11:05:17 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmZTE-00EGw5-2E for linux-arm-kernel@lists.infradead.org; Fri, 28 May 2021 10:12:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CPXS1CZLh6h02odPz5k132SgjYx3UjKf90rsJb71X7w=; b=YcAsKzKRKWlE5q0ZFiwsFFYSSP klpuJ7Y27LDuUHo8UDk6eA0fkNPeOd2wT8fOdZloNb88qtFcKnS1+044Sa8U70lGfrp8P1sgd+GFx EX7PS0SmBOD5UIfAWx8JLqVj5ABXhH2u1WCf/NKwgq+YK5Od/e98O3jfHjBMRnOaXzNFuPWKf3dsZ Pty21wd8ABX94Z8JuOkTs6yxvZnVfKKqEHAxKGjYjsXkl8lYwGcvljciu1DRFXpEuwX8+zNHQNJF9 4sBm7M+QZae/mF7XEIFWXgaffLfg6ZXPH/7H1htW7Ryqt2LmwvVrP86RrSYyz5aXbFKnlvtxzFTq9 luxrAmnw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:57320 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmZTB-0008Gy-Jh; Fri, 28 May 2021 11:11:57 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lmZTB-0005UP-C9; Fri, 28 May 2021 11:11:57 +0100 In-Reply-To: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518120633.GW12395@shell.armlinux.org.uk> From: "Russell King (Oracle)" To: Yanfei Xu Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, carver4lio@163.com, tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] ARM: use MiB for vmalloc sizes MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 28 May 2021 11:11:57 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210528_031200_178709_67D41BCD X-CRM114-Status: GOOD ( 13.25 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rather than using "m" (which is the unit of metres, or milli), and "MB" in the printk statements, use MiB to make it clear that we are talking about the power-of-2 megabytes, aka mebibytes. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij Reviewed-by: Yanfei Xu --- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index d52647b6261c..a96e9420ec2a 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1128,7 +1128,7 @@ static unsigned long __initdata vmalloc_size = 240 * SZ_1M; /* * vmalloc=size forces the vmalloc area to be exactly 'size' * bytes. This can be used to increase (or decrease) the vmalloc - * area - the default is 240m. + * area - the default is 240MiB. */ static int __init early_vmalloc(char *arg) { @@ -1137,14 +1137,14 @@ static int __init early_vmalloc(char *arg) if (vmalloc_reserve < SZ_16M) { vmalloc_reserve = SZ_16M; - pr_warn("vmalloc area too small, limiting to %luMB\n", + pr_warn("vmalloc area is too small, limiting to %luMiB\n", vmalloc_reserve >> 20); } vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M + VMALLOC_OFFSET); if (vmalloc_reserve > vmalloc_max) { vmalloc_reserve = vmalloc_max; - pr_warn("vmalloc area is too big, limiting to %luMB\n", + pr_warn("vmalloc area is too big, limiting to %luMiB\n", vmalloc_reserve >> 20); }