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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 5A86AC433ED for ; Tue, 18 May 2021 12:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D8DB6113C for ; Tue, 18 May 2021 12:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244396AbhERMIH (ORCPT ); Tue, 18 May 2021 08:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235289AbhERMIG (ORCPT ); Tue, 18 May 2021 08:08:06 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4966C061573 for ; Tue, 18 May 2021 05:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=A0bnY9zwm+FBk1NHGMYRSCnW726sXdnf0iswF1lZG/M=; b=mN9TPGfrX+kwGFJLCI5PeyMKy lZo1hFDQnbmMzX5T09tHHEdtqDYcqirqKPEiBpvcxWZNAvdQSOiQxa8D/Ayf4IA8TPp67kWys8AuP wfu36V0OxMa9mpORDRMM2NA3IKLzJWsNJmwIpQ64AnJnCME6M2NycLC3oNufDjSA12mrprJvVZ9GP ekCNsIVnyX+8RCuSTeq/ztkJ6dJLQJuXDTX1P3jA+wRMt87o1kwUkEuF2u5VkGmEb75Ei6+gywgFg wwp0kDPfz23dTInfsRKxg04O4/xd36n5g8IoF5NWoSfdFwypRYCKmfOVipzRJtJGXGGwhyikPsWo7 x1+oL2xkg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44136) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liyUf-0004FG-9g; Tue, 18 May 2021 13:06:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1liyUb-0007si-5J; Tue, 18 May 2021 13:06:33 +0100 Date: Tue, 18 May 2021 13:06:33 +0100 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: Re: [PATCH] arm: make the size of vmalloc in cmdline and meminfo uniform Message-ID: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518111254.3820480-1-yanfei.xu@windriver.com> <20210518112932.GV12395@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518112932.GV12395@shell.armlinux.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 12:29:32PM +0100, Russell King (Oracle) wrote: > On Tue, May 18, 2021 at 07:12:54PM +0800, Yanfei Xu wrote: > > The value of "vmalloc=" set in cmdline is always 8M more than the value > > of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user > > expect to get the size what they input, and no need to consider the 8M > > "hole" hided in codes. This commit make real vmalloc size equal to value > > of "vmalloc=" in cmdline. > > > > Also, the commit will reduce the size of vmalloc printed in boot message > > by 8M when the size set in cmdline is irrational. > > Hi, > > I think I'd like to do several cleanups with this: > > 1. change vmalloc_min to be an unsigned long. > 2. exclude VMALLOC_OFFSET from vmalloc_min, moving it into > adjust_lowmem_bounds where vmalloc_min is used. > 3. rename vmalloc_min to be vmalloc_start > 4. enforce vmalloc_start to be a multiple of 2MiB > 5. in early_vmalloc(), calculate vmalloc_max as: > VMALLOC_END - (PAGE_OFFSET + SZ_32M + VMALLOC_OFFSET) > and use that to set the upper bound of vmalloc_reserve (which is > something your patch doesn't do, which I think is a bug. > > Thoughts? I've slightly modified the above idea, and will shortly follow up with some patches to show the idea a bit better... -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! 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=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 57C22C433B4 for ; Tue, 18 May 2021 12:08:52 +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 C5455611CC for ; Tue, 18 May 2021 12:08:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5455611CC 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/QpJmoevIDDZzUq/AKGT1PNSgpuUOfZuvcOB4b+ID8Q=; b=BLiFukKE8xoeYLs+Di7oivhIQ s5NgxTsqM/C6SP9f6iVAEiB9A48LJsoGycerP6hz+3VIMVltBGmFBru6sC6zGQXIjsUxlwAymcszc comQZecow5vqEwLKznFu0k7Hg6BBZS9d4CPYxqEV4p7JaWQfA2U8q8HTyVStjHqqQmomAyc1dn111 PA3XSM/zDKqr01tsDqubhKyijtO8e3dJ3nTprOzX50kDkEy6QuSbL03WXSVLIhTkXm2nY0eK9d/L7 GfVM6R0LF5TRRXfuAyqf/6M5RU5GUUSm5Y/P21mTEgLeLb47qzWKBSfnF9iA+karQG5+/aLWXCJs6 lJc8/7Fzw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liyUt-000i4n-79; Tue, 18 May 2021 12:06:51 +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 1liyUq-000i4F-RJ for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 12:06:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=A0bnY9zwm+FBk1NHGMYRSCnW726sXdnf0iswF1lZG/M=; b=dr0s0A9uFsJCSbh5xbTGajMKUN 1RDPEzSfD0SPy2vSPJpkpYSuDjOldEovw2yafoPWGyL5UeD10pSjMbovL5Ho62MwwEDkCHyfB4f4+ yqtSe5HNYLncNE5pv6hoxUYNs9rQ4ifF+3xHIeCCyDPyBb6Th/nyEjIkVEPkBlCh6+rNsPzFNeE7K aFgT6ifb7Nq2f901Juga++gbaWuRTP2F4RnYAGmGrT07qItvv0/9u65Sw9RpjGQZPZMJtnhYRXdkp Nk6ULeAu7oH1M1jR5nP/5Akxy9rWgPYZjIMhrnVekpU6Fr8/XRh5oz52eB836LaS3GVNgaf+F43yg M1xV+jBw==; 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 1liyUo-00EdN8-5m for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 12:06:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=A0bnY9zwm+FBk1NHGMYRSCnW726sXdnf0iswF1lZG/M=; b=mN9TPGfrX+kwGFJLCI5PeyMKy lZo1hFDQnbmMzX5T09tHHEdtqDYcqirqKPEiBpvcxWZNAvdQSOiQxa8D/Ayf4IA8TPp67kWys8AuP wfu36V0OxMa9mpORDRMM2NA3IKLzJWsNJmwIpQ64AnJnCME6M2NycLC3oNufDjSA12mrprJvVZ9GP ekCNsIVnyX+8RCuSTeq/ztkJ6dJLQJuXDTX1P3jA+wRMt87o1kwUkEuF2u5VkGmEb75Ei6+gywgFg wwp0kDPfz23dTInfsRKxg04O4/xd36n5g8IoF5NWoSfdFwypRYCKmfOVipzRJtJGXGGwhyikPsWo7 x1+oL2xkg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44136) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liyUf-0004FG-9g; Tue, 18 May 2021 13:06:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1liyUb-0007si-5J; Tue, 18 May 2021 13:06:33 +0100 Date: Tue, 18 May 2021 13:06:33 +0100 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: Re: [PATCH] arm: make the size of vmalloc in cmdline and meminfo uniform Message-ID: <20210518120633.GW12395@shell.armlinux.org.uk> References: <20210518111254.3820480-1-yanfei.xu@windriver.com> <20210518112932.GV12395@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210518112932.GV12395@shell.armlinux.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_050646_240221_43D3B6CA X-CRM114-Status: GOOD ( 20.55 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 18, 2021 at 12:29:32PM +0100, Russell King (Oracle) wrote: > On Tue, May 18, 2021 at 07:12:54PM +0800, Yanfei Xu wrote: > > The value of "vmalloc=" set in cmdline is always 8M more than the value > > of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user > > expect to get the size what they input, and no need to consider the 8M > > "hole" hided in codes. This commit make real vmalloc size equal to value > > of "vmalloc=" in cmdline. > > > > Also, the commit will reduce the size of vmalloc printed in boot message > > by 8M when the size set in cmdline is irrational. > > Hi, > > I think I'd like to do several cleanups with this: > > 1. change vmalloc_min to be an unsigned long. > 2. exclude VMALLOC_OFFSET from vmalloc_min, moving it into > adjust_lowmem_bounds where vmalloc_min is used. > 3. rename vmalloc_min to be vmalloc_start > 4. enforce vmalloc_start to be a multiple of 2MiB > 5. in early_vmalloc(), calculate vmalloc_max as: > VMALLOC_END - (PAGE_OFFSET + SZ_32M + VMALLOC_OFFSET) > and use that to set the upper bound of vmalloc_reserve (which is > something your patch doesn't do, which I think is a bug. > > Thoughts? I've slightly modified the above idea, and will shortly follow up with some patches to show the idea a bit better... -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel