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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 AE5B1C3524D for ; Tue, 4 Feb 2020 07:53:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C47421582 for ; Tue, 4 Feb 2020 07:53:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C47421582 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0C7606B0003; Tue, 4 Feb 2020 02:53:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 078556B0005; Tue, 4 Feb 2020 02:53:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECFA06B0006; Tue, 4 Feb 2020 02:53:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id D31436B0003 for ; Tue, 4 Feb 2020 02:53:33 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7C4FE281F for ; Tue, 4 Feb 2020 07:53:33 +0000 (UTC) X-FDA: 76451679906.19.limit52_76515b453b90a X-HE-Tag: limit52_76515b453b90a X-Filterd-Recvd-Size: 2512 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 4 Feb 2020 07:53:32 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 65A60AD4F; Tue, 4 Feb 2020 07:53:31 +0000 (UTC) Subject: Re: [PATCH v3] mm/hotplug: Only respect mem= parameter during boot stage To: Baoquan He , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org, david@redhat.com, bsingharora@gmail.com References: <20200204050643.20925-1-bhe@redhat.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <1356631d-30b6-e967-9874-6c48c25304cf@suse.com> Date: Tue, 4 Feb 2020 08:53:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20200204050643.20925-1-bhe@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 04.02.20 06:06, Baoquan He wrote: > In commit 357b4da50a62 ("x86: respect memory size limiting via mem= > parameter") a global varialbe max_mem_size is added to store > the value parsed from 'mem= ', then checked when memory region is > added. This truly stops those DIMMs from being added into system memory > during boot-time. > > However, it also limits the later memory hotplug functionality. Any > DIMM can't be hotplugged any more if its region is beyond the > max_mem_size. We will get errors like: > > [ 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 > > This will cause issue in a known use case where 'mem=' is added to > the hypervisor. The memory that lies after 'mem=' boundary will be > assigned to KVM guests. After commit 357b4da50a62 merged, memory > can't be extended dynamically if system memory on hypervisor is not > sufficient. > > So fix it by also checking if it's during boot-time restricting to add > memory. Otherwise, skip the restriction. > > And also add this use case to document of 'mem=' kernel parameter. > > Fixes: 357b4da50a62 ("x86: respect memory size limiting via mem= parameter") > Signed-off-by: Baoquan He Reviewed-by: Juergen Gross Juergen