Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5150926ybl; Tue, 10 Dec 2019 01:08:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzgliLGLBwW+4gL7rlf1fRw+a+rYl9v2vdD5RMqFizNI1r9zscgZ5Xt1bMvXZEyIsn3ZQVI X-Received: by 2002:a05:6808:3b3:: with SMTP id n19mr3157244oie.23.1575968918683; Tue, 10 Dec 2019 01:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575968918; cv=none; d=google.com; s=arc-20160816; b=NmG475m2w7WvsRXO6z7iFZ9YAgnXyKrHbQq34LQZKp38JNbR7lfYZ6NnFaM7xgiHFR vLyXzOn/Y2E3YMKsyvgX/M42hHARc/SjPpPNnAvQmahlXFxouqEGN3aJxVXewYsZ1iEi dLxSB+MYfAdpD0p9ej6LN1N3nOgGi+NTACfyI+u4kXReTZcDUHGl+KZx5NTltvQOg6/H ywTyP1mAVhPDWnD3lkosb3Fzgr/SMhpVVJAoiXxITctIs+OKSMcpnPi5+KnbqvdQGfdY mrAjw/Rln033gcd7sQmRTA3xumRi5esALaTzqsfSshUVqbWfPUlQFHpTQwf2q5uE04/C ENVw== 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; bh=5zQmc31XvmhlRolI0EPp/9gaN/15Q7aT1BX6cM3wXWQ=; b=sjyA59u81v+HprzEn0HMNUfXuH3Ra0yo+F4jFrjc0KYIcgwMf7r51Ij6auzqhacXtG XMX48Y37ApXCWrbKJVjNO0oNbw/TbC4dDsrMCI2Gq2VPLnNIFMcMxms1uclp3dhjEXkx vX5273B22AWHzpYu8DutmnXP5UMZeBlc6BO8lMO2N8AgWKca5DuiEscIpQpWbqWQP/pg 1kKajZrGLeYTNdTf+Eg+9oOQ9UUKAol1sbXaAlnx7EVo6xpduZwN+Uakyc5vygb83Us5 yYET9HfoQSZJ7jw41/r/gHqVMrLtI28SsfRDumuNtTW40Ne88u3jj+re+d2OfC+Gm/ql IREg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y24si1509828oih.24.2019.12.10.01.08.24; Tue, 10 Dec 2019 01:08:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbfLJJHw (ORCPT + 99 others); Tue, 10 Dec 2019 04:07:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:45722 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726574AbfLJJHw (ORCPT ); Tue, 10 Dec 2019 04:07:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B8E83AD2B; Tue, 10 Dec 2019 09:07:50 +0000 (UTC) Subject: Re: [Patch v2] mm/hotplug: Only respect mem= parameter during boot stage To: Baoquan He , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mhocko@kernel.org, david@redhat.com, akpm@linux-foundation.org References: <20191210084413.21957-1-bhe@redhat.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: Date: Tue, 10 Dec 2019 10:07:50 +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: <20191210084413.21957-1-bhe@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 09:44, 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 > 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. > > Fixes: 357b4da50a62 ("x86: respect memory size limiting via mem= parameter") > Signed-off-by: Baoquan He Reviewed-by: Juergen Gross Juergen