From: <gumi@linux.alibaba.com>
To: "'Jens Axboe'" <axboe@kernel.dk>,
"'Bart Van Assche'" <bvanassche@acm.org>,
<damien.lemoal@opensource.wdc.com>
Cc: <linux-block@vger.kernel.org>
Subject: Re: [PATCH v2] block: I/O error occurs during SATA disk stress test
Date: Mon, 29 Aug 2022 12:11:39 +0800 [thread overview]
Message-ID: <000701d8bb5d$710b2ca0$532185e0$@linux.alibaba.com> (raw)
On 8/25/22 9:25 PM, gumi@linux.alibaba.com wrote:
> On 8/25/22 00:09, Gu Mi wrote:
>> The problem occurs in two async processes, One is when a new IO calls
>> the blk_mq_start_request() interface to start sending,The other is
>> that the block layer timer process calls the blk_mq_req_expired
>> interface to check whether there is an IO timeout.
>>
>> When an instruction out of sequence occurs between blk_add_timer and
>> WRITE_ONCE(rq->state,MQ_RQ_IN_FLIGHT) in the interface
>> blk_mq_start_request,at this time, the block timer is checking the
>> new IO timeout, Since the req status has been set to MQ_RQ_IN_FLIGHT
>> and
>> req->deadline is 0 at this time, the new IO will be misjudged as a
>> timeout.
>>
>> Our repair plan is for the deadline to be 0, and we do not think that
>> a timeout occurs. At the same time, because the jiffies of the 32-bit
>> system will be reversed shortly after the system is turned on, we
>> will add 1 jiffies to the deadline at this time.
>>
>> Signed-off-by: Gu Mi <gumi@linux.alibaba.com>
>> ---
>> v1->v2:
>>
>> time_after_eq() can handle the overflow, so remove the change on
>> 32-bit in blk_add_timer().
>>
>> block/blk-mq.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/block/blk-mq.c b/block/blk-mq.c index 4b90d2d..6defaa1
>> 100644
>> --- a/block/blk-mq.c
>> +++ b/block/blk-mq.c
>> @@ -1451,6 +1451,8 @@ static bool blk_mq_req_expired(struct request *rq, unsigned long *next)
>> return false;
>>
>> deadline = READ_ONCE(rq->deadline);
>> + if (unlikely(deadline == 0))
>> + return false;
>> if (time_after_eq(jiffies, deadline))
>> return true;
>>
>
> rq->deadline == 0 can be a valid deadline value so the above patch
> doesn't look right to me.
Gu, you need to fix your quoting of emails, these are impossible to read.
That aside, I think there's a misunderstanding here. v1 has some parts and v2 has others. Please post a v3 that has the hunk that guarantees that deadline always has the lowest bit set if assigned, and the !deadline check as well.
--
Jens Axboe
---
Hi Jens
Thanks for your reminder, I I will post a v3 patch later, my v3 patch and V1 patch are the same, please review again
Thanks,
Gu Mi
next reply other threads:[~2022-08-29 4:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 4:11 gumi [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-29 4:07 [PATCH v2] block: I/O error occurs during SATA disk stress test gumi
2022-08-29 3:25 gumi
2022-08-29 3:30 ` Bart Van Assche
2022-08-26 3:25 gumi
2022-08-26 13:36 ` Jens Axboe
2022-08-26 16:06 ` Bart Van Assche
2022-08-26 19:40 ` Jens Axboe
2022-08-25 7:09 Gu Mi
2022-08-25 17:18 ` Bart Van Assche
2022-08-26 21:15 ` Bart Van Assche
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='000701d8bb5d$710b2ca0$532185e0$@linux.alibaba.com' \
--to=gumi@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=linux-block@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.