Re: [PATCH] mm/hotplug: only free wait_table if it's allocated by vmalloc

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

 



On 03/22/2013 05:54 PM, Jianguo Wu wrote:
zone->wait_table may be allocated from bootmem, it can not be freed.

Cc: Andrew Morton<akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Wen Congyang<wency@xxxxxxxxxxxxxx>
Cc: Tang Chen<tangchen@xxxxxxxxxxxxxx>
Cc: Jiang Liu<jiang.liu@xxxxxxxxxx>
Cc: linux-mm@xxxxxxxxx
Signed-off-by: Jianguo Wu<wujianguo@xxxxxxxxxx>
---
  mm/memory_hotplug.c |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 07b6263..91ed7cd 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1779,7 +1779,11 @@ void try_offline_node(int nid)
  	for (i = 0; i<  MAX_NR_ZONES; i++) {
  		struct zone *zone = pgdat->node_zones + i;

-		if (zone->wait_table)
+		/*
+		 * wait_table may be allocated from boot memory,
+		 * here only free if it's allocated by vmalloc.
+		 */
+		if (is_vmalloc_addr(zone->wait_table))
  			vfree(zone->wait_table);

Reviewed-by: Tang Chen <tangchen@xxxxxxxxxxxxxx>

FYI, I'm trying add a flag member into memblock to mark memory whose
life cycle is the same as a node. I think maybe this flag could be used
to free this kind of memory from bootmem.

Thanks. :)


  	}


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


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