]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Bug fix: Reuse the storage of /sys/firmware/memmap/X/ allocated by bootmem.
authorTang Chen <tangchen@cn.fujitsu.com>
Wed, 20 Feb 2013 02:14:11 +0000 (13:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:28 +0000 (16:52 +1100)
commit74d7702adaabcb38a75eb90e8f889ef12eecf5ae
tree17401bf9a41cb68eb976c4d2ac65b42a94a3219d
parentf53a0fb65ef9da3e75fa6ac9452ade33cc402623
Bug fix: Reuse the storage of /sys/firmware/memmap/X/ allocated by bootmem.

Now we don't free firmware_map_entry which is allocated by bootmem because
there is no way to do so when the system is up. But we can at least remember
the address of that memory and reuse the storage when the memory is added
next time.

This patch introduces a new list map_entries_bootmem to link the map entries
allocated by bootmem when they are removed, and a lock to protect it.
And these entries will be reused when the memory is hot-added again.

The idea is suggestted by Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/firmware/memmap.c