From bd8cb03dbe77a529945aa270a18c1ba074f729c6 Mon Sep 17 00:00:00 2001 From: Li Zhong Date: Wed, 11 Jun 2014 16:23:36 +0800 Subject: [PATCH] powerpc: implement vmemmap_list_free() This patch implements vmemmap_list_free() for vmemmap_free(). The freed entries will be removed from vmemmap_list, and form a freed list, with next as the header. The next position in the last allocated page is kept at the list tail. When allocation, if there are freed entries left, get it from the freed list; if no freed entries left, get it like before from the last allocated pages. With this change, realmode_pfn_to_page() also needs to be changed to walk all the entries in the vmemmap_list, as the virt_addr of the entries might not be stored in order anymore. It helps to reuse the memory when continuous doing memory hot-plug/remove operations, but didn't reclaim the pages already allocated, so the memory usage will only increase, but won't exceed the value for the largest memory configuration. Signed-off-by: Li Zhong Cc: Nathan Fontenot Acked-by: Nathan Fontenot Signed-off-by: Benjamin Herrenschmidt --- Reading git-format-patch failed