Re: [PATCH] mm/dmapool.c: add lock protect in dma_pool_destroy

From: Matthew Wilcox
Date: Wed Jul 22 2020 - 07:27:48 EST


On Wed, Jul 22, 2020 at 05:05:16PM +0800, qiang.zhang@xxxxxxxxxxxxx wrote:
> When traversing "pool->page" linked list, to prevent possible
> other path operations this list, causing it to be destroyed, we
> should add lock protect for this list in dma_pool_destroy func.

The pool is being destroyed. If somebody else is trying to allocate from
it while it's in the middle of being destroyed, there is a larger problem
to solve, and it can't be solved in the dmapool code.