From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C94F9C4332E for ; Thu, 19 Mar 2020 13:34:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A057E20B1F for ; Thu, 19 Mar 2020 13:34:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XyOcn8LT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727845AbgCSNeq (ORCPT ); Thu, 19 Mar 2020 09:34:46 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:44462 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728964AbgCSNMk (ORCPT ); Thu, 19 Mar 2020 09:12:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584623559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rx1LvEZgAQgfY3xwuj9jjkM3L7Bytnt/zhNrUnrYFaE=; b=XyOcn8LTy5JO/M4XH1AFBWfIcFJZyj9hQeXmmpryScyPYfHUFMnDkMEpOqYCYF0Ot3JmRp wbn9VpPsaMpKr/GAmRKNTjd8eq5rMPgItB3hStEepQmsG8WvBscSzs+paepBhx/+qvubG5 6zGOWJsijAe2dfJ0hws4QmgtMveM3W8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-SKMNXm6IOPioc_5ZFsWhFQ-1; Thu, 19 Mar 2020 09:12:35 -0400 X-MC-Unique: SKMNXm6IOPioc_5ZFsWhFQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 36C50800D53; Thu, 19 Mar 2020 13:12:33 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-197.ams2.redhat.com [10.36.114.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D50E60BF7; Thu, 19 Mar 2020 13:12:30 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org, David Hildenbrand , Wei Yang , Greg Kroah-Hartman , Andrew Morton , Michal Hocko , Oscar Salvador , "Rafael J. Wysocki" , Baoquan He Subject: [PATCH v3 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE Date: Thu, 19 Mar 2020 14:12:14 +0100 Message-Id: <20200319131221.14044-2-david@redhat.com> In-Reply-To: <20200319131221.14044-1-david@redhat.com> References: <20200319131221.14044-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The name is misleading and it's not really clear what is "kept". Let's ju= st name it like the online_type name we expose to user space ("online"). Add some documentation to the types. Reviewed-by: Wei Yang 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 =3D MMOP_ONLINE_KEEP; + mem->online_type =3D MMOP_ONLINE; =20 ret =3D memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE); =20 @@ -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 =3D MMOP_ONLINE_MOVABLE; else if (sysfs_streq(buf, "online")) - online_type =3D MMOP_ONLINE_KEEP; + online_type =3D MMOP_ONLINE; else if (sysfs_streq(buf, "offline")) online_type =3D 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 =3D online_type; ret =3D device_online(&mem->dev); @@ -342,7 +342,8 @@ static ssize_t valid_zones_show(struct device *dev, } =20 nid =3D mem->nid; - default_zone =3D zone_for_pfn_range(MMOP_ONLINE_KEEP, nid, start_pfn, n= r_pages); + default_zone =3D zone_for_pfn_range(MMOP_ONLINE, nid, start_pfn, + nr_pages); strcat(buf, default_zone->name); =20 print_allowed_zone(buf, nid, start_pfn, nr_pages, MMOP_ONLINE_KERNEL, diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplu= g.h index 3195d11876ea..3aaf00db224c 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -47,9 +47,13 @@ enum { =20 /* Types for control the zone type of onlined and offlined memory */ enum { + /* Offline the memory. */ MMOP_OFFLINE =3D -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, }; =20 --=20 2.24.1