Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2529471ybi; Thu, 18 Jul 2019 09:47:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3M9jixmlfcUnBO43crPzkJIJnG+0p0m+706L+19KcpAENK8rHJdWSV/5N/zcJGdCQxt5v X-Received: by 2002:a63:d002:: with SMTP id z2mr49949710pgf.364.1563468467962; Thu, 18 Jul 2019 09:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563468467; cv=none; d=google.com; s=arc-20160816; b=BdN2kAEqzYY9q+066tElsQKdOW70ePOHdXcshmxjs2Ify9c9IYRuZ6YSTCAXohCKx7 L/l3oiqbBNcEm/8bGlfuVli24XeDRI6j2E6aoZjC3PGYL747a5bEPlCgVRPakzl7Jf5X 40gzAaIyxBMyqxCNgTz0H0+VM7QaHkNjVsXPQyLrbHP64dftOYG4o7YawuluP83M5HgL CwJtFEZ/B12ZWO9si3JIbn1OIzr11PMlGPKU9h9IMQdcQYTTCagXKwQDLsH0hkFn4za7 Hnr149zR+gy4v2botRXPHD7KpFi1NCtfDLV6TIHawtK555v190fEC2hehZArEk7sAC/n bFoQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KgRfHejv/zIzuUta64QTdW+DJVmqS0zjC4X90cCy9QI=; b=qNnpeBmt3I+8vIf6tYDtGhx9SlzhFY3rab9aeXeVFVtlk7rLSFM9ej1wJ2A7nJozX+ HEHlQEPWuLdcKtkvs4on8sRu/BWthaVD3t8U8VterZ46KRnz1b6U4MMQKQ1zbvwh03Uy G+hWguQyAMd3BLb5CZFNpVDVQK5M0AkDi0tBqzd0+7DP8GMGckufeCJ62nY1oiwKR/Td TfmrUMqOnXxFKbmnsWYy2eF7ytXPlGyxUAeZhlbFLvWYK2X/oUc9fPOiLsp3h+SPrOJC PqGOiTZmnwmY/QEfG2Ric2zSG3gtxT9ao4y8kOR3bCwhHr9CzT9Nyq+4788R1G8Ytgsr oj2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=PzoghoiU; 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 g18si1145734pgk.477.2019.07.18.09.47.31; Thu, 18 Jul 2019 09:47:47 -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; dkim=pass header.i=@soleen.com header.s=google header.b=PzoghoiU; 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 S1727812AbfGRQpt (ORCPT + 99 others); Thu, 18 Jul 2019 12:45:49 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39166 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbfGRQpt (ORCPT ); Thu, 18 Jul 2019 12:45:49 -0400 Received: by mail-ed1-f66.google.com with SMTP id m10so31002323edv.6 for ; Thu, 18 Jul 2019 09:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KgRfHejv/zIzuUta64QTdW+DJVmqS0zjC4X90cCy9QI=; b=PzoghoiUeT+cfTCoJNBcMdcHj4lUEnnKPdIB0RIR7UfIhBNExY45DGUWwEb6VInVhX cdfKfmcchZblLxSSZF5AFrMDhwPcAlqFPUCLjsX8x8+8Zcs2u2GmFaiF1ECh4v8PQ2F8 j4HhGExKdqzRvuS2Dl4OmXpajh5psO9uuIZTpdM7O5nZPeYs4yVRzt8mIMiynp96OWiC uDolhH6hlq7pA1VxLsr2gjfo3hvLExYypRB7JfUrW4J1IQdRCAoGrAG5ih/r8aFRnlxJ PBn48/MCV1UMTY8QGKa/jew7xYNxn6sUpCvfRcBqSKGRUcEPnUkv/zraQfpIgkIpixCd ortg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KgRfHejv/zIzuUta64QTdW+DJVmqS0zjC4X90cCy9QI=; b=Utv7ARdTlmo/K15qiJuyPbjzYIs4tbXvsMlZpeOxTqDeNhXkhY0GuIbZsW6Zezd+UO t55mmn/Q1/ddZRzSo+ReCgb2im4MouyjWK8uOvLEkALGwAMuBIzEoZpVPfK/p7xD0+LD FkMI0y568YRYArMWmm9ltU13f4D+U5GODc883tNWbNgs8Kt1DqKrW0tzAbskgk/YzB/S fSERuEs7vIHEKt/yJRj8lo5VlHWn0DPvQtmzg+GoE0oPgDSZn4plWFn2+uDM/9H1D3Wb wKmM73Ua+fltEI1JHdGEgbnIsObgUzx/JdpOgPhf6XpRQZmdjgSPydtV2mvQWUTLYIxO bx6w== X-Gm-Message-State: APjAAAUo7/qHqxm2pj67NPhRWFMfx4Cmc2XKA49YiIu87IWxtWMvYG7O Gjo1++clzPmx5YGjn1YOukezjd++/GsnmkD9hKc= X-Received: by 2002:a17:906:9447:: with SMTP id z7mr37111939ejx.165.1563468347812; Thu, 18 Jul 2019 09:45:47 -0700 (PDT) MIME-Version: 1.0 References: <20190718024133.3873-1-leonardo@linux.ibm.com> <6cd8f8f753881aa14d9dfec9a018326abc1e3847.camel@linux.ibm.com> In-Reply-To: <6cd8f8f753881aa14d9dfec9a018326abc1e3847.camel@linux.ibm.com> From: Pavel Tatashin Date: Thu, 18 Jul 2019 12:45:36 -0400 Message-ID: Subject: Re: [PATCH 1/1] mm/memory_hotplug: Adds option to hot-add memory in ZONE_MOVABLE To: Leonardo Bras Cc: LKML , linux-mm , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Mike Rapoport , Michal Hocko , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Thomas Gleixner , Pasha Tatashin , Bartlomiej Zolnierkiewicz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 18, 2019 at 12:04 PM Leonardo Bras wro= te: > > On Thu, 2019-07-18 at 08:19 -0400, Pavel Tatashin wrote: > > On Wed, Jul 17, 2019 at 10:42 PM 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=3Dy= by > > > allowing to choose which zone it will be auto-onlined > > > > This is a desired feature. From reading the code it looks to me that > > auto-selection of online method type should be done in > > memory_subsys_online(). > > > > When it is called from device online, mem->online_type should be -1: > > > > if (mem->online_type < 0) > > mem->online_type =3D MMOP_ONLINE_KEEP; > > > > Change it to: > > if (mem->online_type < 0) > > mem->online_type =3D MMOP_DEFAULT_ONLINE_TYPE; > > > > And in "linux/memory_hotplug.h" > > #ifdef CONFIG_MEMORY_HOTPLUG_MOVABLE > > #define MMOP_DEFAULT_ONLINE_TYPE MMOP_ONLINE_MOVABLE > > #else > > #define MMOP_DEFAULT_ONLINE_TYPE MMOP_ONLINE_KEEP > > #endif > > > > Could be expanded to support MMOP_ONLINE_KERNEL as well. > > > > Pasha > > Thanks for the suggestions Pasha, > > I was made aware there is a kernel boot option "movable_node" that > already creates the behavior I was trying to reproduce. I agree with others, no need to duplicate this functionality in a config, and Michal in a separate e-mail explained the reasons why we have MEMORY_HOTPLUG_DEFAULT_ONLINE. > > I was thinking of changing my patch in order to add a config option > that makes this behavior default (i.e. not need to pass it as a boot > parameter. > > Do you think that it would still be a desired feature? > > Regards, > > Leonardo Br=C3=A1s