linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: kkabe@vega.pgw.jp
Cc: david@redhat.com, osalvador@suse.de,
	bugzilla-daemon@bugzilla.kernel.org, akpm@linux-foundation.org,
	richardw.yang@linux.intel.com, mhocko@kernel.org,
	n-horiguchi@ah.jp.nec.com, linux-mm@kvack.org
Subject: Re: [Bug 206401] kernel panic on Hyper-V after 5 minutes due to memory hot-add
Date: Wed, 19 Feb 2020 11:39:43 +0800	[thread overview]
Message-ID: <20200219033943.GA24216@MiWiFi-R3L-srv> (raw)
In-Reply-To: <200218152448.M0114841@vega.pgw.jp>

On 02/18/20 at 03:24pm, kkabe@vega.pgw.jp wrote:
> bhe@redhat.com 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



      parent reply	other threads:[~2020-02-19  3:39 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-206401-27@https.bugzilla.kernel.org/>
     [not found] ` <bug-206401-27-zYD8WfDKqD@https.bugzilla.kernel.org/>
2020-02-10  5:32   ` Andrew Morton
2020-02-10  5:40     ` Baoquan He
2020-02-10  5:56       ` Andrew Morton
2020-02-10  6:09         ` Baoquan He
2020-02-10  6:15           ` Baoquan He
2020-02-10 23:07             ` Wei Yang
2020-02-12  0:41               ` Andrew Morton
2020-02-12  7:31                 ` Baoquan He
2020-02-12  8:21                   ` David Hildenbrand
2020-02-13  4:22                   ` [Bug 206401] kernel panic on Hyper-V after 5 minutes due tomemory hot-add kabe
2020-02-13  8:19                     ` Baoquan He
2020-02-14 14:26                       ` [Bug 206401] kernel panic on Hyper-V after 5 minutes duetomemory hot-add kkabe
2020-02-14 14:48                         ` Baoquan He
2020-02-14 15:01                           ` Baoquan He
2020-02-17  4:48                         ` Baoquan He
2020-02-17  5:31                           ` [Bug 206401] kernel panic on Hyper-V after 5 minutes duetomemoryhot-add kkabe
2020-02-17  8:00                             ` David Hildenbrand
2020-02-17 10:33                         ` [Bug 206401] kernel panic on Hyper-V after 5 minutes duetomemory hot-add Michal Hocko
2020-02-17 11:21                           ` [Bug 206401] kernel panic on Hyper-V after 5 minutes due to memory hot-add kkabe
2020-02-17  5:46                   ` kkabe
2020-02-17  7:44                     ` Baoquan He
2020-02-17  9:34                     ` Oscar Salvador
2020-02-17 10:13                       ` Baoquan He
2020-02-17 10:17                         ` Baoquan He
2020-02-17 10:24                         ` David Hildenbrand
2020-02-17 10:33                           ` Baoquan He
2020-02-17 10:38                             ` David Hildenbrand
2020-02-17 11:20                               ` Baoquan He
2020-02-17 12:47                                 ` Michal Hocko
2020-02-18  6:24                                 ` kkabe
2020-02-18  8:47                                   ` Michal Hocko
2020-02-18  9:19                                     ` kkabe
2020-02-18  9:26                                       ` David Hildenbrand
2020-02-18 10:05                                       ` [RFC PATCH] memory_hotplug: disable the functionality for 32b (was: Re: [Bug 206401] kernel panic on Hyper-V after 5 minutes due to) " Michal Hocko
2020-02-18 10:11                                         ` David Hildenbrand
2020-02-19  3:23                                         ` Baoquan He
2020-02-19 21:46                                         ` Andrew Morton
2020-02-19 23:07                                           ` [RFC PATCH] memory_hotplug: disable the functionality for 32b Robin Murphy
2020-02-19  3:39                                   ` Baoquan He [this message]

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=20200219033943.GA24216@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=david@redhat.com \
    --cc=kkabe@vega.pgw.jp \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=osalvador@suse.de \
    --cc=richardw.yang@linux.intel.com \
    /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