linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BK PATCHES] add ata scsi driver
Date: Mon, 26 May 2003 13:47:38 -0400	[thread overview]
Message-ID: <3ED2533A.1000602@pobox.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0305260947430.11328-100000@home.transmeta.com>

Linus Torvalds wrote:
> On Mon, 26 May 2003, Jeff Garzik wrote:
> 
>>>>I think with SATA + drivers/ide, you reach a point of diminishing 
>>>>returns versus amount of time spent on mid-layer coding.
>>>
>>>I think that's a valid approach, and just have a special driver for SATA. 
>>>That's not the part I worry about. 
>>
>>You're still at a point of diminishing returns for a native driver too.
> 
> 
> No, because for a block-queue native driver there would be one huge 
> advantage: making sure the native queueing is brought up to be a fully 
> used interface.
> 
> Originally, native queueing was all there was, and all drivers interfaced 
> directly to it. The IDE and SCSI layers ended up being used largely
> because they allowed drivers to use a global naming scheme, not because 
> they were "better". In fact, in many ways they were a lot worse than the 
> native queues, but then they had some other infrastructure that did help.
> 
> My bet is that most of that infrastructure today is just not worth it.

[...]

> Clue-in-time: if hotplugging doesn't work on a native level, it won't work 
> on a SCSI level either. So that _cannot_ be a real issue.
> 
> Device model stuff and power management all comes from other areas, and 
> have little to do with SCSI.

Correct, but precisely by saying that, you're missing something.

The SCSI midlayer provides infrastructure I need -- which is not 
specific to SCSI at all.

Device registration, host registration, major/minor sub-allocation, 
device model, power management, command queueing features, command 
timeout, error handling thread, userland command submission interface (a 
la taskfile ioctl or SG_IO)...  all these are possible via the generic 
block layer -- but the generic block layer does not directly provide 
these facilities.  Each subsystem (ide, scsi, ...) has to provide bits 
on top of that to make it usable.  Each native block driver must 
re-create these for its own subsystem.

All those "little bits" add up to code I have to write, for a native 
driver, which I don't have to write for SCSI.

IF you are willing to sign off on a generic /dev/disk (bus agnostic), 
then I am interested.  That allows me to code up the above stuff ONCE, 
and not see others do the same work when they write a native blk driver 
(or avoid this work, by using SCSI like I do now).  Otherwise. I'm 
writing all those little bits YET AGAIN, duplicating stuff scsi already 
does.

Taking that to a concrete level, that basically means more helpers at 
the native block level.

Given that I have always agreed a native block driver is the best 
eventual method, what's stopping me?  Time:

If /dev/disk is a non-starter for 2.6, the best route is to take my SCSI 
driver and evolve it over time to be a native block driver.  Not start 
with a native block driver.  That gives us a SATA framework now, and 
SCSI can disappear eventually.
#include <linux_is_usable_not_pie_in_sky_theory.h>


(re-arranged msg a bit)
>> Userland support is nonexistent, and users would have start using yet 
>> another set of tools to deal with their disks, instead of the existing 
>> [scsi] ones.

> That's not true. The command set is already exported, so that even things 
> like packet commands can be sent (that's how you write CD-RW under 2.5.x, 
> and it's the _generic_ layer that does all the command queueing). 
> 
> That, btw, i show you should do the ATA transport thing. Even SCSI devices 
> can get the commands fed that way. It's neither ATA nor SCSI, it's a 
> "packet interface for the generic queue".

I agree the capabilities are there for packet interface, but one still 
has to define the userland interface.  Yes, I know about SG_IO.  It's: 
somewhat SCSI-specific, and sub-optimal.   Think back to December 2001, 
when you described a packet interface using read(2) and write(2). 
Basically SG_IO, but better and without scsi specifics.


> The only remaining piece of the puzzle (from a user land perspective) ends 
> up being the mapping from major/minor -> queue. That used to be a _huge_
> issue, and the main reason you couldn't write a SCSI driver outside the 
> SCSI layer, for example (but look at DAC960 - it decided to do so 
> _anyway_, even if it meant being ostracised and put on a separate major).
> 
> But that should be much less of an issue now, since our queue mapping is a 
> lot more flexible these days.

The mapping part is easy, IMO.  I would just have the "generic 
infrastructure" export chrdrvs for each queue I manage, using the 
interface you described in December 2001.  sysfs can then describe the 
{major+minor | CIDR | whatever}-to-queue mapping.

For example, when /dev/disk device registration occurs at runtime, the 
/dev/disk infrastructure would make a new chrdrv appear.


Anyway, stepping back to the larger issue of "userland tools", I'm not 
just talking about a taskfile I/O interface.  I'm talking about all the 
little distro tools for IDE and SCSI, like /usr/bin/scsi_unique_id or 
/sbin/hdparm.  And the assumptions that distro installers make.

Creating yet another set of these tools and standard practices is just 
not worth it, without bus-agnostic /dev/disk.  Sysadmins are going to be 
annoyed at yet another interface and yet another not-IDE, not-SCSI (and 
thus second-class) block major.

It's not worth it for me, with working code now, and it's not worth for 
the next person who wants to add a bus type to Linux.

Unless I am to be creating infrastructure which non-SATA people can use, 
your suggestion equates to making the SATA driver a second-class 
citizen, with lots of additional coding for little gain, and with lots 
of pain on the distro side that must be repeated again and again for 
each native block driver.

	Jeff




  reply	other threads:[~2003-05-26 17:34 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-26  4:58 [BK PATCHES] add ata scsi driver Jeff Garzik
2003-05-26  5:15 ` Linus Torvalds
2003-05-26  5:30   ` Jeff Garzik
2003-05-26  5:36     ` Jeff Garzik
2003-05-26  5:42       ` Linus Torvalds
2003-05-26  6:01         ` Jeff Garzik
2003-05-26 16:56           ` Linus Torvalds
2003-05-26 17:47             ` Jeff Garzik [this message]
2003-05-26 20:09               ` Linus Torvalds
2003-05-27  0:29                 ` Alan Cox
2003-05-27  6:07                 ` Jeff Garzik
2003-05-27  6:30                   ` Linus Torvalds
2003-05-27  6:51                     ` Linus Torvalds
2003-05-27  7:29                       ` Jeff Garzik
2003-05-26  5:40     ` Linus Torvalds
2003-05-26  5:53       ` Jeff Garzik
2003-05-26  6:21         ` Jeff Garzik
2003-05-26 16:57           ` Linus Torvalds
2003-05-26 17:24             ` Jens Axboe
2003-05-26 17:54               ` Jeff Garzik
2003-05-26 17:59               ` Jeff Garzik
2003-05-26 18:11                 ` Jens Axboe
2003-05-27  0:22       ` Alan Cox
2003-05-27  4:15         ` Linus Torvalds
2003-05-26 10:32     ` Bartlomiej Zolnierkiewicz
2003-05-26 11:13       ` Jeff Garzik
2003-05-26 11:37         ` Bartlomiej Zolnierkiewicz
2003-05-26  5:59 ` Benjamin Herrenschmidt
2003-05-26  6:03   ` Jeff Garzik
2003-06-02  9:46 ` Andre Hedrick
2003-06-02 13:56   ` Alan Cox
2003-05-26 18:12 James Bottomley
2003-05-26 18:18 ` Jens Axboe
2003-05-26 18:47   ` James Bottomley
2003-05-26 19:07     ` Jens Axboe
2003-05-26 19:17       ` James Bottomley
2003-05-26 19:33         ` Jens Axboe
2003-05-27 12:39           ` Jens Axboe
2003-05-27 14:26             ` James Bottomley
2003-05-27 17:16               ` Jens Axboe
2003-05-27 18:09                 ` James Bottomley
2003-05-27 18:21                   ` Jens Axboe
2003-05-27 18:30                     ` James Bottomley
2003-05-26 20:27         ` Linus Torvalds
2003-05-26 20:36           ` James Bottomley
2003-05-26 20:45             ` Linus Torvalds
2003-05-26 20:51               ` Jens Axboe
2003-05-26 20:56               ` James Bottomley
2003-05-26 20:38           ` Jens Axboe
2003-05-26 20:49             ` Linus Torvalds
2003-05-26 20:57               ` Jens Axboe
2003-05-26 21:34                 ` Linus Torvalds
2003-05-26 23:58                   ` Nick Piggin
2003-05-27  0:09                     ` Linus Torvalds
2003-05-27  0:49                       ` Nick Piggin
2003-05-27  0:16                   ` Alan Cox
2003-05-27  6:54                   ` Jens Axboe
2003-05-27 14:20                     ` James Bottomley
2003-05-27 14:36                     ` Linus Torvalds
2003-05-27 14:59                       ` James Bottomley
2003-05-27 15:21                         ` Jeff Garzik
2003-05-27 15:38                           ` James Bottomley
2003-05-27 15:50                             ` Jeff Garzik
2003-05-27 16:00                               ` James Bottomley
2003-05-27 16:16                                 ` Jeff Garzik
2003-05-28  9:35                                   ` Christoph Hellwig
2003-05-28 10:50                           ` Lincoln Dale
2003-05-27 19:43                       ` Jens Axboe

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=3ED2533A.1000602@pobox.com \
    --to=jgarzik@pobox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).