Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3599084imm; Tue, 17 Jul 2018 07:26:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeZXwbmseunTgvxcc0l3UOKL7Uvf6ThJ2qEHh+fe3BDCk5SabwQXt9UXz0UnNObH2tUOKUv X-Received: by 2002:a17:902:8347:: with SMTP id z7-v6mr1885358pln.290.1531837594445; Tue, 17 Jul 2018 07:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531837594; cv=none; d=google.com; s=arc-20160816; b=BrCbY7vrcWNPRB9Z/qFh6mS/KDR3s7W2Y5o4R0qWhmoq/RxYfMQBJ+0uS+J/WeWPdK w6h1vjPZV3V0MGVdxWx6ukPBAR3ovUeS7QIHGEhzdb08iEnIuudVPJw4Uutl8QwTq5Dn fMpZpD7sLREh+jLNJ+1QjKzXCzaMznTCP57NjKtJwpAfUYSG/NQs2qKTr/U4nlgGb8vS pnOKeEjyYomNC0YElJzy71seW2BfW6ItO3R49DOhuEJpL9EUcedVgmFm3FR32rcedJq/ h2Vw51ptuy0t5EuE7SqcuNl28vfVoVibPiMHErv6w5gaMSYZNlD7zEcRtkLv6wzC0PFD wRWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HOQUNMNjBM6PrD8xSlji7ztegRmNqU2oU3zJHgZcHZ8=; b=bAF1Fes11NnvcGgK0R8Vbt+uNJfKpxxVTY0u6KbY79daYeYsZFvUh7tGYqJdTLuVzg lzzSJwbUptHNhC5Kn6EVZe5VoDaC8sLlobHtipU3kEPun3VXPGdN3MyjBBUIEgmpldss BSPZ/EuYOd22HrGOZtpVj0u/hW//9s3/j/qUZ3NcpTlqcuLzXMfyf7C9KyhO9Df+hDvk XJi0j3WzW3vR0bF4SkMF2keTU7/oIa12oQzd6uafvXh5F3G+sviBiAD1FV8gFIUCX60t JNscTaAP/I5r32i78cTZRuZjATXr++zh8VE8puOZgak+dBghY/IcUTLcyBpRfoIinhdV 8lRQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r138-v6si1198065pfc.202.2018.07.17.07.26.19; Tue, 17 Jul 2018 07:26:34 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731925AbeGQO5r (ORCPT + 99 others); Tue, 17 Jul 2018 10:57:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58260 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731679AbeGQO5r (ORCPT ); Tue, 17 Jul 2018 10:57:47 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E4E1401EF05; Tue, 17 Jul 2018 14:24:52 +0000 (UTC) Received: from localhost (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A6092026D68; Tue, 17 Jul 2018 14:24:49 +0000 (UTC) Date: Tue, 17 Jul 2018 22:24:43 +0800 From: Baoquan He To: Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, corbet@lwn.net, linux-doc@vger.kernel.org Subject: Re: [PATCH] mm/page_alloc: Deprecate kernelcore=nn and movable_core= Message-ID: <20180717142443.GG1724@MiWiFi-R3L-srv> References: <20180717131837.18411-1-bhe@redhat.com> <20180717133109.GI7193@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180717133109.GI7193@dhcp22.suse.cz> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 17 Jul 2018 14:24:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 17 Jul 2018 14:24:52 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On 07/17/18 at 03:31pm, Michal Hocko wrote: > On Tue 17-07-18 21:18:37, Baoquan He wrote: > > We can still use 'kernelcore=mirror' or 'movable_node' for the usage > > of hotplug and movable zone. If somebody shows up with a valid usecase > > we can reconsider. > > Well this doesn't really explain why to deprecate this functionality. > It is a rather ugly hack that has been originally introduced for large > order allocations. But we do have compaction these days. Even though the > compaction cannot solve all the fragmentation issues the zone movable is > not a great answer as it introduces other issues (basically highmem kind > of issues we used to have on 32b systems). > The current code doesn't work with KASLR and the code is too subtle to > work properly in other cases as well. E.g. movablecore range might cover > already used memory (e.g. bootmem allocations) and therefore it doesn't > comply with the basic assumption that the memory is movable and that > confuses memory hotplug (e.g. 15c30bc09085 ("mm, memory_hotplug: make > has_unmovable_pages more robust"). > > There are probably other issues I am not aware of but primarily the code > adds a maintenance burden which would be better to get rid of. > > I would also go further and remove all the code the feature is using at > one go. If somebody really needs this functionality we would need to > revert the whole thing anyway. Thanks for these details. I can arrange your above saying and rewrite patch log. Are you suggesting removing the code "kernelcore=nn" and "movablecore=" are using? If yes, I can repost with these changes. Just saw some deprecated codes are still there for future cleaning up. So posted this v1 patch. Thanks Baoquan > > --- > > Documentation/admin-guide/kernel-parameters.txt | 2 ++ > > mm/page_alloc.c | 3 +++ > > 2 files changed, 5 insertions(+) > > > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > > index efc7aa7a0670..1e22c49866a2 100644 > > --- a/Documentation/admin-guide/kernel-parameters.txt > > +++ b/Documentation/admin-guide/kernel-parameters.txt > > @@ -1855,6 +1855,7 @@ > > keepinitrd [HW,ARM] > > > > kernelcore= [KNL,X86,IA-64,PPC] > > + [Usage of kernelcore=nn[KMGTPE] | nn% is deprecated] > > Format: nn[KMGTPE] | nn% | "mirror" > > This parameter specifies the amount of memory usable by > > the kernel for non-movable allocations. The requested > > @@ -2395,6 +2396,7 @@ > > reporting absolute coordinates, such as tablets > > > > movablecore= [KNL,X86,IA-64,PPC] > > + [Deprecated] > > Format: nn[KMGTPE] | nn% > > This parameter is the complement to kernelcore=, it > > specifies the amount of memory used for migratable > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 1521100f1e63..86cf05f48b5f 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -6899,6 +6899,8 @@ static int __init cmdline_parse_kernelcore(char *p) > > return 0; > > } > > > > + pr_warn("Only kernelcore=mirror supported, " > > + "usage of kernelcore=nn[KMGTPE]|nn%% is deprecated.\n"); > > return cmdline_parse_core(p, &required_kernelcore, > > &required_kernelcore_percent); > > } > > @@ -6909,6 +6911,7 @@ static int __init cmdline_parse_kernelcore(char *p) > > */ > > static int __init cmdline_parse_movablecore(char *p) > > { > > + pr_warn("Option movablecore= is deprecated.\n"); > > return cmdline_parse_core(p, &required_movablecore, > > &required_movablecore_percent); > > } > > -- > > 2.13.6 > > -- > Michal Hocko > SUSE Labs