Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp604949ybh; Wed, 11 Mar 2020 07:18:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvrwutt8VyTyBQfnyXIIgv+PyP8lXuLpxQQDuf5okXhsMJJzdoBNUqDZEyrYR6owKZFbX1D X-Received: by 2002:a05:6830:1d69:: with SMTP id l9mr2572502oti.192.1583936286309; Wed, 11 Mar 2020 07:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583936286; cv=none; d=google.com; s=arc-20160816; b=Hxme86MlqK3h8J7C7sMgqKdYtQO/7EKutIvDDHjlfRxI2qYocQX38tuF61BQ/fQYax nh5NjNHSPLc5OcEnTP6B62/L3pZPJiobv/sL8KibGvZxjm8VgMYm8mFy2KNe3qM0ePEu crDCNLBkX1oaaUNrmmj9HgNP7ISiKqeKj2mBOhMzj2pfBadU9M/xXCkeDHHH79hhRTLQ 7SBMB1xYGb6pP0QZEsPJBD9NxojGec0eIGMa6a47MCP2zUaiy+BCAyNhCHIvgadHdQmP 1D3Wg+mVangqjc+lVs767kD2XA6YyGchINkVFoTUB0lMb9gjxto+U7L77DJNM4VOmof0 w41g== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=I7eOL65ZNqa3gn2e8dEFcQnY6e+zHyU8AljZLv8aig4=; b=YmZPRoKuZNQQFiE6bF7b4bmOMlBx86Xpie3MCDbV1cmMthd+f0WAgpBcWOl3ACWbez YHQyAOOoxP+RnMB9ch6lI8lcjyvTFLGc8XJiWsMVJOgDjfrsJYNLRLqVqefID5fS8MQh 6gbW0PWDDTOn+n5mtDqVpPaZtiVg7ClWjVbMtazYh9YAoVI3joPk+UJWyK5xQS9KSSH+ ibhiB3d3dqTRhcVr6apZMQVuGQlO3/hx/DQDQqC6dNoEbaVgIQQEP2jHn1wszPKotR4h XcqXHHoD2XY2G6TNXOoq0HA2txPGtwr1oWh8li3aTlrAhuXNJnkWkmAIDCvh03skvPGT EThQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hUll7QwQ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si1111631otp.180.2020.03.11.07.17.48; Wed, 11 Mar 2020 07:18:06 -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=@gmail.com header.s=20161025 header.b=hUll7QwQ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729726AbgCKORc (ORCPT + 99 others); Wed, 11 Mar 2020 10:17:32 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53546 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729559AbgCKORc (ORCPT ); Wed, 11 Mar 2020 10:17:32 -0400 Received: by mail-wm1-f68.google.com with SMTP id 25so2279462wmk.3; Wed, 11 Mar 2020 07:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=I7eOL65ZNqa3gn2e8dEFcQnY6e+zHyU8AljZLv8aig4=; b=hUll7QwQmc6uf0wAxMRzpz3+R33/ySwyEcA+TUucM0e+k6m9Qs2ueb9yVCVKNfV7q8 nF3DVSDcoRj6jyg+7DJNrHX6+FCb5rbHJdfaw9bL5dGRiyb5pPs2JJ0+qI6am2VFzAKW fe5npINVmuOm4zTOgLC1yB2Dnbl9JQnJfVpPNJPHsdRtk9ietsHms1A4vey4NGn90Gdi SpJSZSiPgpxBcdY4EN/F0Uo+OIzyIfDcbcDFVCHFtj1WoNSS+E9ftStE/UUZsj1zuXTF 9BD7tnKxSvBKTGy7oZW/jhwsg1dfAKq9OwPFuLzH4xM2bFMNmOpFccwFZGKUX/HXe2FY 6/vQ== 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:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=I7eOL65ZNqa3gn2e8dEFcQnY6e+zHyU8AljZLv8aig4=; b=Bplzqvf4qttL99X5FyiSfWDGgOmYs4KJklzDguxkLkPhKLwmmyHiJ2frEyvvclfQ4i gDCIGmIoqarYJiwLvNPndw1MXc82noeC8aRvfaDHaSkcsg+BZjDE4Eqg1HmEZZ6qyY5T eaZcZSJEcYhI0t5LpADWJzRysomNxFj1IKbZiCrMSYQe/D+v9L68QjVTIK6Ogiyy951X jMuY04oDLJwgHQEU/Zi3hTJ6JUHna98BM9HnGwhPsae4V24Qg019s9aBX3quSDps4C8B QPXHS6IJcNBJk3Y7+t/pxcI+ANjPSb1TA/ZJRPBkTgaKCu3LXliq/anq1Qm3LNcc1wad MF8A== X-Gm-Message-State: ANhLgQ0TC0Zqk2JL7f+K3KNhnYcS0iLmix9uRJIMXUFcLR1nF4OCgS/p CNa3x/KLeZH1NUJDWhQUnH0= X-Received: by 2002:a05:600c:22d8:: with SMTP id 24mr1608196wmg.108.1583936250009; Wed, 11 Mar 2020 07:17:30 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id w1sm7987977wmc.11.2020.03.11.07.17.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Mar 2020 07:17:29 -0700 (PDT) Date: Wed, 11 Mar 2020 14:17:28 +0000 From: Wei Yang 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 , Michal Hocko , 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: <20200311141728.iav3lh3hcki5p7zc@master> Reply-To: Wei Yang 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> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2020 at 01:30:22PM +0100, David Hildenbrand wrote: >The name is misleading. Let's just name it like the online_type name we >expose to user space ("online"). > >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 Reviewed-by: Wei Yang >--- > 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 -- Wei Yang Help you, Help me