From: Yu Kuai <yukuai1@huaweicloud.com>
To: Khazhy Kumykov <khazhy@chromium.org>, Yu Kuai <yukuai1@huaweicloud.com>
Cc: Paolo Valente <paolo.valente@linaro.org>,
Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
"yukuai (C)" <yukuai3@huawei.com>, Jan Kara <jack@suse.cz>
Subject: Re: [RFC PATCH] bfq: fix waker_bfqq inconsistency crash
Date: Thu, 3 Nov 2022 11:51:15 +0800 [thread overview]
Message-ID: <f83404b4-84a4-de4e-fa4d-9ce38900d91c@huaweicloud.com> (raw)
In-Reply-To: <CACGdZYJ0WH+Y9sdchXy30UVTQgPCEo=fW+W9atZh1Ki7Ov4_Gw@mail.gmail.com>
Hi,
在 2022/11/03 11:05, Khazhy Kumykov 写道:
> On Wed, Nov 2, 2022 at 7:56 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>>
>> Hi,
>>
>> 在 2022/11/03 9:39, Khazhismel Kumykov 写道:
>>> This fixes crashes in bfq_add_bfqq_busy due to waker_bfqq being NULL,
>>> but woken_list_node still being hashed. This would happen when
>>> bfq_init_rq() expects a brand new allocated queue to be returned from
>>
>> From what I see, bfqq->waker_bfqq is updated in bfq_init_rq() only if
>> 'new_queue' is false, but if 'new_queue' is false, the returned 'bfqq'
>> from bfq_get_bfqq_handle_split() will never be oom_bfqq, so I'm confused
>> here...
> There's two calls for bfq_get_bfqq_handle_split in this function - the
> second one is after the check you mentioned, and is the problematic
> one.
Yes, thanks for the explanation. Now I understand how the problem
triggers.
>>
>>> bfq_get_bfqq_handle_split() and unconditionally updates waker_bfqq
>>> without resetting woken_list_node. Since we can always return oom_bfqq
>>> when attempting to allocate, we cannot assume waker_bfqq starts as NULL.
>>> We must either reset woken_list_node, or avoid setting woken_list at all
>>> for oom_bfqq - opt to do the former.
>>
>> Once oom_bfqq is used, I think the io is treated as issued from root
>> group. Hence I don't think it's necessary to set woken_list or
>> waker_bfqq for oom_bfqq.
> Ack, I was wondering what's right here since, evidently, *someone* had
> already set oom_bfqq->waker_bfqq to *something* (although... maybe it
> was an earlier init_rq). But maybe it's better to do nothing if we
> *know* it's oom_bfqq.
I need to have a check how oom_bfqq get involved with waker_bfqq, and
then see if it's reasonable.
Probably Jan and Paolo will have better view on this.
Thanks,
Kuai
>
> Is it a correct interpretation here that setting waker_bfqq won't
> accomplish anything anyways on oom_bfqq, so better off not?
next prev parent reply other threads:[~2022-11-03 3:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 1:39 Khazhismel Kumykov
2022-11-03 2:55 ` Yu Kuai
2022-11-03 3:05 ` Khazhy Kumykov
2022-11-03 3:51 ` Yu Kuai [this message]
2022-11-03 8:47 ` Jan Kara
2022-11-04 21:25 ` Khazhy Kumykov
2022-11-07 13:26 ` Jan Kara
2022-11-08 18:10 ` [PATCH 1/2] " Khazhismel Kumykov
2022-11-08 18:10 ` [PATCH 2/2] bfq: ignore oom_bfqq in bfq_check_waker Khazhismel Kumykov
2022-11-09 11:14 ` Jan Kara
2022-11-09 11:15 ` [PATCH 1/2] bfq: fix waker_bfqq inconsistency crash Jan Kara
2022-11-09 19:47 ` 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=f83404b4-84a4-de4e-fa4d-9ce38900d91c@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=jack@suse.cz \
--cc=khazhy@chromium.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paolo.valente@linaro.org \
--cc=yukuai3@huawei.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®