linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: David Hildenbrand <david@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Jason Wang <jasowang@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
	Paul Mackerras <paulus@samba.org>,
	linux-kselftest@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Shuah Khan <shuah@kernel.org>, Alex Shi <alexs@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org, Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH v1 4/6] mm/memory_hotplug: remove HIGHMEM leftovers
Date: Thu, 7 Oct 2021 11:13:19 +0200	[thread overview]
Message-ID: <YV66LwMsEqYCHWPa@localhost.localdomain> (raw)
In-Reply-To: <20210929143600.49379-5-david@redhat.com>

On Wed, Sep 29, 2021 at 04:35:58PM +0200, David Hildenbrand wrote:
> We don't support CONFIG_MEMORY_HOTPLUG on 32 bit and consequently not
> HIGHMEM. Let's remove any leftover code -- including the unused
> "status_change_nid_high" field part of the memory notifier.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>

> ---
>  Documentation/core-api/memory-hotplug.rst     |  3 --
>  .../zh_CN/core-api/memory-hotplug.rst         |  4 ---
>  include/linux/memory.h                        |  1 -
>  mm/memory_hotplug.c                           | 36 ++-----------------
>  4 files changed, 2 insertions(+), 42 deletions(-)
> 
> diff --git a/Documentation/core-api/memory-hotplug.rst b/Documentation/core-api/memory-hotplug.rst
> index de7467e48067..682259ee633a 100644
> --- a/Documentation/core-api/memory-hotplug.rst
> +++ b/Documentation/core-api/memory-hotplug.rst
> @@ -57,7 +57,6 @@ The third argument (arg) passes a pointer of struct memory_notify::
>  		unsigned long start_pfn;
>  		unsigned long nr_pages;
>  		int status_change_nid_normal;
> -		int status_change_nid_high;
>  		int status_change_nid;
>  	}
>  
> @@ -65,8 +64,6 @@ The third argument (arg) passes a pointer of struct memory_notify::
>  - nr_pages is # of pages of online/offline memory.
>  - status_change_nid_normal is set node id when N_NORMAL_MEMORY of nodemask
>    is (will be) set/clear, if this is -1, then nodemask status is not changed.
> -- status_change_nid_high is set node id when N_HIGH_MEMORY of nodemask
> -  is (will be) set/clear, if this is -1, then nodemask status is not changed.
>  - status_change_nid is set node id when N_MEMORY of nodemask is (will be)
>    set/clear. It means a new(memoryless) node gets new memory by online and a
>    node loses all memory. If this is -1, then nodemask status is not changed.
> diff --git a/Documentation/translations/zh_CN/core-api/memory-hotplug.rst b/Documentation/translations/zh_CN/core-api/memory-hotplug.rst
> index 161f4d2c18cc..9a204eb196f2 100644
> --- a/Documentation/translations/zh_CN/core-api/memory-hotplug.rst
> +++ b/Documentation/translations/zh_CN/core-api/memory-hotplug.rst
> @@ -63,7 +63,6 @@ memory_notify结构体的指针::
>  		unsigned long start_pfn;
>  		unsigned long nr_pages;
>  		int status_change_nid_normal;
> -		int status_change_nid_high;
>  		int status_change_nid;
>  	}
>  
> @@ -74,9 +73,6 @@ memory_notify结构体的指针::
>  - status_change_nid_normal是当nodemask的N_NORMAL_MEMORY被设置/清除时设置节
>    点id,如果是-1,则nodemask状态不改变。
>  
> -- status_change_nid_high是当nodemask的N_HIGH_MEMORY被设置/清除时设置的节点
> -  id,如果这个值为-1,那么nodemask状态不会改变。
> -
>  - status_change_nid是当nodemask的N_MEMORY被(将)设置/清除时设置的节点id。这
>    意味着一个新的(没上线的)节点通过联机获得新的内存,而一个节点失去了所有的内
>    存。如果这个值为-1,那么nodemask的状态就不会改变。
> diff --git a/include/linux/memory.h b/include/linux/memory.h
> index dd6e608c3e0b..c46ff374d48d 100644
> --- a/include/linux/memory.h
> +++ b/include/linux/memory.h
> @@ -96,7 +96,6 @@ struct memory_notify {
>  	unsigned long start_pfn;
>  	unsigned long nr_pages;
>  	int status_change_nid_normal;
> -	int status_change_nid_high;
>  	int status_change_nid;
>  };
>  
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 8d7b2b593a26..95c927c8bfb8 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -21,7 +21,6 @@
>  #include <linux/memory.h>
>  #include <linux/memremap.h>
>  #include <linux/memory_hotplug.h>
> -#include <linux/highmem.h>
>  #include <linux/vmalloc.h>
>  #include <linux/ioport.h>
>  #include <linux/delay.h>
> @@ -585,10 +584,6 @@ void generic_online_page(struct page *page, unsigned int order)
>  	debug_pagealloc_map_pages(page, 1 << order);
>  	__free_pages_core(page, order);
>  	totalram_pages_add(1UL << order);
> -#ifdef CONFIG_HIGHMEM
> -	if (PageHighMem(page))
> -		totalhigh_pages_add(1UL << order);
> -#endif
>  }
>  EXPORT_SYMBOL_GPL(generic_online_page);
>  
> @@ -625,16 +620,11 @@ static void node_states_check_changes_online(unsigned long nr_pages,
>  
>  	arg->status_change_nid = NUMA_NO_NODE;
>  	arg->status_change_nid_normal = NUMA_NO_NODE;
> -	arg->status_change_nid_high = NUMA_NO_NODE;
>  
>  	if (!node_state(nid, N_MEMORY))
>  		arg->status_change_nid = nid;
>  	if (zone_idx(zone) <= ZONE_NORMAL && !node_state(nid, N_NORMAL_MEMORY))
>  		arg->status_change_nid_normal = nid;
> -#ifdef CONFIG_HIGHMEM
> -	if (zone_idx(zone) <= ZONE_HIGHMEM && !node_state(nid, N_HIGH_MEMORY))
> -		arg->status_change_nid_high = nid;
> -#endif
>  }
>  
>  static void node_states_set_node(int node, struct memory_notify *arg)
> @@ -642,9 +632,6 @@ static void node_states_set_node(int node, struct memory_notify *arg)
>  	if (arg->status_change_nid_normal >= 0)
>  		node_set_state(node, N_NORMAL_MEMORY);
>  
> -	if (arg->status_change_nid_high >= 0)
> -		node_set_state(node, N_HIGH_MEMORY);
> -
>  	if (arg->status_change_nid >= 0)
>  		node_set_state(node, N_MEMORY);
>  }
> @@ -1801,7 +1788,6 @@ static void node_states_check_changes_offline(unsigned long nr_pages,
>  
>  	arg->status_change_nid = NUMA_NO_NODE;
>  	arg->status_change_nid_normal = NUMA_NO_NODE;
> -	arg->status_change_nid_high = NUMA_NO_NODE;
>  
>  	/*
>  	 * Check whether node_states[N_NORMAL_MEMORY] will be changed.
> @@ -1816,24 +1802,9 @@ static void node_states_check_changes_offline(unsigned long nr_pages,
>  	if (zone_idx(zone) <= ZONE_NORMAL && nr_pages >= present_pages)
>  		arg->status_change_nid_normal = zone_to_nid(zone);
>  
> -#ifdef CONFIG_HIGHMEM
> -	/*
> -	 * node_states[N_HIGH_MEMORY] contains nodes which
> -	 * have normal memory or high memory.
> -	 * Here we add the present_pages belonging to ZONE_HIGHMEM.
> -	 * If the zone is within the range of [0..ZONE_HIGHMEM), and
> -	 * we determine that the zones in that range become empty,
> -	 * we need to clear the node for N_HIGH_MEMORY.
> -	 */
> -	present_pages += pgdat->node_zones[ZONE_HIGHMEM].present_pages;
> -	if (zone_idx(zone) <= ZONE_HIGHMEM && nr_pages >= present_pages)
> -		arg->status_change_nid_high = zone_to_nid(zone);
> -#endif
> -
>  	/*
> -	 * We have accounted the pages from [0..ZONE_NORMAL), and
> -	 * in case of CONFIG_HIGHMEM the pages from ZONE_HIGHMEM
> -	 * as well.
> +	 * We have accounted the pages from [0..ZONE_NORMAL); ZONE_HIGHMEM
> +	 * does not apply as we don't support 32bit.
>  	 * Here we count the possible pages from ZONE_MOVABLE.
>  	 * If after having accounted all the pages, we see that the nr_pages
>  	 * to be offlined is over or equal to the accounted pages,
> @@ -1851,9 +1822,6 @@ static void node_states_clear_node(int node, struct memory_notify *arg)
>  	if (arg->status_change_nid_normal >= 0)
>  		node_clear_state(node, N_NORMAL_MEMORY);
>  
> -	if (arg->status_change_nid_high >= 0)
> -		node_clear_state(node, N_HIGH_MEMORY);
> -
>  	if (arg->status_change_nid >= 0)
>  		node_clear_state(node, N_MEMORY);
>  }
> -- 
> 2.31.1
> 
> 

-- 
Oscar Salvador
SUSE Labs

  reply	other threads:[~2021-10-07  9:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 14:35 [PATCH v1 0/6] mm/memory_hotplug: Kconfig and 32 bit cleanups David Hildenbrand
2021-09-29 14:35 ` [PATCH v1 1/6] mm/memory_hotplug: remove CONFIG_X86_64_ACPI_NUMA dependency from CONFIG_MEMORY_HOTPLUG David Hildenbrand
2021-10-07  8:09   ` Oscar Salvador
2021-09-29 14:35 ` [PATCH v1 2/6] mm/memory_hotplug: remove CONFIG_MEMORY_HOTPLUG_SPARSE David Hildenbrand
2021-10-05 13:43   ` Greg Kroah-Hartman
2021-10-05 14:22   ` Shuah Khan
2021-10-07  8:20   ` Oscar Salvador
2021-09-29 14:35 ` [PATCH v1 3/6] mm/memory_hotplug: restrict CONFIG_MEMORY_HOTPLUG to 64 bit David Hildenbrand
2021-10-07  9:02   ` Oscar Salvador
2021-09-29 14:35 ` [PATCH v1 4/6] mm/memory_hotplug: remove HIGHMEM leftovers David Hildenbrand
2021-10-07  9:13   ` Oscar Salvador [this message]
2021-09-29 14:35 ` [PATCH v1 5/6] mm/memory_hotplug: remove stale function declarations David Hildenbrand
2021-10-07  9:14   ` Oscar Salvador
2021-09-29 14:36 ` [PATCH v1 6/6] x86: remove memory hotplug support on X86_32 David Hildenbrand
2021-10-07  9:15   ` Oscar Salvador
2021-10-07  9:27     ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YV66LwMsEqYCHWPa@localhost.localdomain \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jasowang@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luto@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=mst@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).