swiotlb: Use page alignment for early buffer allocation
authorYinghai Lu <yinghai@kernel.org>
Mon, 11 Oct 2010 17:40:25 +0000 (10:40 -0700)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 11 Oct 2010 21:08:36 +0000 (17:08 -0400)
commite79f86b2ef9c0a8c47225217c1018b7d3d90101c
tree53ba03cad303a566831fa03ebbfc408ab36ae36c
parent03620b2d7545fee29ecd3bb270f206b9cff75e58
swiotlb: Use page alignment for early buffer allocation

We could call free_bootmem_late() if swiotlb is not used, and
it will shrink to page alignment.

So alloc them with page alignment at first, to avoid lose two pages

before patch:
[    0.000000]     memblock_x86_reserve_range: [00d360000000d7600000]   swiotlb buffer
[    0.000000]     memblock_x86_reserve_range: [00d7e7ef4000d7e9ef40]     swiotlb list
[    0.000000]     memblock_x86_reserve_range: [00d7e3ef4000d7e7ef40]  swiotlb orig_ad
[    0.000000]     memblock_x86_reserve_range: [000008a0000000092000]  swiotlb overflo

after patch will get
[    0.000000]     memblock_x86_reserve_range: [00d360000000d7600000]   swiotlb buffer
[    0.000000]     memblock_x86_reserve_range: [00d7e7e00000d7e9e000]     swiotlb list
[    0.000000]     memblock_x86_reserve_range: [00d7e3e00000d7e7e000]  swiotlb orig_ad
[    0.000000]     memblock_x86_reserve_range: [000008a0000000092000]  swiotlb overflo

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
lib/swiotlb.c