public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jeremy Katz <jeremy.katz@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@osdl.org>, Linus <torvalds@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	katzj@redhat.com
Subject: Re: [PATCH] PPC64 iSeries viodasd proc file
Date: Wed, 23 Jun 2004 15:03:03 -0700	[thread overview]
Message-ID: <20040623220303.GD6548@kroah.com> (raw)
In-Reply-To: <cb5afee10406231415293e90c0@mail.gmail.com>

On Wed, Jun 23, 2004 at 05:15:54PM -0400, Jeremy Katz wrote:
> For example, /sys/bus/ide/devices/* and then symlinks forever... lots
> of readdir, readlink, etc makes probing far slower and more complex
> than the simple /proc/ide/ide?/*/ that could be used before.

Yes, ide never got completly moved over to sysfs like scsi did.  We
never had the time to do this work, sorry.

But now your parsing should be easier with the one-value to one-file
rule, right?  And libsysfs should help out here with all of the symlinks
and readdir, etc calls.

> > > Also, things in sysfs aren't exactly stable enough to count on as a
> > > dependable interface, but that's something the kernel has never
> > > reliably exported to userspace.
> >
> > Why isn't sysfs stable enough?  You can find any driver instantly.  And
> > any device bound to that driver in a stable and repeatable manner.
> 
> Again, not sysfs itself.  How information is exported via sysfs.  I'm
> not saying that things exported via /proc are always the picture of
> stability here (cf the recent change from /proc/scsi/usb-storage-$host
> to /proc/scsi/usb-storage/$host), but at the same time, things in
> /proc have tended to settle down in the general case.  This just isn't
> true yet with sysfs and is only the sort of thing that can happen with
> time.
> 
> There are also other things; I guess consistency is a better word. 
> People like to say use /sys/block to show block devices, but that
> shows a lot of "useless" block devices from the point of view of
> trying to show disks.

But all of those devices are block devices.  You want a hardware
picture, right?  sysfs never said it would show you just that, but it
makes it easier to determine.

For this specific instance, just look for block devices that have a
device symlink that points to a real device.

> > So, give me specific examples, or stop ranting for no reason.
> 
> And to be more constructive (after a discussion with Jeff this
> afternoon which is when I realized the reply didn't go out), what
> would be _very_ useful to have from a "probing disks" perspective
> would be a way to enumerate easily and simply from within sysfs the
> disks that are associated with a specific controller.

Hm, I think libsysfs can give you this, if you ask for the block devices
that are associated with each individual device associated with a
driver.

The whole "what driver controls what devices" is not a simple one to one
mapping all the time, with drivers that work on multiple types of
busses, and drivers that control devices that contain multiple class
devices, etc.  It's not a simple thing to solve, sorry.

But what you can use is the MODULE_DEVICE_TABLE() information in the
modules to try to help you out here.  That details a mapping of what
kind of devices that specific driver supports.

> Note: this should not mean that we then go and remove currently
> existing stuff in /proc.  Deprecate it and then it can go away in time
> as people switch.  Having to have a flag day is very painful.  It's
> far easier to deprecate in one stable series with a new interface
> available and then start removing the old ones as things start to
> switch over.  If it really is an improvement, then getting people to
> change won't be difficult.

I agree, I don't think that many things have disappeared from /proc just
yet, right?  You should just have more information than what you
previously did, right?  Or did scsi drop their /proc support fully?

thanks,

greg k-h

  parent reply	other threads:[~2004-06-23 23:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18  6:54 [PATCH] PPC64 iSeries viodasd proc file Stephen Rothwell
2004-06-18 15:09 ` Jeff Garzik
2004-06-18 15:17   ` Christoph Hellwig
2004-06-20 19:52     ` Jeremy
2004-06-20 21:11       ` Christoph Hellwig
2004-06-21  6:04       ` Greg KH
     [not found]         ` <cb5afee10406210914451dc6@mail.gmail.com>
2004-06-23 21:15           ` Jeremy Katz
2004-06-23 21:45             ` Jeff Garzik
2004-06-23 22:03             ` Greg KH [this message]
2004-06-24  0:38               ` Jeff Garzik
2004-06-24 20:59                 ` Greg KH
2004-06-24 21:25                   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2004-06-23 23:54 Stephen Rothwell
2004-06-23 23:55 ` Greg KH

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=20040623220303.GD6548@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=jeremy.katz@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=katzj@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@osdl.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