Skip to content

Commit

Permalink
Revert "UBUNTU: SAUCE: mm: fix memory hotplug in ZONE_HIGHMEM"
Browse files Browse the repository at this point in the history
This patch may no longer be required. Try reverting it to run
a kernel through testing to see if the test failures which
prompted the patch are fixed.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
  • Loading branch information
Seth Forshee committed Jan 29, 2018
1 parent b3a8851 commit 7c26ca2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
3 changes: 0 additions & 3 deletions arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,6 @@ void __init mem_init(void)
* important here.
*/
set_highmem_pages_init();
#ifdef CONFIG_HIGHMEM
set_default_mem_hotplug_zone(ZONE_HIGHMEM);
#endif

/* this will put all low memory onto the freelists */
free_all_bootmem();
Expand Down
4 changes: 0 additions & 4 deletions include/linux/memory_hotplug.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ void put_online_mems(void);
void mem_hotplug_begin(void);
void mem_hotplug_done(void);

void set_default_mem_hotplug_zone(enum zone_type zone);

extern void set_zone_contiguous(struct zone *zone);
extern void clear_zone_contiguous(struct zone *zone);

Expand Down Expand Up @@ -286,8 +284,6 @@ static inline void put_online_mems(void) {}
static inline void mem_hotplug_begin(void) {}
static inline void mem_hotplug_done(void) {}

static inline void set_default_mem_hotplug_zone(enum zone_type zone) {}

static inline bool movable_node_is_enabled(void)
{
return false;
Expand Down
19 changes: 3 additions & 16 deletions mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ static DEFINE_MUTEX(online_page_callback_lock);

DEFINE_STATIC_PERCPU_RWSEM(mem_hotplug_lock);

static int default_kernel_zone = ZONE_NORMAL;

void get_online_mems(void)
{
percpu_down_read(&mem_hotplug_lock);
Expand Down Expand Up @@ -835,36 +833,25 @@ void __ref move_pfn_range_to_zone(struct zone *zone,
set_zone_contiguous(zone);
}

void set_default_mem_hotplug_zone(enum zone_type zone)
{
default_kernel_zone = zone;
}

#ifdef CONFIG_HIGHMEM
#define MAX_KERNEL_ZONE ZONE_HIGHMEM
#else
#define MAX_KERNEL_ZONE ZONE_NORMAL
#endif

/*
* Returns a default kernel memory zone for the given pfn range.
* If no kernel zone covers this pfn range it will automatically go
* to the MAX_KERNEL_ZONE.
* to the ZONE_NORMAL.
*/
static struct zone *default_kernel_zone_for_pfn(int nid, unsigned long start_pfn,
unsigned long nr_pages)
{
struct pglist_data *pgdat = NODE_DATA(nid);
int zid;

for (zid = 0; zid <= MAX_KERNEL_ZONE; zid++) {
for (zid = 0; zid <= ZONE_NORMAL; zid++) {
struct zone *zone = &pgdat->node_zones[zid];

if (zone_intersects(zone, start_pfn, nr_pages))
return zone;
}

return &pgdat->node_zones[default_kernel_zone];
return &pgdat->node_zones[ZONE_NORMAL];
}

static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn,
Expand Down

0 comments on commit 7c26ca2

Please sign in to comment.