All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Dan Schatzberg <schatzberg.dan@gmail.com>,
	Jens Axboe <axboe@kernel.dk>, Ming Lei <ming.lei@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,
	linux-block <linux-block@vger.kernel.org>
Subject: Re: [PATCH] loop: add WQ_MEM_RECLAIM flag to per device workqueue
Date: Fri, 18 Mar 2022 07:15:18 -1000	[thread overview]
Message-ID: <YjS+Jr6QudSKMSGy@slm.duckdns.org> (raw)
In-Reply-To: <5542ef88-dcc9-0db5-7f01-ad5779d9bc07@I-love.SAKURA.ne.jp>

Hello,

On Fri, Mar 18, 2022 at 09:05:42PM +0900, Tetsuo Handa wrote:
> But since include/linux/workqueue.h only says
> 
> 	__WQ_LEGACY		= 1 << 18, /* internal: create*_workqueue() */
> 
> , I can't tell when not to specify __WQ_LEGACY and WQ_MEM_RECLAIM together...
> 
> Tejun, what is the intent of this warning? Can the description of __WQ_LEGACY flag
> be updated? I think that the loop module had better reserve one "struct task_struct"
> for each loop device.
> 
> I guess that, in general, waiting for a work in !WQ_MEM_RECLAIM WQ from a
> WQ_MEM_RECLAIM WQ is dangerous because that work may not be able to find
> "struct task_struct" for processing that work. Then, what we should do is to
> create mp->m_sync_workqueue with WQ_MEM_RECLAIM flag added instead of creating
> lo->workqueue with __WQ_LEGACY + WQ_MEM_RECLAIM flags added...
> 
> Is __WQ_LEGACY + WQ_MEM_RECLAIM combination a hack for silencing this warning
> without fixing various WQs used by xfs and other filesystems?

So, create_workqueue() is the deprecated interface and always imples
MEM_RECLAIM because back when the interface was added each wq had a
dedicated worker and there's no way to tell one way or the other. The
warning is telling you to convert the workqueue to the alloc_workqueue()
interface and explicitly use WQ_MEM_RECLAIM flag if the workqueue is gonna
participate in MEM_RECLAIM chain.

Thanks.

-- 
tejun

  reply	other threads:[~2022-03-18 17:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 14:08 [PATCH] loop: add WQ_MEM_RECLAIM flag to per device workqueue Tetsuo Handa
2022-03-17 14:38 ` Dan Schatzberg
2022-03-18 12:05   ` Tetsuo Handa
2022-03-18 17:15     ` Tejun Heo [this message]
2022-03-19  2:02       ` Tetsuo Handa
2022-03-21 16:55         ` Tejun Heo
2022-03-21 22:53           ` Tetsuo Handa
2022-03-21 23:04             ` Tejun Heo
2022-03-21 23:17               ` Tetsuo Handa
2022-03-21 23:27                 ` Tejun Heo
2022-03-22  0:09                   ` Tetsuo Handa
2022-03-22 16:52                     ` Tejun Heo
2022-03-22 22:00                       ` Dave Chinner
2022-03-22 22:02                         ` Tejun Heo
2022-03-22 22:05                           ` Tetsuo Handa
2022-03-22 22:19                             ` Tejun Heo
2022-03-22 22:59                               ` Dave Chinner
2022-03-22 23:32                                 ` Tetsuo Handa
2022-03-22 23:50                                   ` Dave Chinner
2022-03-23  0:09                                 ` Tejun Heo

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=YjS+Jr6QudSKMSGy@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --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.