From: Chenghai Huang <huangchenghai2@huawei.com> When the requested memory pool size is greater than 1M, a certain amount of redundancy is reserved to avoid memory pool allocation failure. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Zongyu Wu <wuzongyu1@huawei.com> --- v1/wd_bmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v1/wd_bmm.c b/v1/wd_bmm.c index c58484f..dd20ff7 100644 --- a/v1/wd_bmm.c +++ b/v1/wd_bmm.c @@ -122,7 +122,7 @@ static int wd_pool_pre_layout(struct wd_queue *q, * ensure that the allocated memory is an integer multiple of 1M. */ if (!sp->br.alloc && !qinfo->iommu_type) - p->act_mem_sz = (p->act_mem_sz + BLK_BALANCE_SZ - 1) & ~(BLK_BALANCE_SZ - 1); + p->act_mem_sz = ((p->act_mem_sz + BLK_BALANCE_SZ - 1) & ~(BLK_BALANCE_SZ - 1)) << 1; return WD_SUCCESS; } -- 2.33.0