All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency
@ 2022-09-28  6:39 Sagi Grimberg
  2022-09-30  1:31 ` Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sagi Grimberg @ 2022-09-28  6:39 UTC (permalink / raw)
  To: linux-nvme; +Cc: Christoph Hellwig, Keith Busch, Chaitanya Kulkarni, Yi Zhang

The keep alive timer needs to stay on nvmet_wq, and not
modified to reschedule on the system_wq.

This fixes a warning:
------------[ cut here ]------------
workqueue: WQ_MEM_RECLAIM
nvmet-wq:nvmet_rdma_release_queue_work [nvmet_rdma] is flushing
!WQ_MEM_RECLAIM events:nvmet_keep_alive_timer [nvmet]
WARNING: CPU: 3 PID: 1086 at kernel/workqueue.c:2628
check_flush_dependency+0x16c/0x1e0

Reported-by: Yi Zhang <yi.zhang@redhat.com>
Fixes: 8832cf922151 ("nvmet: use a private workqueue instead of the
system workqueue")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 drivers/nvme/target/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 7f4083cf953a..428317fe6da0 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1175,7 +1175,7 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl)
 	 * reset the keep alive timer when the controller is enabled.
 	 */
 	if (ctrl->kato)
-		mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ);
+		mod_delayed_work(nvmet_wq, &ctrl->ka_work, ctrl->kato * HZ);
 }
 
 static void nvmet_clear_ctrl(struct nvmet_ctrl *ctrl)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency
  2022-09-28  6:39 [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency Sagi Grimberg
@ 2022-09-30  1:31 ` Chaitanya Kulkarni
  2022-10-10  8:26 ` Christoph Hellwig
  2022-10-17  7:18 ` Christoph Hellwig
  2 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2022-09-30  1:31 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-nvme, Christoph Hellwig, Keith Busch, Chaitanya Kulkarni, Yi Zhang



> 
> On Sep 27, 2022, at 11:40 PM, Sagi Grimberg <sagi@grimberg.me> wrote:
> 
> The keep alive timer needs to stay on nvmet_wq, and not
> modified to reschedule on the system_wq.
> 
> This fixes a warning:
> ------------[ cut here ]------------
> workqueue: WQ_MEM_RECLAIM
> nvmet-wq:nvmet_rdma_release_queue_work [nvmet_rdma] is flushing
> !WQ_MEM_RECLAIM events:nvmet_keep_alive_timer [nvmet]
> WARNING: CPU: 3 PID: 1086 at kernel/workqueue.c:2628
> check_flush_dependency+0x16c/0x1e0
> 
> Reported-by: Yi Zhang <yi.zhang@redhat.com>
> Fixes: 8832cf922151 ("nvmet: use a private workqueue instead of the
> system workqueue")
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> 

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency
  2022-09-28  6:39 [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency Sagi Grimberg
  2022-09-30  1:31 ` Chaitanya Kulkarni
@ 2022-10-10  8:26 ` Christoph Hellwig
  2022-10-12  6:40   ` Sagi Grimberg
  2022-10-17  7:18 ` Christoph Hellwig
  2 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2022-10-10  8:26 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-nvme, Christoph Hellwig, Keith Busch, Chaitanya Kulkarni, Yi Zhang

On Wed, Sep 28, 2022 at 09:39:10AM +0300, Sagi Grimberg wrote:
> The keep alive timer needs to stay on nvmet_wq, and not
> modified to reschedule on the system_wq.

Does it?  The keep alive timeout is required for making progress
under heavy memory pressure.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency
  2022-10-10  8:26 ` Christoph Hellwig
@ 2022-10-12  6:40   ` Sagi Grimberg
  0 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2022-10-12  6:40 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-nvme, Christoph Hellwig, Keith Busch, Chaitanya Kulkarni, Yi Zhang


>> The keep alive timer needs to stay on nvmet_wq, and not
>> modified to reschedule on the system_wq.
> 
> Does it?  The keep alive timeout is required for making progress
> under heavy memory pressure.

nvmet_wq has WQ_MEM_RECLAIM. Also, note that keep_alive is initially
scheduled in nvmet_wq but mod_delayed_work incorrectly moved it to
the system_wq...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency
  2022-09-28  6:39 [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency Sagi Grimberg
  2022-09-30  1:31 ` Chaitanya Kulkarni
  2022-10-10  8:26 ` Christoph Hellwig
@ 2022-10-17  7:18 ` Christoph Hellwig
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2022-10-17  7:18 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-nvme, Christoph Hellwig, Keith Busch, Chaitanya Kulkarni, Yi Zhang

Thanks,

applied to nvme-6.1.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-17  7:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  6:39 [PATCH] nvmet: fix workqueue MEM_RECLAIM flushing dependency Sagi Grimberg
2022-09-30  1:31 ` Chaitanya Kulkarni
2022-10-10  8:26 ` Christoph Hellwig
2022-10-12  6:40   ` Sagi Grimberg
2022-10-17  7:18 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.