Re: [Bug 206401] kernel panic on Hyper-V after 5 minutes due to memory hot-add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/18/20 at 03:24pm, kkabe@xxxxxxxxxxx wrote:
> bhe@xxxxxxxxxx sed in <20200217112054.GA9823@MiWiFi-R3L-srv>
> >> Please try below code instead, see if it works. However, as David and
> >> and Michal said in other reply, if no real use case, we may not be so
> >> eager to support mem hotplug on i386. 
> >> 
> >> 
> >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> >> index 475d0d68a32c..9faf47bd026e 100644
> >> --- a/mm/memory_hotplug.c
> >> +++ b/mm/memory_hotplug.c
> >> @@ -715,15 +715,20 @@ static struct zone *default_kernel_zone_for_pfn(int nid, unsigned long start_pfn
> >>  {
> >>  	struct pglist_data *pgdat = NODE_DATA(nid);
> >>  	int zid;
> >> +	enum zone_type default_zone = ZONE_NORMAL;
> >>  
> >> -	for (zid = 0; zid <= ZONE_NORMAL; zid++) {
> >> +#ifdef CONFIG_HIGHMEM
> >> +	default_zone = ZONE_HIGHMEM;
> >> +#endif
> >> +
> >> +	for (zid = 0; zid <= default_zone; zid++) {
> >>  		struct zone *zone = &pgdat->node_zones[zid];
> >>  
> >>  		if (zone_intersects(zone, start_pfn, nr_pages))
> >>  			return zone;
> >>  	}
> >>  
> >> -	return &pgdat->node_zones[ZONE_NORMAL];
> >> +	return &pgdat->node_zones[default_zone];
> >>  }
> >>  
> >>  static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn,
> >> 
> >> 
> 
> Tried out the above patch.
> It seems to be working; no panic, total memory has increased and
> the hot-added memory is added as HIGHMEM.

> Minimal install of 168MB memory worked, so this time the sample is
> running anaconda installer starting at 512MB.
> Eventually memory was hot-added to around 1.2GB.
> 
> The weird pr_info() from populate_section_memmap() is still remaining though...
> 
> 2nd parameter of add_memory() (phys_addr_t, 32bit on non-PAE) is 
> going up to 0x60000000, so drivers/hv/hv_balloon.c:hv_mem_hot_add() may need
> limit check to not overflow 4GB for heavier usage.
> (Yes you should limit it in hypervisor dialog, but default is 1TB)
> 
> 
> Do we need modifications for arch/x86/mm/init_32.c:arch_add_memory()
> so that the hot-added memory is always in highmem area?
> Currently it just >>PAGE_SHIFT given parameters and call generic __add_pages().

Hmm, it may not be hot added into highmem area always, if possible, it can be
added into movable area. From my point of view, the above change is
enough to make it work.

Sorry, man. The i386 is too old, as you see, people is more willing to
deprecate it so that focus on 64bit arch. You can still patch your
kernel with above code change for a while, but possibly won't be very
long.

Thanks
Baoquan






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux