All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Dalecki <dalecki@evision-ventures.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.5.17 IDE 65
Date: Tue, 21 May 2002 18:35:12 +0200	[thread overview]
Message-ID: <3CEA7740.7060204@evision-ventures.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0205210954210.2471-100000@home.transmeta.com>

Użytkownik Linus Torvalds napisał:
> 
> On Tue, 21 May 2002, Martin Dalecki wrote:
> 
> 
>>- Make the synchronization token active resident on the same level as the
>>   spin lock. They interact with each other until the generic queue handling
>>   gets sanitized to not attach hardware properties like the hard sector size
>>   to the queue entities. This is a design mistake in ll_rw_blk biting everybody
>>   out there.
> 
> This does not parse. It is _not_ a design mistake in ll_rw_blk - if it
> bites you, you're doing something wrong.
> 
> The queue should be a per-device thing. If you have multiple devices with
> different hard-sector-sizes (or other queue attributes) on the same queue,
> that's _your_ problem, not the problem of ll_rw_block.

I didn't change the behaviour with respect to this.

But please consider the following points:

1. Layered devices. md. lvm raid  and so on, over mutliple physical
disks with possible different properties. Due to they nature
they have to handle the case of multiple block sizes.
The only reason this isn't biting us here right now is the
simple fact that most disks just stick with the dreaded 512 byte sector 
addressing, but there are people out there esp. from Maxtor
complaining about this... which would love to expand the smallest
transfer unit. It's just natural that this will be a subject
to change. Please note that most file systems out there are
already acting on expanded sector sizes indeed.

2. Removable media like CD-ROM contain already somehow inherently
the property of needing to deal with different sector sizes.
There are for example 1024 and 2048 byte modes for CD-ROMs.

3. I would love it to handle multiple sector transfers just as
big hard-sector sizes :-). Not quite perfectsolution ins some
corner cases but it would simplify many things inside the driver.
However this is just an idea I'm thinking about it and I didn't
came to any final conclusion about this.

> Sure, ll_rw_block _allows_ you to use the same queue for multiple devices,
> but if you do that you only have yourself to blame, and you get:

Linus - recycling the same request queue would simplify the
serialization issues by a significant amount. We have already
a mechanism for passing the spin lock to use to the upper
layer (blk_init_queue()). It would be just natural if it was
acting as kind of a true semaphore for overall request serialization. But
currently it's just used to serialize the access to the corresponding
queue lists, which doesn't buy us *anything*,
since request finish ACK happens asynchronously. And therefore
it doesn't make much sense indeed. It would really make only sense
if it would be kind of a semaphore-token shared between the queues in
question - which it isn't right now.

>  - shared values (like the hardsector-size above)
>  - worse elevator performance (longer queues to traverse)
>  - worse elevator schedules (mixing devices will caused mixed queue
>    contents, which makes it basically impossible to do a good ordering)

This wouldn't happen, since the intention would be to use
them only in case of the devices which need to be serialized
with each other.

> I thought the IDE layer already did the "one queue per device" thing, is
> there somewhere where this isn't true?

Yes it does it this way and this isn't subject to change
any time soon on sane hardware. After looking at the ll_rw_blk
code close enough I have already dropped the idea of different
queues for ATA and ATAPI reuqests. The point which I'm spinning
around are just the few "insane" cases where total
request serialization between different devices would help
to assert physical register access requirements.
A case where the above performance issues are not
prohibitive in my opinnion.

> In short, I think whatever synchronization token problem there is is
> completely an internal IDE problem, and no blame should be laid at anybody
> else.

Well if you are looking at it. Please have a look at the following
struct request memebers as well:

[root@kozaczek linux]# find ./ -name "*.[ch]" -exec grep hard_nr_sectors 
/dev/null {} \;

./include/linux/blkdev.h:       unsigned long hard_nr_sectors;
./drivers/ide/ide-cd.c: rq->hard_nr_sectors = rq->nr_sectors;
./drivers/ide/ide-taskfile.c:           __ide_end_request(drive, rq, 1, 
rq->hard_nr_sectors);
./drivers/block/ll_rw_blk.c:    unsigned long blocks = rq->hard_nr_sectors / 
(hard_sect >> 9);
./drivers/block/ll_rw_blk.c:            req->nr_sectors = req->hard_nr_sectors 
+= next->hard_nr_sectors;
./drivers/block/ll_rw_blk.c:                    req->nr_sectors = 
req->hard_nr_sectors += nr_sectors;
./drivers/block/ll_rw_blk.c:                    req->nr_sectors = 
req->hard_nr_sectors += nr_sectors;
./drivers/block/ll_rw_blk.c:    req->hard_nr_sectors = req->nr_sectors = nr_sectors;
./drivers/block/ll_rw_blk.c:            rq->hard_nr_sectors -= nsect;
./drivers/block/ll_rw_blk.c:            rq->nr_sectors = rq->hard_nr_sectors;

You will notice that the "other" hard_blah members are used
inside the IDE layer only as well for the running request and much
in pair with the normal members of struct request...
I'm planing right now how to push them down to the only
palce where they are used - namely the IDE layer next.
But I see that this has to be done *very carefully*.

The other things which ll_rw_blk.c doesn't get right is the
fact that the current merge functions don't respect hard sector
sizes, despite of attaching them to every single request out there.
Since we have the requests in device context you can hardly
argue that this is at least smelling funny since this information
is already accessible through the device context and shouldn't
be duplicated...

*Those* are the (minor) things which did lead me to the conclusion
that something isn't (quite) right there. OK?


  reply	other threads:[~2002-05-21 17:38 UTC|newest]

Thread overview: 131+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-21  5:16 Linux-2.5.17 Linus Torvalds
2002-05-21 13:58 ` Linux-2.5.17 Roman Zippel
2002-05-21 16:06   ` Linux-2.5.17 Linus Torvalds
2002-05-21 18:36     ` Linux-2.5.17 Roman Zippel
2002-05-21 18:53       ` Linux-2.5.17 Linus Torvalds
2002-05-21 23:35         ` Linux-2.5.17 Roman Zippel
2002-05-22  0:10           ` Linux-2.5.17 Linus Torvalds
2002-05-22  0:31             ` Linux-2.5.17 Roman Zippel
2002-05-22  0:54               ` Linux-2.5.17 Linus Torvalds
2002-05-22  2:17                 ` Linux-2.5.17 David S. Miller
2002-05-22  2:40                   ` Linux-2.5.17 Linus Torvalds
2002-05-22  2:57                     ` Linux-2.5.17 David S. Miller
2002-05-22  3:21                       ` Linux-2.5.17 Linus Torvalds
2002-05-22  8:06                         ` Linux-2.5.17 David Lang
2002-05-22 14:14                         ` Linux-2.5.17 Dave McCracken
2002-05-22 16:10                           ` Linux-2.5.17 Linus Torvalds
2002-05-22 13:45                 ` Linux-2.5.17 Roman Zippel
2002-05-22 16:08                   ` Linux-2.5.17 Linus Torvalds
2002-05-21 15:32 ` [PATCH] 2.5.17 IDE 65 Martin Dalecki
2002-05-21 16:59   ` Linus Torvalds
2002-05-21 16:35     ` Martin Dalecki [this message]
2002-05-21 17:56       ` Linus Torvalds
2002-05-21 18:49         ` Alan Cox
2002-05-21 20:08         ` Vojtech Pavlik
2002-05-21 23:28           ` Linus Torvalds
2002-05-22  6:53             ` Martin Dalecki
2002-05-23  7:01               ` Kai Henningsen
2002-05-22  7:16 ` [PATCH] 2.5.17 IDE 66 Martin Dalecki
2002-05-22  7:19 ` [PATCH] 2.5.17 IDE 67 Martin Dalecki
2002-05-22 17:13   ` Tom Rini
2002-05-22 16:21     ` Martin Dalecki
2002-05-22 17:31       ` Tom Rini
2002-05-22 16:40         ` Martin Dalecki
2002-05-22 18:47           ` Tom Rini
2002-05-23  6:08             ` Martin Dalecki
2002-05-23 15:26               ` Tom Rini
2002-05-23 14:32                 ` Martin Dalecki
2002-05-23 15:40                   ` Tom Rini
2002-05-22  7:23 ` [PATCH] 2.5.16 IDE 68 Martin Dalecki
2002-05-22 10:48   ` Juan Quintela
2002-05-22  9:45     ` Martin Dalecki
2002-05-22 15:55   ` Linus Torvalds
2002-05-22 15:03     ` Martin Dalecki
2002-05-22  9:05 ` [PATCH] 2.5.17 /dev/ports Martin Dalecki
2002-05-22 10:42   ` Paul Mackerras
2002-05-22  9:46     ` Martin Dalecki
2002-05-22 10:54     ` David S. Miller
2002-05-22 10:13       ` Martin Dalecki
2002-05-22 11:26         ` Russell King
2002-05-22 10:40           ` Martin Dalecki
2002-05-22 11:58             ` Richard B. Johnson
2002-05-22 12:36             ` Russell King
2002-05-22 13:23               ` Alan Cox
2002-05-22 12:31                 ` Martin Dalecki
2002-05-22 12:44           ` Alan Cox
2002-05-22 12:32             ` Martin Dalecki
2002-05-22 15:05               ` Alan Cox
2002-05-22 13:05       ` Alan Cox
2002-05-22 12:38         ` Martin Dalecki
2002-05-22 15:04           ` Alan Cox
2002-05-22 13:53             ` Martin Dalecki
2002-05-22 15:03               ` Lars Marowsky-Bree
2002-05-22 15:07               ` Padraig Brady
2002-05-22 14:07                 ` Martin Dalecki
2002-05-22 15:21                   ` Dave Jones
2002-05-22 15:19               ` Dave Jones
2002-05-22 15:31               ` Alan Cox
2002-05-27  9:04               ` Pavel Machek
2002-05-22 14:54             ` Alexander Viro
2002-05-22 15:24               ` Alan Cox
2002-05-22 15:10                 ` Alexander Viro
2002-07-22 12:20                   ` Ruth Ivimey-Cook
2002-05-23  7:30               ` Rusty Russell
2002-05-23  6:44                 ` Martin Dalecki
2002-05-23  8:26                   ` Rusty Russell
2002-05-22 13:16   ` Padraig Brady
2002-05-22 12:30     ` Martin Dalecki
2002-05-22 13:50       ` Sebastian Droege
2002-05-22 13:52     ` Alan Cox
2002-05-22 13:49       ` Vojtech Pavlik
2002-05-22 12:51         ` Martin Dalecki
2002-05-22 13:56           ` Vojtech Pavlik
2002-05-22 14:58             ` Alan Cox
2002-05-22 13:49               ` Martin Dalecki
2002-05-22 14:42               ` Vojtech Pavlik
2002-05-22 13:59           ` Alexander Viro
2002-05-22 13:12             ` Martin Dalecki
2002-05-22 14:33               ` Alexander Viro
2002-05-22 13:40                 ` Martin Dalecki
2002-05-22 13:16             ` Martin Dalecki
2002-05-22 14:34               ` Alexander Viro
2002-05-22 16:31               ` James Simmons
2002-05-22 14:12             ` Vojtech Pavlik
2002-05-27  9:07             ` Pavel Machek
2002-05-22 15:00         ` Alan Cox
2002-05-22 14:43           ` Vojtech Pavlik
2002-05-22 16:28   ` Linus Torvalds
2002-05-22 17:22     ` Alan Cox
2002-05-22 16:17       ` Martin Dalecki
2002-05-22 17:30         ` Russell King
2002-05-22 16:36           ` Martin Dalecki
2002-05-22 17:36           ` Alexander Viro
2002-05-22 17:46         ` Alan Cox
2002-05-26 13:53         ` Riley Williams
2002-05-26 15:28           ` Vojtech Pavlik
2002-05-26 15:39             ` Riley Williams
2002-05-23 10:10     ` Martin Diehl
2002-05-22 10:54 ` Linux-2.5.17 Martin Dalecki
2002-05-22 12:04   ` Linux-2.5.17 Alexander Viro
2002-05-22 13:07     ` Linux-2.5.17 Martin Dalecki
2002-05-22 14:38       ` Linux-2.5.17 Alexander Viro
2002-05-22 13:42         ` Linux-2.5.17 Martin Dalecki
2002-05-22 16:55       ` Linux-2.5.17 Jan Kara
2002-05-22 12:14   ` Linux-2.5.17 Russell King
2002-05-22 12:36     ` Linux-2.5.17 Martin Dalecki
2002-05-22 16:02     ` Linux-2.5.17 Linus Torvalds
2002-05-22 15:04       ` Linux-2.5.17 Martin Dalecki
2002-05-22 16:58         ` Linux-2.5.17 Jan Kara
2002-05-22 16:08           ` Linux-2.5.17 Martin Dalecki
2002-05-22 17:56             ` Linux-2.5.17 Jan Kara
2002-05-22 16:56               ` Linux-2.5.17 Martin Dalecki
2002-05-22 18:17                 ` Linux-2.5.17 Jan Kara
2002-05-22 18:36                   ` Linux-2.5.17 Russell King
2002-05-22 13:06   ` Linux-2.5.17 Alan Cox
2002-05-22 11:19 ` Linux-2.5.17 Russell King
2002-05-22 11:27   ` Linux-2.5.17 David S. Miller
2002-05-22 16:23   ` Linux-2.5.17 Linus Torvalds
2002-05-22 17:31 ` [PATCH] 2.5.17 IDE 69 Martin Dalecki
2002-05-23  7:32 ` [PATCH] 2.5.17 sysvipc (AKA: spoiling oil in to the flames) Martin Dalecki
2002-05-24 13:59 ` Linux-2.5.17 Martin Dalecki
2002-05-24 14:23 ` [PATCH] 2.5.17 IDE 70 Martin Dalecki

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=3CEA7740.7060204@evision-ventures.com \
    --to=dalecki@evision-ventures.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 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.