Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1857084ybi; Wed, 17 Jul 2019 23:13:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqySfnW9BcwTd3AFNbQP3ktep+TCT9tBVB6QArmDoaHSvepIPDXSDTgXg4tZaNModR6Yra4e X-Received: by 2002:a17:90a:214e:: with SMTP id a72mr6734229pje.0.1563430433626; Wed, 17 Jul 2019 23:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563430433; cv=none; d=google.com; s=arc-20160816; b=Rs0r1f+igvnUVHD6HRtcVx1hL/ByV71cNH4I1dHAQ72qO7/0rUXF7/sRgWDWnUhnN+ 4R8R0YYaIvNe5I9A+Y9ATDjF17xaIyqg4Cj+q2fUAZGjZyfSN8d25M8RfyT2YmsxgSno 3CsPHAZz2X+iF5H6NQuQNzqWFUwoi0+++nrz3YmKGs4XIx8mumhNewsk+8M5gx5snYeV KNuegH4fk0KWI0lZ7zsJXkGgGYeQwFJYxTRd/oA2IFgwAe2Ydei99YyTZCkI2rO3FzIf SlnffKFRh97zOmT8zipUZiYFOyV/LSbncP7QtNhZDjqnAJe19eFD/hwqN2s+aFdLw0yZ 8Ezw== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=ZtzqC59otavtaxw96gW5yTACLZk2RItC3OAm3JpIFEQ=; b=xPd9yFH5nzx7Yw0j8Ff2UPhs6HZD2xiEUErPuvAM7GubewxCl08UsUWR1HurlNhoVZ OzaKwX39xMcdDkmVJMZmA7hk6K3TAqNuSWUFSYHFpkMoj4Y3bGA9jlonIEi1WZYi7Ics IYYbpA4ovToCeRG2ldTfyWLIhWptUC/ufSp3dFZSB3HlGoqfvcCebCTuG8TOD+ttnwWG 31eFxCdJ90ix5kLl91uieYLEdcic4RCieBeYhWCrKPK7kACdu0o4x57WDuY9+Rjo6u6w PJcoMq32xdHz3myJt4pSWOo4smyHLYDH7mGv43MzDbIivL2HawpHTJZ6IP3hpI5tpFha mJyA== 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 q13si25136003pjb.13.2019.07.17.23.13.35; Wed, 17 Jul 2019 23:13:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726547AbfGRGMh (ORCPT + 99 others); Thu, 18 Jul 2019 02:12:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:47014 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725959AbfGRGMh (ORCPT ); Thu, 18 Jul 2019 02:12:37 -0400 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 DC940AFEC; Thu, 18 Jul 2019 06:12:35 +0000 (UTC) Message-ID: <1563430353.3077.1.camel@suse.de> Subject: Re: [PATCH 1/1] mm/memory_hotplug: Adds option to hot-add memory in ZONE_MOVABLE From: Oscar Salvador To: Leonardo Bras , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Mike Rapoport , Michal Hocko , Pavel Tatashin , =?ISO-8859-1?Q?J=E9r=F4me?= Glisse , Thomas Gleixner , Pasha Tatashin , Bartlomiej Zolnierkiewicz Date: Thu, 18 Jul 2019 08:12:33 +0200 In-Reply-To: <20190718024133.3873-1-leonardo@linux.ibm.com> References: <20190718024133.3873-1-leonardo@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-07-17 at 23:41 -0300, Leonardo Bras wrote: > Adds an option on kernel config to make hot-added memory online in > ZONE_MOVABLE by default. > > This would be great in systems with MEMORY_HOTPLUG_DEFAULT_ONLINE=y > by > allowing to choose which zone it will be auto-onlined We do already have "movable_node" boot option, which exactly has that effect. Any hotplugged range will be placed in ZONE_MOVABLE. Why do we need yet another option to achieve the same? Was not that enough for your case? > > Signed-off-by: Leonardo Bras > --- > drivers/base/memory.c | 3 +++ > mm/Kconfig | 14 ++++++++++++++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > index f180427e48f4..378b585785c1 100644 > --- a/drivers/base/memory.c > +++ b/drivers/base/memory.c > @@ -670,6 +670,9 @@ static int init_memory_block(struct memory_block > **memory, > mem->state = state; > start_pfn = section_nr_to_pfn(mem->start_section_nr); > mem->phys_device = arch_get_memory_phys_device(start_pfn); > +#ifdef CONFIG_MEMORY_HOTPLUG_MOVABLE > + mem->online_type = MMOP_ONLINE_MOVABLE; > +#endif > > ret = register_memory(mem); > > diff --git a/mm/Kconfig b/mm/Kconfig > index f0c76ba47695..74e793720f43 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -180,6 +180,20 @@ config MEMORY_HOTREMOVE > depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE > depends on MIGRATION > > +config MEMORY_HOTPLUG_MOVABLE > + bool "Enhance the likelihood of hot-remove" > + depends on MEMORY_HOTREMOVE > + help > + This option sets the hot-added memory zone to MOVABLE > which > + drastically reduces the chance of a hot-remove to fail due > to > + unmovable memory segments. Kernel memory can't be > allocated in > + this zone. > + > + Say Y here if you want to have better chance to hot-remove > memory > + that have been previously hot-added. > + Say N here if you want to make all hot-added memory > available to > + kernel space. > + > # Heavily threaded applications may benefit from splitting the mm- > wide > # page_table_lock, so that faults on different parts of the user > address > # space can be handled with less contention: split it at this > NR_CPUS. -- Oscar Salvador SUSE L3