On Wed, Apr 11, 2018 at 01:29:59PM +0100, Anatoly Burakov wrote: > If a user has specified that the zone should have contiguous memory, > use the new _contig allocation API's instead of normal ones. > Otherwise, account for the fact that unless we're in IOVA_AS_VA > mode, we cannot guarantee that the pages would be physically > contiguous, so we calculate the memzone size and alignments as if > we were getting the smallest page size available. > > However, for the non-IOVA contiguous case, existing mempool size > calculation function doesn't give us expected results, because it > will return memzone sizes aligned to page size (e.g. a 1MB mempool > may use an entire 1GB page), therefore in cases where we weren't > specifically asked to reserve non-contiguous memory, first try > reserving a memzone as IOVA-contiguous, and if that fails, then > try reserving with page-aligned size/alignment. > > Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com> > Tested-by: Santosh Shukla <santosh.shu...@caviumnetworks.com> > Tested-by: Hemant Agrawal <hemant.agra...@nxp.com> > Tested-by: Gowrishankar Muthukrishnan <gowrishanka...@linux.vnet.ibm.com>
Acked-by: Olivier Matz <olivier.m...@6wind.com>