diff options
author | ZhangPeng <zhangpeng362@huawei.com> | 2024-01-09 03:45:47 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2024-01-09 16:58:36 +0100 |
commit | 3dc2f209208dddc73ffd1d817081711343de3242 (patch) | |
tree | bdee8b0c9e9a663690290fd2a6bcbaa228898633 /.clang-format | |
parent | dma-mapping: clear dev->dma_mem to NULL after freeing it (diff) | |
download | linux-3dc2f209208dddc73ffd1d817081711343de3242.tar.xz linux-3dc2f209208dddc73ffd1d817081711343de3242.zip |
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: ZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: Petr Tesarik <petr.tesarik1@huawei-partners.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions