Commit 3dc2f209 authored by ZhangPeng's avatar ZhangPeng Committed by Christoph Hellwig
Browse files

swiotlb: check alloc_size before the allocation of a new memory pool



The allocation request for swiotlb contiguous memory greater than
128*2KB cannot be fulfilled because it exceeds the maximum contiguous
memory limit. If the swiotlb memory we allocate is larger than 128*2KB,
swiotlb_find_slots() will still schedule the allocation of a new memory
pool, which will increase memory overhead.

Fix it by adding a check with alloc_size no more than 128*2KB before
scheduling the allocation of a new memory pool in swiotlb_find_slots().

Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: default avatarPetr Tesarik <petr.tesarik1@huawei-partners.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent b07bc234
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment