public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Jens Axboe <axboe@suse.de>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	Alan Cox <alan@redhat.com>, Arjan van de Ven <arjanv@redhat.com>
Subject: Re: sg driver and Fedora Core 2
Date: Sun, 30 May 2004 20:37:14 +1000	[thread overview]
Message-ID: <40B9B95A.40304@torque.net> (raw)
In-Reply-To: <20040529172916.GD18613@suse.de>

Jens Axboe wrote:
> On Sat, May 29 2004, Jeff Garzik wrote:
> 
>>Really what needs to happen is a generic userland tap attaches to a 
>>chrdev, issues an ioctl(2) to attach to a request_queue, and then does 
>>read(2)/write(2)/mmap(2) to communicate with the request_queue.
>>
>>:)
>>
>>Call it /dev/bsg, or somesuch.
>>
>>The SG_IO ioctl won't work for all cases, since some block devices may 
>>rightly wish to limit (or block) multiple openers on the blkdev itself. 
>>  OTOH, the SG_IO ioctl does eliminate the userland app needing to 
>>worry about _any_ target/addressing information, since that is implicit 
>>in the dentry pointing to the blkdev's inode.
> 
> 
> Hear, hear!

Jeff + Jens,
Yes, that is what I was getting at with my "bind"
idea. Could a "misc" char device minor number for
/dev/bsg be made available? It isn't clear to me how sysfs
can be used to do what Jeff proposes.


I have no expertise in Fibre Channel but Serial Attached SCSI
(SAS) throws up more addressing problems. There can be up to
16,000 devices in a single SAS domain the bulk of which would
be targets **, expanders which are the interesting ones, and
other initiators (potentially on other machines) will
also be visible. Those expanders are critical to
configuring the SAS domain. Expanders are SAS devices but
not SCSI devices (i.e. they are neither initiators nor
targets ***). It seems obvious that the management of a SAS
domain should be done from the user space. Only those
expanders and devices directly attached to a SAS Host Bus
Adapter should automatically be visible.

Enumerating all the disks, and/or all the scsi devices
(as either devices or sysfs entries) makes less and
less sense. In the case of SAS, devices can be discovered
by recursive descent of the expanders (via a bind through
/dev/bsg for example). In a large system one possible policy
could be: only if the user is interested in a
particular device should it be presented as a device
node (in /dev, /udev or /sys).


My recent patch to scsi_debug (adding up to 4 partitions per
pseudo device) "allows" (6 * 32768) device nodes to be
created! To play this game, turn off udev, hotplug and set
delay=0 in scsi_debug:-) I didn't get far with 512 MB of ram,
Patrick Mansfield got further with a multi gigabyte machine.
Seems like sysfs eats up most of the ram. To isolate out the
impact of the block subsystem the pseudo devices can be set to
be enclosure peripheral type (for example) via a scsi_debug
driver argument.


** targets include both SATA and SAS disks

*** show should SAS expanders go in /sys/class/scsi_device ?

Doug Gilbert


  reply	other threads:[~2004-05-30 10:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28 14:05 sg driver and Fedora Core 2 Douglas Gilbert
2004-05-28 14:18 ` Jens Axboe
2004-05-28 14:28   ` Jens Axboe
2004-05-28 17:25 ` Alan Cox
2004-05-29 15:55   ` James Bottomley
2004-05-29 15:57     ` Alan Cox
2004-05-29 16:07       ` James Bottomley
2004-05-29 16:29         ` Alan Cox
2004-05-29 16:36           ` Arjan van de Ven
2004-05-29 16:42             ` Alan Cox
2004-05-29 17:45               ` Matthew Wilcox
2004-05-29 16:49           ` James Bottomley
2004-05-29 16:56             ` Alan Cox
2004-05-29 17:28               ` James Bottomley
2004-05-29 17:38                 ` Alan Cox
2004-05-29 17:27             ` Jeff Garzik
2004-05-29 17:29               ` Jens Axboe
2004-05-30 10:37                 ` Douglas Gilbert [this message]
2004-05-30 10:41                   ` Alan Cox
2004-06-07  8:56                     ` Douglas Gilbert
2004-05-29 17:35               ` Alan Cox
2004-05-29 17:42                 ` Jeff Garzik
2004-05-29 17:38               ` James Bottomley
2004-05-29 17:46                 ` Alan Cox
2004-05-29 17:58                 ` Jeff Garzik
2004-05-30 10:20                   ` Jens Axboe
2004-05-29 16:24       ` Arjan van de Ven
2004-05-28 17:39 ` Arjan van de Ven

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=40B9B95A.40304@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@steeleye.com \
    --cc=alan@redhat.com \
    --cc=arjanv@redhat.com \
    --cc=axboe@suse.de \
    --cc=jgarzik@pobox.com \
    --cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox