[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50DA7533.6060407@jp.fujitsu.com>
Date: Wed, 26 Dec 2012 12:55:31 +0900
From: Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Tang Chen <tangchen@...fujitsu.com>
CC: akpm@...ux-foundation.org, rientjes@...gle.com, liuj97@...il.com,
len.brown@...el.com, benh@...nel.crashing.org, paulus@...ba.org,
cl@...ux.com, minchan.kim@...il.com,
kosaki.motohiro@...fujitsu.com, isimatu.yasuaki@...fujitsu.com,
wujianguo@...wei.com, wency@...fujitsu.com, hpa@...or.com,
linfeng@...fujitsu.com, laijs@...fujitsu.com, mgorman@...e.de,
yinghai@...nel.org, x86@...nel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-acpi@...r.kernel.org, linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org, linux-ia64@...r.kernel.org,
cmetcalf@...era.com, sparclinux@...r.kernel.org
Subject: Re: [PATCH v5 14/14] memory-hotplug: free node_data when a node is
offlined
(2012/12/24 21:09), Tang Chen wrote:
> From: Wen Congyang <wency@...fujitsu.com>
>
> We call hotadd_new_pgdat() to allocate memory to store node_data. So we
> should free it when removing a node.
>
> Signed-off-by: Wen Congyang <wency@...fujitsu.com>
I'm sorry but is it safe to remove pgdat ? All zone cache and zonelists are
properly cleared/rebuilded in synchronous way ? and No threads are visinting
zone in vmscan.c ?
Thanks,
-Kame
> ---
> mm/memory_hotplug.c | 20 +++++++++++++++++++-
> 1 files changed, 19 insertions(+), 1 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index f8a1d2f..447fa24 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1680,9 +1680,12 @@ static int check_cpu_on_node(void *data)
> /* offline the node if all memory sections of this node are removed */
> static void try_offline_node(int nid)
> {
> + pg_data_t *pgdat = NODE_DATA(nid);
> unsigned long start_pfn = NODE_DATA(nid)->node_start_pfn;
> - unsigned long end_pfn = start_pfn + NODE_DATA(nid)->node_spanned_pages;
> + unsigned long end_pfn = start_pfn + pgdat->node_spanned_pages;
> unsigned long pfn;
> + struct page *pgdat_page = virt_to_page(pgdat);
> + int i;
>
> for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
> unsigned long section_nr = pfn_to_section_nr(pfn);
> @@ -1709,6 +1712,21 @@ static void try_offline_node(int nid)
> */
> node_set_offline(nid);
> unregister_one_node(nid);
> +
> + if (!PageSlab(pgdat_page) && !PageCompound(pgdat_page))
> + /* node data is allocated from boot memory */
> + return;
> +
> + /* free waittable in each zone */
> + for (i = 0; i < MAX_NR_ZONES; i++) {
> + struct zone *zone = pgdat->node_zones + i;
> +
> + if (zone->wait_table)
> + vfree(zone->wait_table);
> + }
> +
> + arch_refresh_nodedata(nid, NULL);
> + arch_free_nodedata(pgdat);
> }
>
> int __ref remove_memory(int nid, u64 start, u64 size)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists