[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E9D95C99-D07B-4A63-8C0E-67356887DE23@linaro.org>
Date: Mon, 24 May 2021 18:57:23 +0200
From: Paolo Valente <paolo.valente@...aro.org>
To: Holger Hoffstätte <holger@...lied-asynchrony.com>
Cc: Luca Mariotti <mariottiluca1@...mail.it>,
Jens Axboe <axboe@...nel.dk>,
linux-block <linux-block@...r.kernel.org>,
linux-kernel@...r.kernel.org,
Pietro Pedroni <pedroni.pietro.96@...il.com>
Subject: Re: [PATCH BUGFIX] block, bfq: fix delayed stable merge check
> Il giorno 20 mag 2021, alle ore 09:15, Holger Hoffstätte <holger@...lied-asynchrony.com> ha scritto:
>
> On 2021-05-18 12:43, Luca Mariotti wrote:
>> When attempting to schedule a merge of a given bfq_queue with the currently
>> in-service bfq_queue or with a cooperating bfq_queue among the scheduled
>> bfq_queues, delayed stable merge is checked for rotational or non-queueing
>> devs. For this stable merge to be performed, some conditions must be met.
>> If the current bfq_queue underwent some split from some merged bfq_queue,
>> one of these conditions is that two hundred milliseconds must elapse from
>> split, otherwise this condition is always met.
>> Unfortunately, by mistake, time_is_after_jiffies() was written instead of
>> time_is_before_jiffies() for this check, verifying that less than two
>> hundred milliseconds have elapsed instead of verifying that at least two
>> hundred milliseconds have elapsed.
>> Fix this issue by replacing time_is_after_jiffies() with
>> time_is_before_jiffies().
>> Signed-off-by: Luca Mariotti <mariottiluca1@...mail.it>
>> Signed-off-by: Paolo Valente <paolo.valente@...aro.org>
>> Signed-off-by: Pietro Pedroni <pedroni.pietro.96@...il.com>
>> ---
>> block/bfq-iosched.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
>> index acd1f881273e..2adb1e69c9d2 100644
>> --- a/block/bfq-iosched.c
>> +++ b/block/bfq-iosched.c
>> @@ -2697,7 +2697,7 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
>> if (unlikely(!bfqd->nonrot_with_queueing)) {
>> if (bic->stable_merge_bfqq &&
>> !bfq_bfqq_just_created(bfqq) &&
>> - time_is_after_jiffies(bfqq->split_time +
>> + time_is_before_jiffies(bfqq->split_time +
>> msecs_to_jiffies(200))) {
>> struct bfq_queue *stable_merge_bfqq =
>> bic->stable_merge_bfqq;
>
> Not sure why but with this patch I quickly got a division-by-zero in BFQ and
> complete system halt. Unfortunately I couldn't capture the exact stack trace,
> but it read something like bfq_calc_weight() or something ike that.
> I looked through the code and found bfq_delta(), so maybe weight got
> reduced to 0?
>
Hi Holger,
is this (easily) reproducible for you? If so, I'd like to propose you
a candidate fix.
Thanks,
Paolo
> -h
Powered by blists - more mailing lists