Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5178581ybl; Tue, 10 Dec 2019 01:43:25 -0800 (PST) X-Google-Smtp-Source: APXvYqw0Z4o1faNc9vfUnR+q3daesJKDj08VZAnDUttT0Si1/Rq4VRmVAZUyyiCi+TBFm/OhIie7 X-Received: by 2002:a9d:5885:: with SMTP id x5mr24057683otg.132.1575971005581; Tue, 10 Dec 2019 01:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575971005; cv=none; d=google.com; s=arc-20160816; b=0x2J5vdODiAJAQ1QLCskijDHWrETdVVIBU0Ez40Z6JFRxTR087JB0Qp+aSMfp00PMn BBPC9cIGCvdOXs754cnJHub1kYy72+bkCsgxs9mMDHkP5+ZBCG+D/hqUOPJOpg19DGGM ziSqu3IuVRTrSNg88QCtnPWdw1qNgT/ZHFgQlcgfVQ4N0S6mqdIX5YKViOanZ5d1QI9k HJ7QbTbHX9LpGVgq898MVGup0TmoK0kdSYMpHZcXDNaaluV+FFw8zgXz8GZTiPpBybWJ WLrZehiAbF2/Y5/eypPMHcgCaiXymZYCYQkthcCstaVSCvnDjad2f0dLE1qCkRLuYRPb ocyg== 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; bh=R0u0ZfpArreLfqRSq8m+twJN9g+3tnH7q3PaFzvCPho=; b=w1o1OiVKelIV5nEnvsMvNXUo8aV8P3vVPTtLZIZ/FKZ2Lf5mLRQDqJQsQ6GekDgcon DGYGZRdJaKExD1TLeUgSVe36Lu0Y0/9OkI3HgqMGJYvXAQbyqElGkq7BNOeLbeatLBwG 1LiyGnlTLNQR9dAO/5qKaZ2bKt5/H+MVPsaZT1WKQNFvpFCyytYAPfys7qhLWnPYpJqN 91iFpbSa3qFNhe8d0onre7H7KwP4MgX6ny1hkbuavibA2BwHQ67fG5nYUaYiMRAQXy36 8u4aPiB0+XmqxfQdntq0eNKEbnvWjMe8ayK2O62QxNzg+dTp96YL3oTmXlKtRt+rDM2I Bhdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QJ2w0F6X; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v15si1665495otn.100.2019.12.10.01.43.12; Tue, 10 Dec 2019 01:43:25 -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=@gmail.com header.s=20161025 header.b=QJ2w0F6X; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbfLJJln (ORCPT + 99 others); Tue, 10 Dec 2019 04:41:43 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34793 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbfLJJln (ORCPT ); Tue, 10 Dec 2019 04:41:43 -0500 Received: by mail-lj1-f196.google.com with SMTP id m6so19106775ljc.1 for ; Tue, 10 Dec 2019 01:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=R0u0ZfpArreLfqRSq8m+twJN9g+3tnH7q3PaFzvCPho=; b=QJ2w0F6XB+jWTFqErVdwTrlZRax0pNXGHa9u4xLwSGDuHvHKkTU4mBNCrqOBUr+9TF gKOAcQhCQlMxgPJHfopHvdr+/W1BKTCNzjqZIeNLSQuWE7TkvsA4tGkrxIJ/wZEgyrjg 6rPJU8e9+rZwZiurrjhW8YrRIFe6NEp6ElXRJ1+cOsp04FZtl9S9ZkK8lvn1hnN78flp XhL1mATzmOU/wQTvHp+kuTIwfMXKeHhpE+clIVx5mhik4snY+6t5Vph+xDAZEGYud7H9 zehLojMbjjN/W2bVCZswZISPQ3p4B0tsP8Ld2LerlLupRhp6064nXA/S+vJJJ20qd0PL ilaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=R0u0ZfpArreLfqRSq8m+twJN9g+3tnH7q3PaFzvCPho=; b=GaZza5YD/FUwr4paLTDPhJuw2Bnk25TZOBwcv/UbkHbhfAL+pm8CPIqpuFJWM++0A1 ObVZO2I2JuCWjCChDasmnjprvkCKRYjvEHx4y5sKUCkp6wCSF03yWPXUbIXdxJfb6LZF r5EZX+vPhQhc+gaDwHfp/0bsCL17Xyzf2/pXhQ3Fklf45mltvQAJWZ+gAo+BpXcR6WX0 oMgEn7r/8lYesk9r6ZO1WIEzKzLOxCvFCX6E6VSa5yO16Y8hdQIYHGD9jv3gHOch0TJZ PbjroVqi0xgvMwjja13NdVoCjNWU6PASN3F+DnX65Br9ngD8lzq6p/LOy9XjL/GmYJ7c /36w== X-Gm-Message-State: APjAAAWKXoIVHKS5ILyyB6K95rrilclh7ijqkcl3k4ZuTVRrL/a4wbxa 0vBVCwS6QrL7HrbQgyYXgF8= X-Received: by 2002:a2e:9ad8:: with SMTP id p24mr17260641ljj.148.1575970901168; Tue, 10 Dec 2019 01:41:41 -0800 (PST) Received: from [192.168.68.106] ([193.119.54.228]) by smtp.gmail.com with ESMTPSA id 30sm1696148ljv.99.2019.12.10.01.41.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Dec 2019 01:41:40 -0800 (PST) Subject: Re: [Patch v2] mm/hotplug: Only respect mem= parameter during boot stage To: David Hildenbrand , Baoquan He , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mhocko@kernel.org, jgross@suse.com, akpm@linux-foundation.org References: <20191210084413.21957-1-bhe@redhat.com> <75188d0f-c609-5417-aa2e-354e76b7ba6e@gmail.com> <429622cf-f0f4-5d80-d39d-b0d8a6c6605f@redhat.com> From: Balbir Singh Message-ID: <618f5695-73e4-3f28-c874-4f12966dee51@gmail.com> Date: Tue, 10 Dec 2019 20:41:33 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/19 8:37 pm, David Hildenbrand wrote: > On 10.12.19 10:36, David Hildenbrand wrote: >> On 10.12.19 10:24, Balbir Singh wrote: >>> >>> >>> On 10/12/19 7:44 pm, Baoquan He wrote: >>>> In commit 357b4da50a62 ("x86: respect memory size limiting via mem= >>>> parameter") a global varialbe global max_mem_size is added to store >>> typo ^^^ >>>> the value parsed from 'mem= ', then checked when memory region is >>>> added. This truly stops those DIMM from being added into system memory >>>> during boot-time. >>>> >>>> However, it also limits the later memory hotplug functionality. Any >>>> memory board can't be hot added any more if its region is beyond the >>>> max_mem_size. System will print error like below: >>>> >>>> [ 216.387164] acpi PNP0C80:02: add_memory failed >>>> [ 216.389301] acpi PNP0C80:02: acpi_memory_enable_device() error >>>> [ 216.392187] acpi PNP0C80:02: Enumeration failure >>>> >>>> From document of 'mem= ' parameter, it should be a restriction during >>>> boot, but not impact the system memory adding/removing after booting. >>>> >>>> mem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory >>>> ... >>>> >>>> So fix it by also checking if it's during boot-time when restrict memory >>>> adding. Otherwise, skip the restriction. >>>> >>> >>> The fix looks reasonable, but I don't get the use case. Booting with mem= is >>> generally a debug option, is this for debugging memory hotplug + limited memory? >> >> Some people/companies use "mem=" along with KVM e.g., to avoid >> allocating memmaps for guest backing memory and to not expose it to the >> buddy across kexec's. The excluded physical memory is then memmap into > > s/memmap/mmaped/ > >> the hypervisor process and KVM can deal with that. I can imagine that >> hotplug might be desirable as well for such use cases. Makes sense, sounds hacky, but it seems like mem= is no longer a debug option Acked-by: Balbir Singh >> >>> >>> Balbir >>> >> >> > >