From: Hillf Danton <hdanton@sina.com>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Cc: thomas.hellstrom@linux.intel.com, axboe@kernel.dk,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Ming Lei <ming.lei@redhat.com>,
regressions@lists.linux.dev
Subject: Re: 6.15/regression/bisected - lockdep warning: circular locking dependency detected when plugging USB stick after ffa1e7ada456
Date: Thu, 24 Jul 2025 09:19:49 +0800 [thread overview]
Message-ID: <20250724011950.2836-1-hdanton@sina.com> (raw)
In-Reply-To: <CABXGCsOwAQuisqpfUvW+1BWtOV+O1GypcQ6mb4SSUgN3YkAZUQ@mail.gmail.com>
On Thu, 24 Jul 2025 01:36:37 +0500 Mikhail Gavrilov wrote:
> On Wed, Jul 23, 2025 at 6:03 AM Hillf Danton <hdanton@sina.com> wrote:
> >
> > In order to cure the deadlock, queue is thawed before switching elevator,
> > so lets see what comes out with that warning ignored.
> >
> > --- x/block/elevator.c
> > +++ y/block/elevator.c
> > @@ -575,7 +575,6 @@ static int elevator_switch(struct reques
> > struct elevator_type *new_e = NULL;
> > int ret = 0;
> >
> > - WARN_ON_ONCE(q->mq_freeze_depth == 0);
> > lockdep_assert_held(&q->elevator_lock);
> >
> > if (strncmp(ctx->name, "none", 4)) {
> > @@ -661,6 +660,7 @@ static int elevator_change(struct reques
> > unsigned int memflags;
> > int ret = 0;
> >
> > + /* updaters should be serialized */
> > lockdep_assert_held(&q->tag_set->update_nr_hwq_lock);
> >
> > memflags = blk_mq_freeze_queue(q);
> > @@ -674,11 +674,11 @@ static int elevator_change(struct reques
> > * Disk isn't added yet, so verifying queue lock only manually.
> > */
> > blk_mq_cancel_work_sync(q);
> > + blk_mq_unfreeze_queue(q, memflags);
> > mutex_lock(&q->elevator_lock);
> > if (!(q->elevator && elevator_match(q->elevator->type, ctx->name)))
> > ret = elevator_switch(q, ctx);
> > mutex_unlock(&q->elevator_lock);
> > - blk_mq_unfreeze_queue(q, memflags);
> > if (!ret)
> > ret = elevator_change_done(q, ctx);
> >
> > --
>
> Hi Hillf,
>
> Thanks for the patch.
>
> With this patch applied, I haven't seen either the lockdep warning or
> a soft lockup within 13 hours of runtime. Not sure if that's
> sufficient yet for a final verdict, but it's definitely promising.
Thank you for testing it.
It works for you so far, but given the "correct" locking order enforced
in ffa1e7ada456, I know the chance for reversing that order is not zero
yet either in Jens or upstream tree. Nor simple to fix every single case.
Hillf Danton
next prev parent reply other threads:[~2025-07-24 1:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 21:54 Mikhail Gavrilov
2025-07-22 0:51 ` Hillf Danton
2025-07-22 7:11 ` Mikhail Gavrilov
2025-07-23 1:03 ` Hillf Danton
2025-07-23 20:36 ` Mikhail Gavrilov
2025-07-24 1:19 ` Hillf Danton [this message]
2025-07-22 12:14 ` Jens Axboe
2025-07-23 1:16 ` Hillf Danton
2025-07-22 7:39 ` Thomas Hellström
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=20250724011950.2836-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikhail.v.gavrilov@gmail.com \
--cc=ming.lei@redhat.com \
--cc=regressions@lists.linux.dev \
--cc=thomas.hellstrom@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®