public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Zhu Yanjun <yanjun.zhu@linux.dev>,
	leon@kernel.org, linux-rdma@vger.kernel.org,
	shinichiro.kawasaki@wdc.com, Jason Gunthorpe <jgg@nvidia.com>
Cc: kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH 1/1] RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency
Date: Mon, 19 Aug 2024 12:28:02 -0700	[thread overview]
Message-ID: <092913a6-c898-4258-90ca-926d6864d005@acm.org> (raw)
In-Reply-To: <20240817084244.536397-1-yanjun.zhu@linux.dev>

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.


  parent reply	other threads:[~2024-08-19 19:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-08-19 22:42   ` Zhu Yanjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=092913a6-c898-4258-90ca-926d6864d005@acm.org \
    --to=bvanassche@acm.org \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=yanjun.zhu@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox