mm/mempool: fix the entry condition for semaphore during mempool allocation

When the mempool uses the waitsem semaphore for memory allocation,
the flowing two conditions must be satisfied simultaneously:
its wait variable is set to true, and the expandsize variable is set to 0

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
This commit is contained in:
zhanxiaoqi
2026-02-27 14:36:22 +08:00
committed by archer
parent e3b1e5914e
commit 975968db1b

View File

@@ -394,6 +394,7 @@ retry:
blk = mempool_remove_queue(pool, &pool->queue);
}
else if (!pool->wait ||
pool->expandsize > 0 ||
nxsem_wait_uninterruptible(&pool->waitsem) < 0)
{
return NULL;