]> git.openfabrics.org - ~emulex/infiniband.git/commit
powerpc: implement vmemmap_list_free()
authorLi Zhong <zhong@linux.vnet.ibm.com>
Wed, 11 Jun 2014 08:23:36 +0000 (16:23 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 5 Aug 2014 06:34:10 +0000 (16:34 +1000)
commitbd8cb03dbe77a529945aa270a18c1ba074f729c6
tree0821484fbbca9af958605276570ca76465658d32
parenteeb03a6eaa02e9171f91e385c52a69b159fc6117
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 <zhong@linux.vnet.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/init_64.c