mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: disk head scheduling
@ 1999-03-20 17:27 Guest section DW
  0 siblings, 0 replies; 2+ messages in thread
From: Guest section DW @ 1999-03-20 17:27 UTC (permalink / raw)
  To: linux-kernel

On Fri, 19 Mar 1999, Arvind Sankar wrote:

> IBM claims that my hard disk (Model IBM DHEA-38451) has 4 platters and 8 heads.
> I assume these are physical, since there are either 15 or 16 logical heads in
> CHS mode (settable via jumpers).

Yes, it looks like they are physical. In view of semi-recent discussions on
the size of a kilobyte or megabyte, it was amusing to read the data sheet:

# 1.1 Glossary
# Word     Meaning
# Kbpi     1 000 Bit Per Inch
# Mbps     1 000 000 Bit per second
# MB       1 000 000 bytes
# KB       1 000 bytes
# 32 KB    32 x 1 024 bytes
# 64 KB    64 x 1 024 bytes
# Mb/sq.in 1 000 000 bits per square inch


Now everyone knows in advance that an attempt to try and use this
geometry information would be misguided - it would lead to complex
code, with a performance that would not be much better than the present
(but possibly much worse).
And the code would need detailed information that is usually unavailable.

But just for fun: what would be the fastest way of writing a given
collection of sectors to disk? Hmm. Sounds like the travelling salesman
problem, which is NP complete in general. Moreover, there is the added
complication that during the travels of this salesman places to visit
are added to the list.

Does that data sheet give sufficient information to decide where on the disk
a given sector is? In case of errors, sectors are remapped to the inner rim
of the disk, but let us ignore that.
Implicitly we find from the data sheet that there are about 263 sectors
on the outer tracks and about 148 sectors on the inner tracks.
The number of tracks in each of the eight zones is unknown.
Maybe each zone has the same number of tracks, but the total number of
tracks is unknown (maybe about 10000?). The number of sectors per track
in each of the eight zones can only be estimated.
But what is the ordering of the sectors? Unless I overlooked something,
the data sheet is silent about that. But different disks use different
orders (as one can most easily demonstrate by making a graph of transfer
speed versus sector number; if that is roughly monotonically decreasing
the numbering is canonical and discontinuities in the graph show zone limits;
but one also sees different graphs, e.g. with a decrease followed by an increase).

So, maybe we lack information, and cannot really use the spec data to improve
the disk strategy for this single particular disk, even if we wanted to.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: disk head scheduling
       [not found] <Pine.LNX.3.95.990320224514.1123A-100000@localhost>
@ 1999-03-20 22:41 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 1999-03-20 22:41 UTC (permalink / raw)
  To: Gerard Roudier; +Cc: linux-kernel



On Sat, 20 Mar 1999, Gerard Roudier wrote:
> 
> The kernel IO-request queue is one queue and a device TASK SET is also one
> queue, the SCSI sub-system passes requests between the kernel request
> queue and device queues.

The kernel IO-request queue is NOT one queue.

This is a common misunderstanding, and I'm really fed up with it. 

The generic kernel low-level driver interface was designed to have
multiple requests queues, and the fact is that sadly the SCSI layer
doesn't understand this, so the SCSI layer uses just one queue.

The IDE driver is much better in this regard, for example. The IDE driver
uses one queue per controller, rather than one global queue. That means
that the generic code doesn't waste time trying to schedule requests for
different controllers, only schedule them on a per-controller basis.

There is indeed a global upper limit of total requests that the kernel
will queue up, but that's a separate issue or memory management, and is
actually just a single define.. It means that all IO requests are allocated
from the same pool of requests entries, but that does NOT MEAN, and has
NEVER MEANT that there is only one queue.

Sorry for shouting, but this is one of my major gripes with the SCSI
layer: it was just badly designed. And now that bad design means that
driver writers believe that the generic kernel is doing something stupid.
It isn't. It's the SCSI layer that is stupid, and it wouldn't have to be. 

Just to give you an idea: right now the generic disk interface layer in
the kernel sees only one queue for all SCSI devices, which means that it
tries to sort all the requests according to that. That obviously fails: in
the presense of multiple disks, the sorting criteria just do not make all
that much sense.

So the generic layer spends time sorting the requests onto one queue,
doesn't do a good job because of that, and then the SCSI layer spends MORE
time unsorting the requests. 

This means, for example, that while the kernel is making up a request for
one SCSI disk and has "plugged" the request queue in order to give just
one large requests to the disk, that "plug" will now plug all other SCSI
devices too - even though that wasn't the reason for doing the plugging. 

With just one controller, this usually isn't a problem, but if you have
multiple controllers you can only blame the SCSI layer if it doesn't scale
up nicely.

This is one reason why people like Leonard decide to not use the SCSI
layer at all for their newer drivers. 

		Linus


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-03-20 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-20 17:27 disk head scheduling Guest section DW
     [not found] <Pine.LNX.3.95.990320224514.1123A-100000@localhost>
1999-03-20 22:41 ` Linus Torvalds

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®