Re: [PATCH 2/2] mem-hotplug: Fix wrong check for zone->pageset initialization in online_pages().

From: Tang Chen
Date: Tue Nov 04 2014 - 21:18:41 EST


On 11/05/2014 09:01 AM, Kamezawa Hiroyuki wrote:
> ......
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 3ab01b2..bc0de0f 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1013,9 +1013,13 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
> * If this zone is not populated, then it is not in zonelist.
> * This means the page allocator ignores this zone.
> * So, zonelist must be updated after online.
> + *
> + * If this zone is populated, zone->pageset could be initialized
> + * to boot_pageset for the first time a node is added. If so,
> + * zone->pageset should be allocated.
> */
> mutex_lock(&zonelists_mutex);
> - if (!populated_zone(zone)) {
> + if (!populated_zone(zone) || !zone_pcp_initialized(zone)) {
> Please don't add another strange meanings to zone's pcplist.
>
> If you say zone->present_pages doesn't mean zone has pages in buddy list any more,
> please rewrite all parts using zone->present_pages including populated_zone().

Adding Liu Jiang...

I think zone->managed_pages was introduced by Liu Jiang in the following
patch: