mm/memory_hotplug: remove HIGHMEM leftovers

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.

Link: https://lkml.kernel.org/r/20210929143600.49379-5-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Alex Shi <alexs@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
David Hildenbrand 2021-11-05 13:44:31 -07:00 committed by Linus Torvalds
parent 7ec58a2b94
commit 6b740c6c3a
4 changed files with 2 additions and 42 deletions

View File

@ -57,7 +57,6 @@ The third argument (arg) passes a pointer of struct memory_notify::
unsigned long start_pfn; unsigned long start_pfn;
unsigned long nr_pages; unsigned long nr_pages;
int status_change_nid_normal; int status_change_nid_normal;
int status_change_nid_high;
int status_change_nid; 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. - nr_pages is # of pages of online/offline memory.
- status_change_nid_normal is set node id when N_NORMAL_MEMORY of nodemask - 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. 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) - 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 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. node loses all memory. If this is -1, then nodemask status is not changed.

View File

@ -63,7 +63,6 @@ memory_notify结构体的指针::
unsigned long start_pfn; unsigned long start_pfn;
unsigned long nr_pages; unsigned long nr_pages;
int status_change_nid_normal; int status_change_nid_normal;
int status_change_nid_high;
int status_change_nid; int status_change_nid;
} }
@ -74,9 +73,6 @@ memory_notify结构体的指针::
- status_change_nid_normal是当nodemask的N_NORMAL_MEMORY被设置/清除时设置节 - status_change_nid_normal是当nodemask的N_NORMAL_MEMORY被设置/清除时设置节
点id如果是-1则nodemask状态不改变。 点id如果是-1则nodemask状态不改变。
- status_change_nid_high是当nodemask的N_HIGH_MEMORY被设置/清除时设置的节点
id如果这个值为-1那么nodemask状态不会改变。
- status_change_nid是当nodemask的N_MEMORY被设置/清除时设置的节点id。这 - status_change_nid是当nodemask的N_MEMORY被设置/清除时设置的节点id。这
意味着一个新的(没上线的)节点通过联机获得新的内存,而一个节点失去了所有的内 意味着一个新的(没上线的)节点通过联机获得新的内存,而一个节点失去了所有的内
存。如果这个值为-1那么nodemask的状态就不会改变。 存。如果这个值为-1那么nodemask的状态就不会改变。

View File

@ -96,7 +96,6 @@ struct memory_notify {
unsigned long start_pfn; unsigned long start_pfn;
unsigned long nr_pages; unsigned long nr_pages;
int status_change_nid_normal; int status_change_nid_normal;
int status_change_nid_high;
int status_change_nid; int status_change_nid;
}; };

View File

@ -21,7 +21,6 @@
#include <linux/memory.h> #include <linux/memory.h>
#include <linux/memremap.h> #include <linux/memremap.h>
#include <linux/memory_hotplug.h> #include <linux/memory_hotplug.h>
#include <linux/highmem.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/delay.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); debug_pagealloc_map_pages(page, 1 << order);
__free_pages_core(page, order); __free_pages_core(page, order);
totalram_pages_add(1UL << order); totalram_pages_add(1UL << order);
#ifdef CONFIG_HIGHMEM
if (PageHighMem(page))
totalhigh_pages_add(1UL << order);
#endif
} }
EXPORT_SYMBOL_GPL(generic_online_page); 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 = NUMA_NO_NODE;
arg->status_change_nid_normal = 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)) if (!node_state(nid, N_MEMORY))
arg->status_change_nid = nid; arg->status_change_nid = nid;
if (zone_idx(zone) <= ZONE_NORMAL && !node_state(nid, N_NORMAL_MEMORY)) if (zone_idx(zone) <= ZONE_NORMAL && !node_state(nid, N_NORMAL_MEMORY))
arg->status_change_nid_normal = nid; 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) 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) if (arg->status_change_nid_normal >= 0)
node_set_state(node, N_NORMAL_MEMORY); 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) if (arg->status_change_nid >= 0)
node_set_state(node, N_MEMORY); 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 = NUMA_NO_NODE;
arg->status_change_nid_normal = 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. * 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) if (zone_idx(zone) <= ZONE_NORMAL && nr_pages >= present_pages)
arg->status_change_nid_normal = zone_to_nid(zone); arg->status_change_nid_normal = zone_to_nid(zone);
#ifdef CONFIG_HIGHMEM
/* /*
* node_states[N_HIGH_MEMORY] contains nodes which * We have accounted the pages from [0..ZONE_NORMAL); ZONE_HIGHMEM
* have normal memory or high memory. * does not apply as we don't support 32bit.
* 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.
* Here we count the possible pages from ZONE_MOVABLE. * Here we count the possible pages from ZONE_MOVABLE.
* If after having accounted all the pages, we see that the nr_pages * If after having accounted all the pages, we see that the nr_pages
* to be offlined is over or equal to the accounted 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) if (arg->status_change_nid_normal >= 0)
node_clear_state(node, N_NORMAL_MEMORY); 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) if (arg->status_change_nid >= 0)
node_clear_state(node, N_MEMORY); node_clear_state(node, N_MEMORY);
} }