linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Hafting <helgehaf@aitel.hist.no>
To: Maciej Zenczykowski <maze@cela.pl>
Cc: Xavier Bestel <xavier.bestel@free.fr>, Greg KH <greg@kroah.com>,
	Witukind <witukind@nsbm.kicks-ass.org>,
	recbo@nishanet.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: udev sysfs docs Re: State of devfs in 2.6?
Date: Tue, 09 Dec 2003 16:01:08 +0100	[thread overview]
Message-ID: <3FD5E3B4.8060405@aitel.hist.no> (raw)
In-Reply-To: <Pine.LNX.4.44.0312091358210.21314-100000@gaia.cela.pl>

Maciej Zenczykowski wrote:
>>>>Am I wrong ?
> 
> 
>>>No, you are correct.  That's why I'm not really worried about this, and
>>>I don't think anyone else should be either.
> 
> 
> You are of course totally wrong - just because a device is present in the 
> system doesn't mean that it's kernel modules are loaded - for example my 
> floppy is always present in the system, but I access it like once a month 
> or so - currently devfs (which I'm using on 3 computers with no problems 
> for over a year now) will load the floppy module on access to /dev/fd0 and 
> the module will unload automatically a few dozen minutes later after I'm 
> done with the disk drive. On an 8 MB mem system keeping 60KB floppy 
> driver non-stop in unswappable kernel memory is wastefull.  Especially 
> since this also applies to microcode, sound drivers, scanners, rtc, etc...  
> The system is properly configured - the modules for devices are loaded 
> when needed - just because a device is present doesn't mean we need to 
> have the driver loaded for it.

Sure, the driver doesn't need to be present all the time.  If you
want to use it occationally you need some kind of "trigger" to
demand-load it.

With devfs, this trigger mechanism is devfs+devfsd and its configuration.
Devfs will notice that you're opening a nonexistant node, tell
devfsd do do something, devfsd will see that you have specified module
loading, do that, and then the suddenly present node is loaded.


The approach without devfs is to have the device node present
wheter or not the device is there. (i.e. /dev on ext2)
You don't need a /dev full of all the nodes makedev creates, but
you need nodes for devices you actually have. Set up udev
so it don't delete nodes (or at least not the floppy node) when
the driver go away.  You now have a permanent floppy device.
Trying to access it when it isn't there will cause the kernel
itself to run modprobe, if you configured "automatic module loading".

So, you can demand-load devices without devfs, you just need the
device node. It wastes little disk space and no memory (unless
you put your udev-managed /dev in tmpfs.  But then the memory
loss is quite small and the disk loss nonexistant.)

You can probably have udev help you set up the device nodes,
configure so nodes aren't deleted and load all your modules.
udev populates /dev and that job is done.

Compare to the devfs approach:
It too uses memory (for devfs and devfsd, as well as disk space
for devfsd.conf.  And there is one disadvantage, a program
cannot look in /dev to see what devices you have when the module
isn't loaded.  A program looking for floppy or sound devices
won't find any with devfs+modules, but will find the device
if you're using udev+modules.  And then the driver will load
when opened.

Helge Hafting











  reply	other threads:[~2003-12-09 14:51 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-08 15:36 State of devfs in 2.6? Andrew Walrond
2003-12-08 15:42 ` William Lee Irwin III
2003-12-08 15:59   ` Andrew Walrond
2003-12-08 23:38     ` Greg KH
2003-12-09 10:37       ` Andrew Walrond
2003-12-09 10:57         ` Måns Rullgård
2003-12-09 12:54         ` Paul P Komkoff Jr
2003-12-09  5:04     ` Rob Landley
2003-12-08 19:09   ` udev sysfs docs " Bob
2003-12-08 23:37     ` Greg KH
2003-12-09  5:17       ` Witukind
2003-12-09  7:21         ` Bob
2003-12-09  7:39           ` Matthew Reppert
2003-12-09  8:52             ` Måns Rullgård
2003-12-09  9:16             ` Greg KH
2003-12-09  9:45               ` Måns Rullgård
2003-12-09  9:18           ` Greg KH
2003-12-09  9:46           ` Andreas Jellinghaus
2003-12-09 10:25             ` Måns Rullgård
2003-12-09 15:28               ` Andreas Jellinghaus
2003-12-09 20:16               ` Oliver Hunt
2003-12-09 20:53                 ` Måns Rullgård
2003-12-09 22:14                   ` Olaf Hering
2003-12-09 22:46                   ` Oliver Hunt
2003-12-09 23:03                     ` Måns Rullgård
2003-12-09  7:56         ` Greg KH
2003-12-09  9:00           ` Xavier Bestel
2003-12-09  9:08             ` Greg KH
2003-12-09  9:19               ` Miles Bader
2003-12-09  9:39                 ` Måns Rullgård
2003-12-09 11:01                   ` Helge Hafting
2003-12-12 11:26                     ` Jamie Lokier
2003-12-12 13:33                       ` Duncan Sands
2003-12-12 14:51                         ` Jamie Lokier
2003-12-12 16:34                       ` Chuck Campbell
2003-12-12 17:13                         ` Chris Friesen
2003-12-12 17:17                         ` Måns Rullgård
2003-12-15  2:12                           ` Miles Bader
2003-12-15  3:51                             ` Mark Mielke
2003-12-15  6:09                             ` Tim Connors
2003-12-10 19:23                   ` Witukind
2003-12-10 19:33                     ` Måns Rullgård
2003-12-10 20:22                       ` Witukind
2003-12-10 20:47                         ` Ed Sweetman
2003-12-10 20:53                           ` Ed Sweetman
2003-12-10 21:31                             ` Witukind
2003-12-10 21:28                           ` Witukind
2003-12-10 21:48                             ` Måns Rullgård
2003-12-11  6:31                               ` Witukind
2003-12-10 21:49                           ` Måns Rullgård
2003-12-10 23:48                           ` Maciej Zenczykowski
2003-12-11  1:53                             ` Mark Mielke
2003-12-11  8:42                               ` Måns Rullgård
2003-12-11 16:33                                 ` Mark Mielke
2003-12-10 20:48                         ` Måns Rullgård
2003-12-10 23:40                       ` Maciej Zenczykowski
2003-12-09  9:55               ` Xavier Bestel
2003-12-09 13:03                 ` Maciej Zenczykowski
2003-12-09 15:01                   ` Helge Hafting [this message]
2003-12-09 18:30                   ` Greg KH
2003-12-09 18:53                     ` Måns Rullgård
2003-12-10  7:02                       ` Xavier Bestel
2003-12-10 20:06                         ` Witukind
2003-12-11  9:27                           ` Xavier Bestel
2003-12-11 10:15                             ` Måns Rullgård
2003-12-11 11:05                               ` Xavier Bestel
2003-12-10  0:38                 ` Greg KH
2003-12-09  9:26             ` Måns Rullgård
2003-12-09  9:41               ` Miles Bader
2003-12-10  8:13           ` Jakob Oestergaard
2003-12-10  8:24           ` Rob Landley
2003-12-08 23:04   ` Andreas Jellinghaus
2003-12-08 23:34     ` Greg KH
2003-12-09  0:31       ` Sven-Haegar Koch
2003-12-09  0:42         ` Greg KH
2003-12-09  0:51       ` [PATCH] sysfs support for vcs devices (was Re: State of devfs in 2.6?) Greg KH
2003-12-09  5:26       ` State of devfs in 2.6? Rob Landley
2003-12-09 18:19         ` Greg KH
2003-12-09 18:20         ` Greg KH
2003-12-09  7:02       ` Andreas Jellinghaus
2003-12-09  7:13         ` Murray J. Root
2003-12-09  8:21           ` Holger Schurig
2003-12-09  8:52             ` Miles Bader
2003-12-09 10:08               ` Holger Schurig
2003-12-09 17:10             ` Mark Mielke
2003-12-10  5:42               ` Greg KH
2003-12-10 23:29                 ` jw schultz
2003-12-11 20:32                 ` [2.4.23] cursor dissapears in framebuffer console after switching back from X Witukind
2003-12-11 23:59                   ` Gene Heskett
2003-12-12  6:24                     ` Witukind
2003-12-09  8:32         ` State of devfs in 2.6? Greg KH
2003-12-09  9:59           ` Jan Dittmer
2003-12-09 13:54             ` Matthew Reppert
2003-12-09 16:27             ` Greg KH
2003-12-09 16:47               ` Eduard Bloch
2003-12-09 19:33                 ` Greg KH
2003-12-10  2:15           ` Clemens Schwaighofer
2003-12-10  4:10             ` Bob
2003-12-09  7:33       ` Vojtech Pavlik
2003-12-09  9:48       ` Andreas Jellinghaus
2003-12-08 23:35 ` 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=3FD5E3B4.8060405@aitel.hist.no \
    --to=helgehaf@aitel.hist.no \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maze@cela.pl \
    --cc=recbo@nishanet.com \
    --cc=witukind@nsbm.kicks-ass.org \
    --cc=xavier.bestel@free.fr \
    /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).