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=-2.5 required=3.0 tests=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 887C8C2D0BF for ; Tue, 10 Dec 2019 09:50:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2E33D2077B for ; Tue, 10 Dec 2019 09:50:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E33D2077B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A4DA6B2BAA; Tue, 10 Dec 2019 04:50:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 956166B2BAB; Tue, 10 Dec 2019 04:50:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86B046B2BAC; Tue, 10 Dec 2019 04:50:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 71D236B2BAA for ; Tue, 10 Dec 2019 04:50:05 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 1342A8249980 for ; Tue, 10 Dec 2019 09:50:05 +0000 (UTC) X-FDA: 76248760770.02.park68_3ae2197085415 X-HE-Tag: park68_3ae2197085415 X-Filterd-Recvd-Size: 4775 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Dec 2019 09:50:04 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id z7so19147271wrl.13 for ; Tue, 10 Dec 2019 01:50:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7WkJTOKc1Bnd1dO9SMcHZyqU/qBYt7sZp0ZFAmC/CkU=; b=DVJ2CXb7jSu7/sv96fb60YiJooteV/iQXo2Rta9ZbYUVBpw5kQkQThvhsdRNxjoqiO QidlMR4soQ6wqL8o8cXBTWmQ8/Ii9idaTv9zjmiRV0TFGpj7ZdXsFNcalOGWZOVIPUML p//67wHfNS0u/i2KHZhhBYxxxNK2A0zhYlQ3uhRAD2jQoogALw8cllm9FRsk1ZtAcn3i jZvbjCEVxAUyxldCDxCwdPZasQb+nwVhC9FxbqEtPlEdfAcTemPEyQH29k919OOIEdNS Ipj66JrpayilhmV6ByLKfivEKLqJWwxf1txzzbAF+DN0wB/wzMBzNSe2tiHwoCmzH9Ij bN4g== X-Gm-Message-State: APjAAAUlRjDvKwvaF5DiEnXuxsis4WFDwrQLCi41j/VXO2gJAezMOVN1 SSLWk6JlE6C+MSKI/QtdVsc= X-Google-Smtp-Source: APXvYqyKiFRp4ntrVzf8c4z9W2pSugz+5UBlNTqIBRLIH0lcFqj5Wr0oe1UwnuQMV8dezFZ45h4nZQ== X-Received: by 2002:adf:82f3:: with SMTP id 106mr2169013wrc.69.1575971403497; Tue, 10 Dec 2019 01:50:03 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id w13sm2727586wru.38.2019.12.10.01.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 01:50:02 -0800 (PST) Date: Tue, 10 Dec 2019 10:50:02 +0100 From: Michal Hocko To: David Hildenbrand Cc: Balbir Singh , Baoquan He , linux-kernel@vger.kernel.org, linux-mm@kvack.org, jgross@suse.com, akpm@linux-foundation.org Subject: Re: [Patch v2] mm/hotplug: Only respect mem= parameter during boot stage Message-ID: <20191210095002.GA10404@dhcp22.suse.cz> References: <20191210084413.21957-1-bhe@redhat.com> <75188d0f-c609-5417-aa2e-354e76b7ba6e@gmail.com> <429622cf-f0f4-5d80-d39d-b0d8a6c6605f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <429622cf-f0f4-5d80-d39d-b0d8a6c6605f@redhat.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 10-12-19 10:36:19, 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 > the hypervisor process and KVM can deal with that. I can imagine that > hotplug might be desirable as well for such use cases. If this is really the usecase (it makes some sense to me) then it should be folded into the changelog. Because the real semantic is not really clear as I've pointed out in the previous version of this patch [1]. The restriction to BOOT is documented since ever long before the memory hotplug was a thing. Thanks! [1] Btw. it would have been much better if you posted the version 2 only after all the feedback got discussed properly. -- Michal Hocko SUSE Labs