From: Jens Axboe <axboe@kernel.dk>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-block@vger.kernel.org,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH RFC] block - ataflop.c: fix breakage introduced at blk-mq refactoring
Date: Mon, 18 Oct 2021 18:44:32 -0600 [thread overview]
Message-ID: <1855e2ed-90d2-e99d-5df6-26766019bb3a@kernel.dk> (raw)
In-Reply-To: <CAOmrzkJZAAGEQFamfSb-jZNr5r0hr6jM+YoMSTCS08TtDWxcZg@mail.gmail.com>
On 10/18/21 6:42 PM, Michael Schmitz wrote:
> Hi Jens,
>
> On Tue, Oct 19, 2021 at 12:40 PM Jens Axboe <axboe@kernel.dk> wrote:
>>>> 'last' is set if it's the last of a sequence of ->queue_rq() calls. If
>>>> you just do sync IO, then last is always set, as there is no sequence.
>>>> It's not hard to generate sequences, but on a floppy with basically no
>>>> queue depth the most you'd ever get is 2. You could try and set:
>>>>
>>>> /sys/block/<dev>/queue/max_sectors_kb
>>>>
>>>> to 4 for example, and then do something that generates a larger than 4k
>>>> write or read. Ideally that should give you more than 1.
>>>
>>> Thanks, tried that - that does indeed cause multiple requests queued to
>>> the driver (which rejects them promptly).
>>>
>>> Now fails because ataflop_commit_rqs() unconditionally calls
>>> finish_fdc() right after the first request started processing- and
>>> promptly wipes it again.
>>>
>>> What is the purpose of .commit_rqs? The PC legacy floppy driver doesn't
>>> use it ...
>>
>> You only need to care about bd->last if you have something in the driver
>> that can make it cheaper to commit more than one request. An example is
>> a driver that fills in requests, and then has an operation to ring the
>> submission doorbell to flush them out. The latter is what ->commit_rqs
>> is for.
>
> OK, that's indeed a no-op for our floppy driver, which can queue
> exactly one request.
Right, and the only reason the depth is set to 2 is to allow one for
merging purposes.
>> For a floppy driver, just ignore bd->last and don't implement
>> commit_rqs, I don't think we're squeezing a lot of extra efficiency out
>> of it through that! Think many hundreds of thousands of IOPS or millions
>> of IOPS, not a handful of IOPS or less.
>
> I'm not averse to using bd->last to close down only after the last
> request in a sequence if it can be done safely (i.e. the requests that
> had been rejected are then promptly requeued). But complexity is the
> enemy of maintainability, so the nice and easy fix should be enough.
With just 2 requests, any sequence is going to be pretty limited :-).
My recommendation would be to just ignore bd->last and treat any
request as a standalone unit. Should make for easier code too, and
you won't have two different cases to handle.
> I'll respin and send another version shortly.
Great, thanks.
--
Jens Axboe
next prev parent reply other threads:[~2021-10-19 0:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 22:21 [PATCH RFC] block - ataflop.c: fix breakage introduced at blk-mq refactoring Michael Schmitz
2021-10-18 22:30 ` Jens Axboe
2021-10-18 22:51 ` Finn Thain
2021-10-18 23:07 ` Jens Axboe
2021-10-18 23:17 ` Finn Thain
2021-10-18 23:28 ` Jens Axboe
2021-10-19 0:14 ` Finn Thain
2021-10-19 0:41 ` Jens Axboe
2021-10-18 23:35 ` Michael Schmitz
2021-10-18 23:40 ` Jens Axboe
2021-10-19 0:42 ` Michael Schmitz
2021-10-19 0:44 ` Jens Axboe [this message]
2021-10-18 23:55 ` Omar Sandoval
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=1855e2ed-90d2-e99d-5df6-26766019bb3a@kernel.dk \
--to=axboe@kernel.dk \
--cc=geert@linux-m68k.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=schmitzmic@gmail.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