Received: by 10.223.185.116 with SMTP id b49csp63801wrg; Tue, 13 Feb 2018 16:39:28 -0800 (PST) X-Google-Smtp-Source: AH8x226XmI6ZlpG5dFnpzKJnzNa3SM0AJe7VKRSnR1MQHDRem/YCdNrWPFLxzBoBYbffL1AV0s9U X-Received: by 10.99.110.201 with SMTP id j192mr839659pgc.59.1518568768089; Tue, 13 Feb 2018 16:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518568768; cv=none; d=google.com; s=arc-20160816; b=QQK3QWxa5DiD2C5CgtB1nuFcp6VMnK4QbzzDE+MPItOrUueLw1s44KulDJKgQ0bNan xvRt7HdUU9fPHDLtTEd9CQIb+e6M6593MbAl161NR+mfCvO1dipTqRkR9pSpkIwwtQFJ MWa8f9rEk77s3g/W9jRA95eHiDkjxD2wFazfTPnMgzCamVDNzjKGYJsxwXL42yu8DycQ n3MUMyEysRprC9sCefliEv8+HQVG1ziku8XoPOSIlmQqhMhkOXNCLMscP2cohe3pciBS pDMiZzX2KjA7ownKFMkkwTOcCLsBfXPJA7QworuC+PDmbDP4c1n7kkPEA4+hPHfaC70W OlpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=iM5L8mTWiGgQ/Crk/bnHMidrLxcLtyrnwNVnGtJssIw=; b=tsQVxPlCALC6RofhvCl69jNLp6Z0PzmtDeQNYv5UpHnExCBTKD2bw5MqbuywTEuQr2 k+pUb/2824/hX6xbqL9hTfUF7mzPzKmiWi0dv+zmFYPsTXlxYtgATmou7Oe6W+66pJBO YFI7HUntknLMkoO4Z8rjkZQtOvLRu2UkxNBQifrtAxB+AMeYa+hTeHC0lXNflBbViLd/ Ahb31tSVe5BJYfJHzY9rkPc5xzTLPSbUHD2GodJDnJTjfyf4XgnDiFlhu367MKNmqK/S 497mDqrRO8xKSQJsiMINpiVoOP81FQAo4WsMFUH9BP6++M71iNGFl9pK8plUjBSItSdX X6fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=mo/xbH48; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si16505pfi.156.2018.02.13.16.39.13; Tue, 13 Feb 2018 16:39:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=mo/xbH48; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966258AbeBNAiE (ORCPT + 99 others); Tue, 13 Feb 2018 19:38:04 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56842 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966207AbeBNAiC (ORCPT ); Tue, 13 Feb 2018 19:38:02 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1E0bHSW104462; Wed, 14 Feb 2018 00:37:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=iM5L8mTWiGgQ/Crk/bnHMidrLxcLtyrnwNVnGtJssIw=; b=mo/xbH48nA2w2+8MfprLM0L9M9GUgBy1GwVUCSdGTGBvXT2myYjv92cbTHEhE9Vn0rjy OTgCEPa8bfZONuyomirgwSL6x+1QeaZ2do5WAQGLwsvGHzpNZajfaWwuM3RJyTFbrOYd 2Vv0rk0aeoMKIcb94+6iz2Yb1Jmh7FvwBBSD8kJ8jTgyIjR76sanSkafeCXcS4t2bE4W UuHcFoREFVx+sJrcAqeU2UtxPMfVtbQyiM6OPs3BHeWCanL26Aki+IenNnJcjlUCtWMK ciWshO5qPtB9Phx2LQmPx9zoK430DsXo1/Lo8WrA6WzEwcN/8TPAUS+c8gxFOt68/cDX PQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2g49pbr5rc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2018 00:37:56 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w1E0br2Z012337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Feb 2018 00:37:54 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1E0brRZ024630; Wed, 14 Feb 2018 00:37:53 GMT Received: from [192.168.1.164] (/98.246.252.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 13 Feb 2018 16:37:53 -0800 Subject: Re: [patch 1/2] mm, page_alloc: extend kernelcore and movablecore for percent To: David Rientjes , Andrew Morton Cc: Jonathan Corbet , Vlastimil Babka , Mel Gorman , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org References: From: Mike Kravetz Message-ID: Date: Tue, 13 Feb 2018 16:37:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8804 signatures=668670 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802140004 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/2018 04:24 PM, David Rientjes wrote: > Both kernelcore= and movablecore= can be used to define the amount of > ZONE_NORMAL and ZONE_MOVABLE on a system, respectively. This requires > the system memory capacity to be known when specifying the command line, > however. > > This introduces the ability to define both kernelcore= and movablecore= > as a percentage of total system memory. This is convenient for systems > software that wants to define the amount of ZONE_MOVABLE, for example, as > a proportion of a system's memory rather than a hardcoded byte value. > > To define the percentage, the final character of the parameter should be > a '%'. > > Signed-off-by: David Rientjes > --- > Documentation/admin-guide/kernel-parameters.txt | 44 ++++++++++++------------- > mm/page_alloc.c | 43 +++++++++++++++++++----- > 2 files changed, 57 insertions(+), 30 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -1825,30 +1825,30 @@ > keepinitrd [HW,ARM] > > kernelcore= [KNL,X86,IA-64,PPC] > - Format: nn[KMGTPE] | "mirror" > - This parameter > - specifies the amount of memory usable by the kernel > - for non-movable allocations. The requested amount is > - spread evenly throughout all nodes in the system. The > - remaining memory in each node is used for Movable > - pages. In the event, a node is too small to have both > - kernelcore and Movable pages, kernelcore pages will > - take priority and other nodes will have a larger number > - of Movable pages. The Movable zone is used for the > - allocation of pages that may be reclaimed or moved > - by the page migration subsystem. This means that > - HugeTLB pages may not be allocated from this zone. > - Note that allocations like PTEs-from-HighMem still > - use the HighMem zone if it exists, and the Normal > - zone if it does not. > - > - Instead of specifying the amount of memory (nn[KMGTPE]), > - you can specify "mirror" option. In case "mirror" > + Format: nn[KMGTPE] | nn% | "mirror" > + This parameter specifies the amount of memory usable by > + the kernel for non-movable allocations. The requested > + amount is spread evenly throughout all nodes in the > + system as ZONE_NORMAL. The remaining memory is used for > + movable memory in its own zone, ZONE_MOVABLE. In the > + event, a node is too small to have both ZONE_NORMAL and > + ZONE_MOVABLE, kernelcore memory will take priority and > + other nodes will have a larger ZONE_MOVABLE. > + > + ZONE_MOVABLE is used for the allocation of pages that > + may be reclaimed or moved by the page migration > + subsystem. This means that HugeTLB pages may not be > + allocated from this zone. Note that allocations like > + PTEs-from-HighMem still use the HighMem zone if it > + exists, and the Normal zone if it does not. I know you are just updating the documentation for the new ability to specify a percentage. However, while looking at this I noticed that the existing description is out of date. HugeTLB pages CAN be treated as movable and allocated from ZONE_MOVABLE. If you have to respin, could you drop that line while making this change? > + > + It is possible to specify the exact amount of memory in > + the form of "nn[KMGTPE]", a percentage of total system > + memory in the form of "nn%", or "mirror". If "mirror" > option is specified, mirrored (reliable) memory is used > for non-movable allocations and remaining memory is used > - for Movable pages. nn[KMGTPE] and "mirror" are exclusive, > - so you can NOT specify nn[KMGTPE] and "mirror" at the same > - time. > + for Movable pages. "nn[KMGTPE]", "nn%", and "mirror" > + are exclusive, so you cannot specify multiple forms. > > kgdbdbgp= [KGDB,HW] kgdb over EHCI usb debug port. > Format: [,poll interval] Don't you need to make the same type percentage changes for 'movablecore='? -- Mike Kravetz