CHROMIUM: verity: use alloc_page instead of mempool_alloc
I ran a quick test and verified that mempool_alloc we are never
hitting the remove_element path of mempool_alloc so the 8MB of
mempool memory is never actually used.
Since dm-verity is read-only, its not part of memory reclaim. So a
memory pool is not neccesary. Since we alloc with GFP_KERNEL, an
allocation failure is highly unlikely. If an allocation does fail,
we already have code to handle the failure.
By removing the memory pool, we save 8 MB of RAM and save 1 ms on boot:
[ 0.974280] before mempool_create_page_pool
[ 0.975345] after mempool_create_page_pool
BUG=chromium-os:9752
TEST=Ran dm-verity.git unit tests. Ran platform_DMVerityCorruption on H/W.
Also ran platform_BootPerfServer:
Before:
seconds_power_on_to_login 8.81
seconds_power_on_to_login{1} 8.76
seconds_power_on_to_login{2} 9.24
seconds_power_on_to_login{3} 8.83
seconds_power_on_to_login{4} 8.76
seconds_power_on_to_login{5} 8.84
seconds_power_on_to_login{6} 8.86
seconds_power_on_to_login{7} 8.86
seconds_power_on_to_login{8} 8.86
seconds_power_on_to_login{9} 8.97
Mean: 8.87
Stdev: 0.14
After:
seconds_power_on_to_login 8.92
seconds_power_on_to_login{1} 9.06
seconds_power_on_to_login{2} 8.96
seconds_power_on_to_login{3} 8.71
seconds_power_on_to_login{4} 8.99
seconds_power_on_to_login{5} 8.89
seconds_power_on_to_login{6} 8.77
seconds_power_on_to_login{7} 8.96
seconds_power_on_to_login{8} 8.95
seconds_power_on_to_login{9} 8.95
Mean: 8.91
Stdev 0.10
The difference between the two runs is within stdev.
Change-Id: I9eddf2f01e6d3f09a010622d09485fac0924a8db
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4584