On 8/17/24 1:42 AM, Zhu Yanjun wrote:
When workqueue_flush is invoked, WQ_MEM_RECLAIM is checked to avoid
errors.
This description is too brief and not entirely correct. In the
description of this patch it should be explained that WQ_MEM_RECLAIM
must be set for workqueues that are flushed from a work item queued on
a WQ_MEM_RECLAIM workqueue or from a memory reclaim context. Otherwise a
deadlock can occur. From kernel/workqueue.c:
/**
* check_flush_dependency - check for flush dependency sanity
* @target_wq: workqueue being flushed
* @target_work: work item being flushed (NULL for workqueue flushes)
*
* %current is trying to flush the whole @target_wq or @target_work on it.
* If @target_wq doesn't have %WQ_MEM_RECLAIM, verify that %current is not
* reclaiming memory or running on a workqueue which doesn't have
* %WQ_MEM_RECLAIM as that can break forward-progress guarantee leading to
* a deadlock.
*/
Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-lkp/202408151633.fc01893c-oliver.sang@xxxxxxxxx
Signed-off-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxx>
Since this is a fix, please include a "Fixes:" tag.
Thanks,
Bart.