All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Jan Kara <jack@suse.cz>,
	Dan Schatzberg <schatzberg.dan@gmail.com>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 1/2] loop: use a global workqueue
Date: Fri, 24 Dec 2021 07:03:11 +0100	[thread overview]
Message-ID: <20211224060311.GC12234@lst.de> (raw)
In-Reply-To: <bb151d84-8a56-f6da-a5dd-b2d8d1fb6cdb@i-love.sakura.ne.jp>

On Thu, Dec 23, 2021 at 11:37:21PM +0900, Tetsuo Handa wrote:
> > @@ -1115,7 +1107,6 @@ static void __loop_clr_fd(struct loop_device *lo)
> >  	/* freeze request queue during the transition */
> >  	blk_mq_freeze_queue(lo->lo_queue);
> >  
> > -	destroy_workqueue(lo->workqueue);
> 
> is it safe to remove destroy_workqueue() call here?
> 
> >  	spin_lock_irq(&lo->lo_work_lock);
> >  	list_for_each_entry_safe(worker, pos, &lo->idle_worker_list,
> >  				idle_list) {
> 
> destroy_workqueue() implies flush_workqueue() which is creating the lock
> ordering problem. And I think that flush_workqueue() is required for making
> sure that there is no more work to process (i.e. loop_process_work() is
> no longer running) before start deleting idle workers.
> 
> My understanding is that the problem is not the use of a per-device workqueue
> but the need to call flush_workqueue() in order to make sure that all pending
> works are completed.

All the work items are for requests, and the blk_mq_freeze_queue should
take care of flushing them all out.

  reply	other threads:[~2021-12-24  6:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23 11:25 fix loop autoclear for xfstets xfs/049 Christoph Hellwig
2021-12-23 11:25 ` [PATCH 1/2] loop: use a global workqueue Christoph Hellwig
2021-12-23 14:37   ` Tetsuo Handa
2021-12-24  6:03     ` Christoph Hellwig [this message]
2021-12-24 12:05       ` Tetsuo Handa
2021-12-24 14:05         ` Tetsuo Handa
2021-12-29 17:21         ` Christoph Hellwig
2021-12-29  2:23   ` Tetsuo Handa
2021-12-23 11:25 ` [PATCH 2/2] loop: make autoclear operation synchronous again Christoph Hellwig
2021-12-23 13:40 ` fix loop autoclear for xfstets xfs/049 Jan Kara
2021-12-24  6:02   ` Christoph Hellwig
2021-12-26  7:09     ` Tetsuo Handa
2021-12-29 17:20       ` Christoph Hellwig

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=20211224060311.GC12234@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=schatzberg.dan@gmail.com \
    /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 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.