Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp509054ybh; Wed, 11 Mar 2020 05:31:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvqubXE8fKbK/MozhJWb1UBSB1HTpw7WhPG5oYxGvxtQGYmAV57zGcXHcEPSEYoPjW/0bWr X-Received: by 2002:a4a:8dd9:: with SMTP id a25mr299790ool.69.1583929893720; Wed, 11 Mar 2020 05:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583929893; cv=none; d=google.com; s=arc-20160816; b=yz2hmu0ylsZ6rkeUzy98cp13XXCDRfJSwbkdDd1ne+M93m/DIFJVXFLjwCnnMC8MyQ t/nDEnJfwJ9CzXXNlyGIFs4zqGNnSNnOaAvwmKj5gKmJFZ7J06adNZqDBl8yOQMRpaGo pp4d+Ac+2qrSKTdRRAmDCF+lgeVU8X0UVD7YMkk5IrCPw76G4Q0bUWu/wNOMDk2nd+F+ GON/W+nvj4nUbwrnNjq63S+rLz+PehYpgNKsHfWY2p/G3voEVIP4Yy8rDSRJ4GX0WxtH 3WEY5LXJ5EZ9ItXsIVHquDA1OPmp1BMdZ/WiCPB7Vc5fvu5IAljuK5zjqLhBE6vXvv0O KBQw== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=0PFnYncdR71VA2SBTKHYdn9p5aztn1GjhQsJsLTG0A4=; b=nP+iELE7DlseL6EjC9dIyzqfPNkZ2kE7B3r/dWPsNzuYQrCq4p2O9FRs/W8phKPFGQ 7jDWpmIp3Te+prRxHbzt2FM4qGn5OjjoemYU6D3yF84EDLXJgDhw9BAeGm0hK5tvBHP6 yfzdk2HnvtKA06Y31kCwVyKhgYiOhJgmMgjy5iZg+dFZ5FTzzejaY8lZDh26wHlovjzu llwmShO8qWija2RXTHUwCDJNhruNkj8O2lrBb2TSJaSptgz2/NynqNu9lxPa+Un67L1D 1/ck6b4jthjK/9TCkI3RgxiktWblgaIEn1zpYrSDUZp/HEWFo0fM12YiK4jdMxSMtttL k2Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=St+wsL4O; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u135si1107834oif.248.2020.03.11.05.31.21; Wed, 11 Mar 2020 05:31:33 -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=@redhat.com header.s=mimecast20190719 header.b=St+wsL4O; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729372AbgCKMaw (ORCPT + 99 others); Wed, 11 Mar 2020 08:30:52 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:22641 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729255AbgCKMar (ORCPT ); Wed, 11 Mar 2020 08:30:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583929846; 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=0PFnYncdR71VA2SBTKHYdn9p5aztn1GjhQsJsLTG0A4=; b=St+wsL4O0rxvIRDjQE2wOeKKd48vEXwFT4WtJV9sdI16KjrHKMXZthOY4nbcDc17t5RZLo wqOu3W1diwYc3tugQ2rJJRKDfpMgsuh5FPIZMMW9lVxJFiXRg9x3k9+sqz8Ca0QqW1rBi8 E0hRvNDN9Nr/DcvhUXuGXIBf0G1c9WY= 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-486-hSNViO6CNkKeyz3wpahNdQ-1; Wed, 11 Mar 2020 08:30:42 -0400 X-MC-Unique: hSNViO6CNkKeyz3wpahNdQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6AAA2801E67; Wed, 11 Mar 2020 12:30:40 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.36.118.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AFCC5C1D4; Wed, 11 Mar 2020 12:30:37 +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 , Greg Kroah-Hartman , Andrew Morton , Michal Hocko , Oscar Salvador , "Rafael J. Wysocki" , Baoquan He , Wei Yang Subject: [PATCH v1 1/5] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE Date: Wed, 11 Mar 2020 13:30:22 +0100 Message-Id: <20200311123026.16071-2-david@redhat.com> In-Reply-To: <20200311123026.16071-1-david@redhat.com> References: <20200311123026.16071-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. 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 --- 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 f4d59155f3d4..261dbf010d5d 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