Linux block layer
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: xu.xin16@zte.com.cn
Cc: tom.leiming@gmail.com, thomas.hellstrom@linux.intel.com,
	linux-block@vger.kernel.org, zhang.anmeng@zte.com.cn,
	yang.tao172@zte.com.cn, axboe@kernel.dk
Subject: Re:  [PATCH] block: mark GFP_NOIO around sysfs ->store()
Date: Wed, 6 Aug 2025 15:27:34 +0800	[thread overview]
Message-ID: <aJMD5jrvi918AHUk@fedora> (raw)
In-Reply-To: <2025080610504934810yy8xTXsec9HpIXS8-2K@zte.com.cn>

On Wed, Aug 06, 2025 at 10:50:49AM +0800, xu.xin16@zte.com.cn wrote:
> > sysfs ->store is called with queue freezed, meantime we have several
> > ->store() callbacks(update_nr_requests, wbt, scheduler) to allocate
> > memory with GFP_KERNEL which may run into direct reclaim code path,
> > then potential deadlock can be caused.
> > 
> > Fix the issue by marking NOIO around sysfs ->store()
> > 
> > Reported-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
> > ---
> >  block/blk-sysfs.c | 3 +++
> >  1 file changed, 3 insertions(+)
> 
> Excuse me, does the issue to fix comes from f1be1788a32e ("block: model freeze &
> enter queue as lock for supporting lockdep") ?

The above commit just starts to show the potential deadlock risk, which exists for
long time.

And now it becomes not necessary because blk_mq_freeze_queue() includes
memalloc_noio_save().

 
Thanks,
Ming


  reply	other threads:[~2025-08-06  7:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  2:50 [PATCH] block: mark GFP_NOIO around sysfs ->store() xu.xin16
2025-08-06  7:27 ` Ming Lei [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-13  1:58 Ming Lei
2025-01-13  5:47 ` Christoph Hellwig
2025-01-13  8:23 ` John Garry
2025-01-13  8:29   ` Ming Lei
2025-01-13 14:46 ` Jens Axboe

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=aJMD5jrvi918AHUk@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tom.leiming@gmail.com \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.tao172@zte.com.cn \
    --cc=zhang.anmeng@zte.com.cn \
    /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