* [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency
@ 2024-08-17 8:42 Zhu Yanjun
2024-08-19 18:38 ` Jason Gunthorpe
2024-08-19 19:28 ` Bart Van Assche
0 siblings, 2 replies; 5+ messages in thread
From: Zhu Yanjun @ 2024-08-17 8:42 UTC (permalink / raw)
To: bvanassche, leon, linux-rdma, shinichiro.kawasaki
Cc: Zhu Yanjun, kernel test robot
When workqueue_flush is invoked, WQ_MEM_RECLAIM is checked to avoid
errors.
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202408151633.fc01893c-oliver.sang@intel.com
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
drivers/infiniband/core/iwcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index 1a6339f3a63f..7e3a55349e10 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -1182,7 +1182,7 @@ static int __init iw_cm_init(void)
if (ret)
return ret;
- iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", 0);
+ iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", WQ_MEM_RECLAIM);
if (!iwcm_wq)
goto err_alloc;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency
2024-08-17 8:42 [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency Zhu Yanjun
@ 2024-08-19 18:38 ` Jason Gunthorpe
2024-08-19 22:38 ` Zhu Yanjun
2024-08-19 19:28 ` Bart Van Assche
1 sibling, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2024-08-19 18:38 UTC (permalink / raw)
To: Zhu Yanjun
Cc: bvanassche, leon, linux-rdma, shinichiro.kawasaki,
kernel test robot
On Sat, Aug 17, 2024 at 10:42:44AM +0200, Zhu Yanjun wrote:
> When workqueue_flush is invoked, WQ_MEM_RECLAIM is checked to avoid
> errors.
Include backtraces please, these things are tricky and we often have
to go back and figure out why.
Explaine exactly why it is needed with traces in the commit message
and summarize in a comment.
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency
2024-08-19 18:38 ` Jason Gunthorpe
@ 2024-08-19 22:38 ` Zhu Yanjun
0 siblings, 0 replies; 5+ messages in thread
From: Zhu Yanjun @ 2024-08-19 22:38 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: bvanassche, leon, linux-rdma, shinichiro.kawasaki,
kernel test robot
在 2024/8/20 2:38, Jason Gunthorpe 写道:
> On Sat, Aug 17, 2024 at 10:42:44AM +0200, Zhu Yanjun wrote:
>> When workqueue_flush is invoked, WQ_MEM_RECLAIM is checked to avoid
>> errors.
> Include backtraces please, these things are tricky and we often have
> to go back and figure out why.
>
> Explaine exactly why it is needed with traces in the commit message
> and summarize in a comment.
Got it. I will make changes in the commit log and add backtraces.
Zhu Yanjun
>
> Jason
--
Best Regards,
Yanjun.Zhu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency
2024-08-17 8:42 [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency Zhu Yanjun
2024-08-19 18:38 ` Jason Gunthorpe
@ 2024-08-19 19:28 ` Bart Van Assche
2024-08-19 22:42 ` Zhu Yanjun
1 sibling, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2024-08-19 19:28 UTC (permalink / raw)
To: Zhu Yanjun, leon, linux-rdma, shinichiro.kawasaki,
Jason Gunthorpe
Cc: kernel test robot
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@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202408151633.fc01893c-oliver.sang@intel.com
> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Since this is a fix, please include a "Fixes:" tag.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency
2024-08-19 19:28 ` Bart Van Assche
@ 2024-08-19 22:42 ` Zhu Yanjun
0 siblings, 0 replies; 5+ messages in thread
From: Zhu Yanjun @ 2024-08-19 22:42 UTC (permalink / raw)
To: Bart Van Assche, leon, linux-rdma, shinichiro.kawasaki,
Jason Gunthorpe
Cc: kernel test robot
在 2024/8/20 3:28, Bart Van Assche 写道:
> 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:
Yeah. I will make changes to the commit logs based on the above comments.
Thanks for your advice.
>
> /**
> * 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@intel.com>
>> Closes:
>> https://lore.kernel.org/oe-lkp/202408151633.fc01893c-oliver.sang@intel.com
>> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
>
> Since this is a fix, please include a "Fixes:" tag.
Got it. I will add a "Fixes:" tag.
Best Regards,
Zhu Yanjun
>
> Thanks,
>
> Bart.
>
--
Best Regards,
Yanjun.Zhu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-19 22:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-17 8:42 [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency Zhu Yanjun
2024-08-19 18:38 ` Jason Gunthorpe
2024-08-19 22:38 ` Zhu Yanjun
2024-08-19 19:28 ` Bart Van Assche
2024-08-19 22:42 ` Zhu Yanjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox