Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2707195ybh; Mon, 16 Mar 2020 08:13:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsd0kKCjpIzBEv7Ka6dttKp/kMSu1zPtKv603jNzRijf6r0JJOuJSCpPiHTd6rIMX3cMw+5 X-Received: by 2002:aca:5210:: with SMTP id g16mr16477oib.174.1584371617726; Mon, 16 Mar 2020 08:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584371617; cv=none; d=google.com; s=arc-20160816; b=o9vTVlpSVgjHMPfIYfqRUs6LxwPKKgNPq/gaizAK+9f1zj+mrhrAP9BorwmBNAiZEb N3YKZVgX/mrK/DWeOvaNu1YRAk+fLj9m0+A95Yb+Nlb3FTKf+L00SLHkG1qvirpIPhAD MNAITRsypMD6n/hArkbQQSMmZCbWsTsitRVUWzSx7SOAL3k0ocpGfMgCq9ejjPB0oMY1 cTvlYCnDow0VnzmF/1utRlJ16IAunn6WpOPUswU7jbieDW/li7TMh0tFR3T1Mnl2DXtM of8+aV/OykORVScD2pPi8kmEeViro7/Rf3G0x4tNF3ME0HSn61QyGrK97LtIFNeLuuBF toiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pP29NNx6Ci3tKu2VMQ6svFhSLpTYpkSdhU02iawHkFs=; b=Mpw1lEVtRxQHlQUBb5aa161ENvKqCeL+Qk6YD69l+2rgAb8J8Id9AgEpZnE1xAH/F2 fTy+3vPXk0YvsYslH/Pr/7Qjt2FDLTEIrzikDuowYuWpnVa5zPhwk1RygI7ImCUQeDen gs9y8iGxi2YAcHoGMywGFosZWi5UQBGDcKVXzeqeuViZsckSi9lRX6vATPAT+scoP6aJ 2ebLKtcOqH32PG/CANA3kXHeJM4zZMKY7+0W7JdGTTfzywlyEZDETcPQSXD7U9h1IGjr jHUHlWSiW/s8UsOBznbiBTzqGcufEAIAQrr7BT2t7kr27K0LG/ew1VCcIBF1dPHAtS/s r4dA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si114267oii.54.2020.03.16.08.13.24; Mon, 16 Mar 2020 08:13:37 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731740AbgCPPM3 (ORCPT + 99 others); Mon, 16 Mar 2020 11:12:29 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35169 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729964AbgCPPM3 (ORCPT ); Mon, 16 Mar 2020 11:12:29 -0400 Received: by mail-wm1-f68.google.com with SMTP id m3so18493922wmi.0; Mon, 16 Mar 2020 08:12:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pP29NNx6Ci3tKu2VMQ6svFhSLpTYpkSdhU02iawHkFs=; b=Dnwlz34mWXgBWLnFf8OBoTMCCjGEIjnY7+NNYOn65l9S3hkmn81ytzDfT6y9PhntMr SFLK54ZKh9T0dnqBCNjg18J/5xXqU6Dutf65o0mA9LJ8tUK/KdKNChq8ouj9QeRcRCbS 8n501882hm2Sc8eBAPEhX3CMGqQqmzy9vUs4LqvYxBoLveX9Q/FO07l2DJCXPUnEwsHX YtQnY5FLBu4kySaj89LiqlrQQbbiwwE21QFOyfe4ybweOkNlHfxnktLSO6qeWRxQYzX+ 4ZUSW3yMfjcdy+eoEC1nCzKPtrjSTvAUJKm5we85MalKwaG0fMwCMGOY7Z8try3A1Y8O Iv7g== X-Gm-Message-State: ANhLgQ0W5UHiRbs/JemC3KLjZLExWn9Qp5gdfhE+bwbL5oyIhngWTDWj /0hgMDXn9rQ8ikPfltraVe8= X-Received: by 2002:a7b:c75a:: with SMTP id w26mr10625158wmk.2.1584371544960; Mon, 16 Mar 2020 08:12:24 -0700 (PDT) Received: from localhost ([37.188.132.163]) by smtp.gmail.com with ESMTPSA id s15sm347045wrr.45.2020.03.16.08.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 08:12:24 -0700 (PDT) Date: Mon, 16 Mar 2020 16:12:23 +0100 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org, Greg Kroah-Hartman , Andrew Morton , Oscar Salvador , "Rafael J. Wysocki" , Baoquan He , Wei Yang Subject: Re: [PATCH v1 1/5] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE Message-ID: <20200316151223.GS11482@dhcp22.suse.cz> References: <20200311123026.16071-1-david@redhat.com> <20200311123026.16071-2-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311123026.16071-2-david@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 11-03-20 13:30:22, David Hildenbrand wrote: > The name is misleading. Let's just name it like the online_type name we > expose to user space ("online"). I would disagree the name is misleading. It just says that you want to online and keep the zone type. Nothing I would insist on though. > Add some documentation to the types. > > Cc: Greg Kroah-Hartman > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: "Rafael J. Wysocki" > Cc: Baoquan He > Cc: Wei Yang > Signed-off-by: David Hildenbrand > --- > drivers/base/memory.c | 9 +++++---- > include/linux/memory_hotplug.h | 6 +++++- > 2 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > index 6448c9ece2cb..8c5ce42c0fc3 100644 > --- a/drivers/base/memory.c > +++ b/drivers/base/memory.c > @@ -216,7 +216,7 @@ static int memory_subsys_online(struct device *dev) > * attribute and need to set the online_type. > */ > if (mem->online_type < 0) > - mem->online_type = MMOP_ONLINE_KEEP; > + mem->online_type = MMOP_ONLINE; > > ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE); > > @@ -251,7 +251,7 @@ static ssize_t state_store(struct device *dev, struct device_attribute *attr, > else if (sysfs_streq(buf, "online_movable")) > online_type = MMOP_ONLINE_MOVABLE; > else if (sysfs_streq(buf, "online")) > - online_type = MMOP_ONLINE_KEEP; > + online_type = MMOP_ONLINE; > else if (sysfs_streq(buf, "offline")) > online_type = MMOP_OFFLINE; > else { > @@ -262,7 +262,7 @@ static ssize_t state_store(struct device *dev, struct device_attribute *attr, > switch (online_type) { > case MMOP_ONLINE_KERNEL: > case MMOP_ONLINE_MOVABLE: > - case MMOP_ONLINE_KEEP: > + case MMOP_ONLINE: > /* mem->online_type is protected by device_hotplug_lock */ > mem->online_type = online_type; > ret = device_online(&mem->dev); > @@ -342,7 +342,8 @@ static ssize_t valid_zones_show(struct device *dev, > } > > nid = mem->nid; > - default_zone = zone_for_pfn_range(MMOP_ONLINE_KEEP, nid, start_pfn, nr_pages); > + default_zone = zone_for_pfn_range(MMOP_ONLINE, nid, start_pfn, > + nr_pages); > strcat(buf, default_zone->name); > > print_allowed_zone(buf, nid, start_pfn, nr_pages, MMOP_ONLINE_KERNEL, > diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h > index f4d59155f3d4..261dbf010d5d 100644 > --- a/include/linux/memory_hotplug.h > +++ b/include/linux/memory_hotplug.h > @@ -47,9 +47,13 @@ enum { > > /* Types for control the zone type of onlined and offlined memory */ > enum { > + /* Offline the memory. */ > MMOP_OFFLINE = -1, > - MMOP_ONLINE_KEEP, > + /* Online the memory. Zone depends, see default_zone_for_pfn(). */ > + MMOP_ONLINE, > + /* Online the memory to ZONE_NORMAL. */ > MMOP_ONLINE_KERNEL, > + /* Online the memory to ZONE_MOVABLE. */ > MMOP_ONLINE_MOVABLE, > }; > > -- > 2.24.1 -- Michal Hocko SUSE Labs