Re: [PATCH 3/3] block: use blk_mq_no_io() for avoiding lock dependency

Ming Lei
2025-04-03T02:54:50Z

On Wed, Apr 02, 2025 at 07:13:56PM +0530, Nilay Shroff wrote:
>
>
> On 4/2/25 10:08 AM, Ming Lei wrote:
> > Use blk_mq_no_io() to prevent IO from entering queue for avoiding lock
> > dependency between freeze lock and elevator lock, and we have got many
> > such reports:
> >
> > Reported-by: syzbot+4c7e0f9b94ad65811efb@syzkaller.appspotmail.com
> > Closes: https://lore.kernel.org/linux-block/67e6b425.050a0220.2f068f.007b.GAE@google.com/
> > Reported-by: Valdis Klētnieks <valdis.kletnieks@vt.edu>
> > Closes: https://lore.kernel.org/linux-block/7755.1743228130@turing-police/#t
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
>
> I tested this series on my system and this works well as we cut dependency
> between ->elevator_lock and ->freeze_lock. However don't we plan to now
> model blk_mq_enter_no_io and blk_mq_exit_no_io as lock/unlock for supporting
> lockdep? Maybe we don't.

Good point!

>
> Overall changes looks good to me:
> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>

Thanks for the review!

lockdep modeling for blk_mq_enter_no_io and blk_mq_exit_no_io has been
added in V2.

Thanks,
Ming