LANANA: To Pending Device Number Registrants
First of all, I apologize for not having sent this notice out sooner. This kind of writing is very painful to deal with.
Linus Torvalds has requested a moratorium on new device number assignments. His hope is that a new and better method for device space handing will emerge as a result.
Alan Cox has requested that I maintain a forked registry for his -ac kernel patch tree. I have agreed to do so once I have forked off the "final" version of the registry for Linus' tree. At that time I will process the backlog for the benefit of the -ac registry only. Please have patience until I can get that to happen.
Please note that this is not my decision (in fact, I have serious concerns with it.) In particular, /dev namespace coordination still applies.
Sincerely,
H. Peter Anvin
The Linux Assigned Names and Numbers Authority
Quoted 3 lines · H. Peter Anvin
Linus Torvalds has requested a moratorium on new device number assignments. His hope is that a new and better method for device space handing will emerge as a result.
Here's my suggestion for a solution.
Once I work through a bunch of net driver problems, I want to release a snapshot block device driver (freezes a blkdev in time). For this, I needed a block major. After hearing about the device number freeze, I was wondering if this solution works:
Register block device using existing API, and obtain a dynamically assigned major number. Export a tiny ramfs which lists all device nodes. Mounted on /dev/snap, /dev/snap/0 would be the first blkdev for snap's dynamically assigned major. (Al Viro said he has skeleton code to create such an fs, IIRC)
This solution
(a) keeps from grot-ing up /proc even more [I had considered proc_mknod() until viro talked me out of it]
(b) does not require centrally assigned majors and minors.
(c) does not require devfs. most distros ship without it afaik, and switching to it is not an overnight process, and requires devfsd to be useful in the real world.
Signature · 3 lines
Jeff Garzik | Game called on account of naked chick Building 1024 | MandrakeSoft |
Quoted 18 lines · Jeff Garzik
Quoted 3 lines · H. Peter Anvin
Linus Torvalds has requested a moratorium on new device number assignments. His hope is that a new and better method for device space handing will emerge as a result.
Here's my suggestion for a solution.
Once I work through a bunch of net driver problems, I want to release a snapshot block device driver (freezes a blkdev in time). For this, I needed a block major. After hearing about the device number freeze, I was wondering if this solution works:
Register block device using existing API, and obtain a dynamically assigned major number. Export a tiny ramfs which lists all device nodes. Mounted on
/dev/snap,/dev/snap/0would be the first blkdev for snap's dynamically assigned major. (Al Viro said he has skeleton code to create such an fs, IIRC)
Quoted 7 lines
This solution
(a) keeps from grot-ing up /proc even more [I had consideredproc_mknod()until viro talked me out of it]
(b) does not require centrally assigned majors and minors.
(c) does not require devfs. most distros ship without it afaik, and switching to it is not an overnight process, and requires devfsd to be useful in the real world.
So we add yet another series of hacks to avoid doing what's necessary?!?
BTW: I once made a patch that put back in the compatibility device names in the kernel, so you don't need to run devfsd for this. Obviously, that's not a patch that Linus would want in his kernel (otherwise he wouldn't have made me take them out in the first place), but it is something vendors can add in their patchsets (does anybody ship a virgin kernel?).
This patch is very small and clean. It touches two places in fs/devfs/base.c and creates one new file in fs/devfs.
Regards, Richard.... Permanent: [email protected] Current: [email protected]
Quoted 19 lines · Jeff Garzik
Quoted 3 lines · H. Peter Anvin
Linus Torvalds has requested a moratorium on new device number assignments. His hope is that a new and better method for device space handing will emerge as a result.
Here's my suggestion for a solution.
Once I work through a bunch of net driver problems, I want to release a snapshot block device driver (freezes a blkdev in time). For this, I needed a block major. After hearing about the device number freeze, I was wondering if this solution works:
Register block device using existing API, and obtain a dynamically assigned major number. Export a tiny ramfs which lists all device nodes. Mounted on
/dev/snap,/dev/snap/0would be the first blkdev for snap's dynamically assigned major. (Al Viro said he has skeleton code to create such an fs, IIRC)
Quoted 8 lines
This solution
(a) keeps from grot-ing up /proc even more [I had consideredproc_mknod()until viro talked me out of it]
(b) does not require centrally assigned majors and minors.
(c) does not require devfs. most distros ship without it afaik, and switching to it is not an overnight process, and requires devfsd to be useful in the real world.
It does, however, not manage permissions, nor does it provide for a sane namespace (it exposes too many internal implementation details in the interface -- in particular, the driver becomes part of the namespace, and devices move around between drivers regularly.)
-hpa
Signature · 3 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt
Quoted 9 lines
Quoted 4 lines
(c) does not require devfs. most distros ship without it afaik, and switching to it is not an overnight process, and requires devfsd to be useful in the real world.
It does, however, not manage permissions, nor does it provide for a sane namespace (it exposes too many internal implementation details in the interface -- in particular, the driver becomes part of the namespace, and devices move around between drivers regularly.)
It is also very hard to tar that device file.
As to devfsd well Al Viro was reporting races in it long ago that I don't believe Richard has had time to fix nor has anyone else fixed.
What is the state on devfs there ?
Note also that persistence of permissions and hardcoded in-kernel naming is a problem throughout proc... It's not unique to in-driver filesystems.
Signature · 3 lines
Jeff Garzik | Game called on account of naked chick Building 1024 | MandrakeSoft |
Quoted 4 lines · Jeff Garzik
Note also that persistence of permissions and hardcoded in-kernel naming is a problem throughout proc... It's not unique to in-driver filesystems.
Also note how a 32-bit (or 64-bit) dev_t does NOT make it any easier to manage permissions or anything like that anyway. Look at the current mess /dev is. Imagine it an order of magnitude worse.
Big device numbers are _not_ a solution. I will accept a 32-bit one, but no more, and I will _not_ accept a "manage by hand" approach any more. The time has long since come to say "No". Which I've done. If you can't make it manage the thing automatically with a script, you won't get a hardcoded major device number just because you're lazy.
End of discussion.
Linus
Quoted 1 line · Linus Torvalds
End of discussion.
I've been doubting whether to work on both the -ac kernels and the -linus tree, but this is a pretty good argument for sticking with -ac and just ignoring the -linus tree...
Lets see what happens...
regards,
Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml
Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose...
http://www.surriel.com/
Quoted 3 lines
I've been doubting whether to work on both the -ac kernels and the -linus tree, but this is a pretty good argument for sticking with -ac and just ignoring the -linus tree...
Time will make that decision. Linus kindly gave us all the power to vote with our feet. One thing I absolutely refuse to do is to let a disagreemnt over some specific device implementation turn into an excuse for a wider difference in the trees.
So yes -ac might have static majors but the rest of it I intend to keep merging with Linus and tracking closely to his tree. Certainly not ignoring the -linus tree.
Alan
Quoted 8 lines · Alan Cox
Quoted 3 lines
I've been doubting whether to work on both the -ac kernels and the -linus tree, but this is a pretty good argument for sticking with -ac and just ignoring the -linus tree...
Time will make that decision. Linus kindly gave us all the power to vote with our feet. One thing I absolutely refuse to do is to let a disagreemnt over some specific device implementation turn into an excuse for a wider difference in the trees.
Agreed. However, if this thing means I cannot use the -linus tree without devfs, then it will also mean my VM stuff only gets tested on -ac kernels...
regards,
Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml
Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose...
http://www.surriel.com/
Quoted 3 lines · Rik van Riel
Agreed. However, if this thing means I cannot use the -linus tree without devfs, then it will also mean my VM stuff only gets tested on -ac kernels...
No Problem. I test most of your VM stuff anyway and I use devfs on that machine ;-)
PS: It's not that hard to build a machine, which can support both. E-Mail me, if you would like to know _how_ to do that.
Regards
Ingo Oeser
Signature · 2 lines
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
<<<<<<<<<<<< been there and had much fun >>>>>>>>>>>>Quoted 5 lines
Big device numbers are _not_ a solution. I will accept a 32-bit one, but no more, and I will _not_ accept a "manage by hand" approach any more. The time has long since come to say "No". Which I've done. If you can't make it manage the thing automatically with a script, you won't get a hardcoded major device number just because you're lazy.
And on that issue I'm so convinced you are wrong I'm prepared to maintain sensible Unix device behaviour in the -ac pretty much indefinitely.
Quoted 1 line
End of discussion.
And that is precisely why ....
Abstract device file systems are beautiful concepts but they don't solve the device name space problem and they introduce hideous incompatibilities with existing software. Plan 9 is beautiful. It has a userbase approximately the size of Linux 0.12 - because it is not compatible.
Alan
Quoted 3 lines · Alan Cox
Abstract device file systems are beautiful concepts but they don't solve the device name space problem and they introduce hideous incompatibilities with existing software.
let me get it straight. You are talking about software that would be
a) device-specific,
b) Linux-only,
c) working with devices that do not exist in 2.4.
Would you mind demonstrating such wonder? Old devices are still there, AFAICS. Ext2 (reiserfs, devfs, abortion-of-your-choice-fs) still has the ability to create device nodes for them.
Quoted 3 lines
Would you mind demonstrating such wonder? Old devices are still there, AFAICS. Ext2 (reiserfs, devfs, abortion-of-your-choice-fs) still has the ability to create device nodes for them.
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Quoted 7 lines · Alan Cox
Quoted 3 lines
Would you mind demonstrating such wonder? Old devices are still there, AFAICS. Ext2 (reiserfs, devfs, abortion-of-your-choice-fs) still has the ability to create device nodes for them.
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Not really. Special-casing for mounting root is trivially solvable. BTDT, and you've reviewed the patch.
Quoted 6 lines
Quoted 3 lines
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Not really. Special-casing for mounting root is trivially solvable. BTDT, and you've reviewed the patch.
And lilo ?
Quoted 8 lines · Alan Cox
Quoted 6 lines
Quoted 3 lines
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Not really. Special-casing for mounting root is trivially solvable. BTDT, and you've reviewed the patch.
And lilo ?
LILO uses BIOS, for fsck sake. It couldn't care less for device numbers on the kernel side. Ask Andries how much do they have in common with BIOS drive numbers.
Quoted 7 lines · Alexander Viro
Quoted 4 lines · Alan Cox
Quoted 4 lines
Quoted 3 lines
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Not really. Special-casing for mounting root is trivially solvable. BTDT, and you've reviewed the patch.
And lilo ?
LILO uses BIOS, for fsck sake. It couldn't care less for device numbers on the kernel side. Ask Andries how much do they have in common with BIOS drive numbers.
That's not the issue. LILO takes whatever you pass to root= and converts it to a device number at /sbin/lilo time. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.
-hpa
Signature · 3 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt
Quoted 9 lines · H. Peter Anvin
Quoted 4 lines
LILO uses BIOS, for fsck sake. It couldn't care less for device numbers on the kernel side. Ask Andries how much do they have in common with BIOS drive numbers.
That's not the issue. LILO takes whatever you pass to root= and converts it to a device number at
/sbin/lilotime. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.
Oh, _that_ one. <shrug> pass rootname=driver!name (or whatever syntax you prefer) to the kernel and call do_mount() instead of sys_mknod() in prepare_namespace() (rootfs patch). BFD.
Quoted 3 lines
Oh, _that_ one. <shrug> pass rootname=driver!name (or whatever syntax you prefer) to the kernel and call
do_mount()instead ofsys_mknod()inprepare_namespace()(rootfs patch). BFD.
Yet another 2.5 project. If Linus wants to go play with name driven devices and you want to help him great, but if he'd care to put out linux-2.5.0.tar.gz _before_ starting that would be good for all of us
Quoted 7 lines · Alan Cox
Quoted 3 lines
Oh, _that_ one. <shrug> pass rootname=driver!name (or whatever syntax you prefer) to the kernel and call
do_mount()instead ofsys_mknod()inprepare_namespace()(rootfs patch). BFD.Yet another 2.5 project. If Linus wants to go play with name driven devices and you want to help him great, but if he'd care to put out linux-2.5.0.tar.gz _before_ starting that would be good for all of us
Frankly, I'd love to see 2.4.5-pre2 before June ;-)
BTW, rootfs is backwards-compatible - all setups that used to work still do. And yes, it includes devfs/nfs-root/initrd without linuxrc/initrd with linuxrc that terminates/initrd with linuxrc that execs init/loading ramdisk from floppies, etc. Testing was a bitch ;-/
Quoted 8 lines · Alan Cox
Quoted 3 lines
Oh, _that_ one. <shrug> pass rootname=driver!name (or whatever syntax you prefer) to the kernel and call
do_mount()instead ofsys_mknod()inprepare_namespace()(rootfs patch). BFD.Yet another 2.5 project. If Linus wants to go play with name driven devices and you want to help him great, but if he'd care to put out linux-2.5.0.tar.gz _before_ starting that would be good for all of us
I use LILO and I pass a devfs name for the ROOT fs. You just need to pass the name as a string. If you type it at the LILO prompt, it gets passed as a string (and thus devfs will use it to descend the tree). Also, you can put in /etc/lilo.conf:
append = "root=/dev/scsi/host0/bus0/target0/lun0/part2"
and it will pass the string. Works nicely.
Regards, Richard.... Permanent: [email protected] Current: [email protected]
Quoted 4 lines · Alan Cox
Yet another 2.5 project. If Linus wants to go play with name driven devices and you want to help him great, but if he'd care to put out linux-2.5.0.tar.gz _before_ starting that would be good for all of us
ACK! .. 2.5?? .. gawd .. I just installed 2.4.4 like a week ago ... eeek
...
2.4 To Pending Device Number Registrants
In reply to Alexander ViroQuoted 3 lines · Alan Cox
Yet another 2.5 project. If Linus wants to go play with name driven devices and you want to help him great, but if he'd care to put out linux-2.5.0.tar.gz _before_ starting that would be good for all of us
Well, that's one thing. 2.4 will not need userspace changes internally, so any funky major/minor number dynamic allocation stuff needs to be solved without userspace help. This probably rules out most everything, unless a setup is found that will special case all of /dev/ currently existing.
So I would think that this block of new major number allocations holds for 2.5 and not 2.4. Also, if I'm correct, 2.4 won't be needing a lot of new major numbers anyhow.
This all means that a lot of the current hubbub is unjustified - 2.5 is not there yet. Yes there is urgency and this way of forcing discussion is a very Linus-eque way of trying to achieve something.
But unless I'm wrong, there is no way that this can affect a 2.4 without userspace changes which have historically been considered forbidden within a stable series.
Regards,
bert
Signature · 3 lines
http://www.PowerDNS.com Versatile DNS Services Trilab The Technology People 'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
Re: 2.4 To Pending Device Number Registrants
Quoted 3 lines
So I would think that this block of new major number allocations holds for 2.5 and not 2.4. Also, if I'm correct, 2.4 won't be needing a lot of new major numbers anyhow.
I wouldnt bet on that. Going to a 32bit dev_t internally without user space noticing would keep it seems to be quite doable if we have to. Right now doesnt worry me, in 2 years time when 2.6 is approaching release the picture might have changed a fair bit
Re: 2.4 To Pending Device Number Registrants
In reply to bert hubertQuoted 8 lines · Alan Cox
Quoted 3 lines
So I would think that this block of new major number allocations holds for 2.5 and not 2.4. Also, if I'm correct, 2.4 won't be needing a lot of new major numbers anyhow.
I wouldnt bet on that. Going to a 32bit
dev_tinternally without user space noticing would keep it seems to be quite doable if we have to. Right now doesnt worry me, in 2 years time when 2.6 is approaching release the picture might have changed a fair bit
I think that we then have two distinct problems: 1) finding a solution for 2.4 that does not change userspace 2) finding a solution for 2.5/2.6 that is Right.
Personally I'm not sure what 2.4 stands to gain from a redesign. While 2.4 is obviously developing, a stable series needs to solve real problems or improve performance - I know the way major numbers are allocated right now is ugly and doesn't scale very well. But is 2.4 the place to fix that?
So the question is: does this new policy hold for 2.4 as well and if so, why.
Regards,
bert
Signature · 3 lines
http://www.PowerDNS.com Versatile DNS Services Trilab The Technology People 'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
Quoted 5 lines
Quoted 1 line
And lilo ?
LILO uses BIOS, for fsck sake. It couldn't care less for device numbers on the kernel side. Ask Andries how much do they have in common with BIOS drive numbers.
grep MAJOR lilo-21.4.4/*|wc -l
323
Also hdparm
raidtools
psmisc
mtools
mt-st
gpm
joystick
and that is a simple grep of BUILD/*/*.c on RH 7.0. Im not even looking deeper into subdirectories or powertools or anything like a full debian archive
Quoted 9 lines · Alan Cox
grep MAJOR lilo-21.4.4/*|wc -l
323Also hdparm
raidtools
psmisc
mtools
mt-st
gpm
joystick
so we now have a list of stuff that needs to be fixed 8)
or at least, a cross section sampling of stuff to design a new API for.
-Dan
Quoted 11 lines
Quoted 8 lines
323Also hdparm
raidtools
psmisc
mtools
mt-st
gpm
joystickso we now have a list of stuff that needs to be fixed 8)
or at least, a cross section sampling of stuff to design a new API for.
Yes. Most of it actually uses the major stuff to answer the question 'what ioctls are valid' 'what type of thing am I bashing on'
Just issuing ioctls doesnt help as we have overlaps 8( Also we dont want to get into the DOS like execute 135 queries to figure out what it is by deep magic patterns.
One suggestion is to do something like
if(MAJOR_HAS(st, named-property))
which solves that and also nicely fixes an extant problem in that there isnt a good way to break down heirarchies of ioctl features right now. That is one thing devfs namespaces can be abused to solve but isnt really the right use of it.
Quoted 2 lines · Alan Cox
grep MAJOR lilo-21.4.4/*|wc -l
323
/me looks and barfs.
Alan, had you actually looked at it? It will require massive changes whenever you introduce new major. And most of such areas are stuff that doesn't matter for new devices anyway - geometry, example.
Quoted 8 lines · Alan Cox
Quoted 1 line
Quoted 1 line
And lilo ?
Also hdparm
raidtools
psmisc
mtools
mt-st
gpm
joystick
kmod, /etc/modules.conf:
alias block-major-what-random-number-did-the-kernel-pick-this-time driver_name
Quoted 4 lines · In article <[email protected]> you wrote:
That's not the issue. LILO takes whatever you pass to root= and converts it to a device number at
/sbin/lilotime. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.
That's why you want mount-root-by-partition-label, not by device
Quoted 5 lines
Quoted 3 lines
it to a device number at
/sbin/lilotime. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.That's why you want mount-root-by-partition-label, not by device
Which in itself adds the 'and how does the label tell me what modules to load' question..
For 2.5 with a clean ramfs root / initrd / uuid scan setup I would agree entirely that uuid root is a good thing.
Alan
[email protected] (Alan Cox) wrote on 15.05.01 in <[email protected]>:
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
it to a device number at
/sbin/lilotime. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.That's why you want mount-root-by-partition-label, not by device
Which in itself adds the 'and how does the label tell me what modules to load' question..
The same way the old root device does: not. Why should it? It doesn't tell you what to eat for lunch either.
MfG Kai
Quoted 11 lines · H. Peter Anvin
Quoted 10 lines · Alexander Viro
Quoted 8 lines · Alan Cox
Quoted 6 lines
Quoted 3 lines
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Not really. Special-casing for mounting root is trivially solvable. BTDT, and you've reviewed the patch.
And lilo ?
Quoted 8 lines
Quoted 3 lines
LILO uses BIOS, for fsck sake. It couldn't care less for device numbers on the kernel side. Ask Andries how much do they have in common with BIOS drive numbers.
That's not the issue. LILO takes whatever you pass to root= and converts it to a device number at
/sbin/lilotime. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.
And happily passes a "root=" argument through "append=" for the kernel to evaluate.
Regards
Oliver
Quoted 9 lines · Oliver Neukum
Quoted 5 lines
That's not the issue. LILO takes whatever you pass to root= and converts it to a device number at
/sbin/lilotime. An idiotic practice on the part of LILO, in my opinion, that ought to have been fixed a long time ago.And happily passes a "root=" argument through "append=" for the kernel to evaluate.
Sure, but it's not the way they have convinced users to set their systems up.
-hpa
Signature · 3 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt
Re: LANANA: Getting out of hand?
In reply to Alan CoxQuoted 10 lines · Alan Cox
Subject: Re: LANANA: To Pending Device Number Registrants
Quoted 3 lines
Would you mind demonstrating such wonder? Old devices are still there, AFAICS. Ext2 (reiserfs, devfs, abortion-of-your-choice-fs) still has the ability to create device nodes for them.
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
ouch .... can't we all just get along? :<
Re: LANANA: Getting out of hand?
Quoted 4 lines · Alan Cox
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Actually, it does. It's just that some people have gotten so blinded by my a** that they can no longer see it any more ;)
The problem I have is that there are lots of _good_ solutions, but they all imply a bit more work than the bad ones.
What does that result in? Everybody continues to use the simple old setup, which required no thought at all, but that is a pain to maintain.
For example, the only thing you need in order to boot is to have a nice clean "disk" major number. That's it. Nothing fancy, nothing more.
Look at what we have now:
- ramdisk: major 1. Fair enough - ramdisk is special, in that it doesn't have any "real hardware". No problem.
- SCSI disks:
major 8, 65-71, - Compaq smart2: major 72-79 - Compaq CISS: major 104-111 - DASD; major 94 - IDE: major 3, 22, 33-34, 56-57, 88-91
and then the small random ones.
NONE of these major numbers have _any_ redeeming qualities except for the ramdisk. They should all be _one_ major number, namely "disk". There are absolutely NO advantages to having separate devices for soem strange compaq controllers and IDE disks. There is _no_ point in having some SCSI disks show up at major 8, while others (who just happen to be attached to a scsi bus that is not driven by the generic SCSI layer) show up at major 104 or whatever.
And it will never ever get fixed, unless somebody says "No more!". Which I'm trying my best to say, except some people are so comfortable rolling around in the shit that they have re-defined shit to be the new standard.
When Microsoft defines darkness to be standard, we laugh at them. When we do it, Alan Cox stands up for it and claims that it's the best thing since sliced bread. Double standards, anybody?
What I'm saying is: "No more SHIT!". I'm more than happy to give out a new standard number for _disks_. I'm NOT AT ALL willing to say "Ok, Peter, go ahead and give the next braindamaged Compaq/RedHat/Xxxx engineer another random number so that we can dig ourselves deeper and deeper into this shithole that Alan and others like so much".
How hard is it to generate a new "disk driver framework", and let people register themselves, kind of like the "misc" drivers do. Except we'd only allow DISKS. You could add something like
register_disk_driver("compaq-ciss", nr_disks, &my_queue);and then the disk driver framework will select a range of minor numbers for the disks, and forward all requests that come to those minor numbers to "my_queue". No major numbers. No fixed minors. And the user sees _one_ disk major, and doesn't care _what_ the hell is behind it.
But no. When I tell people "enough is enough", people want to continue with the unbearably stupid and ugly thing we've always had, without realizing that the _real_ problem is not that we have too few major numbers, but the real problem is that people have mis-used the ones we _do_ have, and the fact that we have too few _minor_ numbers (which is easily fixable, and where 20 bits is plenty).
Linus
Re: LANANA: Getting out of hand?
Quoted 6 lines · Linus Torvalds
How hard is it to generate a new "disk driver framework", and let people register themselves, kind of like the "misc" drivers do. Except we'd only allow DISKS. You could add something like
register_disk_driver("compaq-ciss", nr_disks, &my_queue);
Note: one _important_ part of this is that absolutely _nobody_ registers a disk driver except for a controller that is physically found on the machine.
None of this stupid "we have numbers pre-allocated for hardware that does not even exists on this machine" crap that the current setup is full of.
This way, you can pretty much depend on the fact that in any "normal" configuration, you'll find disks at "disk0", "disk1", ... completely regardless of whether the machine has a IDE controller, a "old-fashioned SCSI" controller, or a Compaq smart-raid controller. And THAT is useful. You can migrate filesystem setups from one machine to another, without worrying about the fact that one machine has IDE disks and another has SCSI disks - the filesystem will just work, and the kernels will just boot.
THAT is how it is supposed to work.
For people who care about where the disks are (0.01% of all people, and half of those are misguded anyway), you can have a /proc interface or an ioctl or something.
But don't make excuses for the current setup. And understand why we must NOT continue to just give out major numbers indiscriminately.
[ Oh, and _please_ don't Cc: me on this discussion. I'm not that
interested. I know what I want, and I've let the current mess go on for too long. If it takes some pain to fix it, then so be it. It needs to be fixed, even if people suddenly start thinking that the light of my a** dimmed a bit. That's ok. I just don't want to really fill my inbox - I read the kernel mailing list with a newsreader and the "D" key. ]
Linus
Re: LANANA: Getting out of hand?
In reply to Linus TorvaldsQuoted 25 lines · Linus Torvalds
Quoted 3 lines · Alan Cox
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
For example, the only thing you need in order to boot is to have a nice clean "disk" major number. That's it. Nothing fancy, nothing more.
Look at what we have now:
- ramdisk: major 1. Fair enough - ramdisk is special, in that it doesn't have any "real hardware". No problem.
- SCSI disks:major 8, 65-71, - Compaq smart2: major 72-79 - Compaq CISS: major 104-111 - DASD; major 94 - IDE: major 3, 22, 33-34, 56-57, 88-91and then the small random ones.
Quoted 7 lines
NONE of these major numbers have _any_ redeeming qualities except for the ramdisk. They should all be _one_ major number, namely "disk". There are absolutely NO advantages to having separate devices for soem strange compaq controllers and IDE disks. There is _no_ point in having some SCSI disks show up at major 8, while others (who just happen to be attached to a scsi bus that is not driven by the generic SCSI layer) show up at major 104 or whatever.
[...]
Quoted 10 lines
How hard is it to generate a new "disk driver framework", and let people register themselves, kind of like the "misc" drivers do. Except we'd only allow DISKS. You could add something like
register_disk_driver("compaq-ciss", nr_disks, &my_queue);and then the disk driver framework will select a range of minor numbers for the disks, and forward all requests that come to those minor numbers to "
my_queue". No major numbers. No fixed minors. And the user sees _one_ disk major, and doesn't care _what_ the hell is behind it.
Looks exactly like what we used to do for serial ports on the m68k platform...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: LANANA: Getting out of hand?
In reply to Linus TorvaldsQuoted 5 lines
How hard is it to generate a new "disk driver framework", and let people register themselves, kind of like the "misc" drivers do. Except we'd only allow DISKS. You could add something like
register_disk_driver("compaq-ciss", nr_disks, &my_queue);
Why bother. Devfs does that already. Thats the enumeration problem
Quoted 4 lines
and then the disk driver framework will select a range of minor numbers for the disks, and forward all requests that come to those minor numbers to "
my_queue". No major numbers. No fixed minors. And the user sees _one_ disk major, and doesn't care _what_ the hell is behind it.
The user running devfs sees /dev/disc or /devices/disc and doesnt care whats behind it already. They also see what is scsi and the like providing they care to ask. The latter is essential to make ioctl work.
Doing a grep across about a large amount of source code I found several very definite uses the device type:
1 Is file A the same as file B
This continues to work fine
2 Is file A on mountpoint B
This continues to work fine
3 Are you running this on a sane device
Joystick, hdparm, ...
4 Which ioctl set can I use of device A
This breaks. Examples of this include tools like mt-st which has to use different ioctls according to the tape class. Our ioctls overlap so it isnt safe to issue them and pray
5 Deep nasty lowlevel grungy knowledge
Things like lilo that knows and to an extent has to know more about the universe than is nice.
3 and 4 are variants of the same thing really. The lack of any way other than the major number to say 'What ioctl classes does this device support'. IMHO thats a thing you have to fix first - a way to query the device and get back {"disk", "scsi-disk", "scsi-lowlevel"} or {"disk", "cpqarray"}
The underlying name/number thing is a red herring. You don't need that to do /dev/disc nicely. devfs rather proved it.
Alan
Re: LANANA: Getting out of hand?
In reply to Linus TorvaldsQuoted 36 lines · Linus Torvalds
Quoted 4 lines · Alan Cox
Except that Linus wont hand out major numbers, which means I can't even boot simply off such a device. I bet the vendors in question dont think the sun shines out of linus backside any more.
Actually, it does. It's just that some people have gotten so blinded by my a** that they can no longer see it any more ;)
The problem I have is that there are lots of _good_ solutions, but they all imply a bit more work than the bad ones.
What does that result in? Everybody continues to use the simple old setup, which required no thought at all, but that is a pain to maintain.
For example, the only thing you need in order to boot is to have a nice clean "disk" major number. That's it. Nothing fancy, nothing more.
Look at what we have now:
- ramdisk: major 1. Fair enough - ramdisk is special, in that it doesn't have any "real hardware". No problem.
- SCSI disks:major 8, 65-71, - Compaq smart2: major 72-79 - Compaq CISS: major 104-111 - DASD; major 94 - IDE: major 3, 22, 33-34, 56-57, 88-91and then the small random ones.
Quoted 7 lines
NONE of these major numbers have _any_ redeeming qualities except for the ramdisk. They should all be _one_ major number, namely "disk". There are absolutely NO advantages to having separate devices for soem strange compaq controllers and IDE disks. There is _no_ point in having some SCSI disks show up at major 8, while others (who just happen to be attached to a scsi bus that is not driven by the generic SCSI layer) show up at major 104 or whatever.
And then the IDE stuff is stiuoid to use the same major numbers for in fact entierly different devices like CD-ROM and IDE disk drivers on the same major... This makes it VERY uncomfortable to guarantee that for example the sector size and driver read ahead are properties tighted to the major number alone... In fact Linux is bundling read ahead with the major number only, in esp. inside the RAID drivers which is entierly wrong! (see blksize_size array and read_ahead array).
And yes the RAID drivers are in particular *VERY* stiupid in terms of major/minor number usage.
Interrupted sound with 2.4.4-ac6
In reply to Alexander ViroHi,
I built a nice mp3 player out of a AMD 486-DX133 and a soundblaster es1371. I always used 2.2.16 and it worked properly. Due to several reasons I want to switch to 2.4, so I tried my luck with 2.4.4-ac6.
Basically it works but the sound gets interrupted (around 0.5 - 5seconds silence) from time to time although the system is around 44% idle. This never happened with 2.2.16. The interrupts are not periodically, sometimes there are none for a minute, sometimes there are even interrupts around 5 seconds long.
I have to state that the data comes from an nfs-mounted directory - perhaps this is a reason?
Another interesting thing is that during those interrupts the processor usage of mpg123 decreases from 53% to around 20%, so it looks as if mpg123 can either not get data or not output data.
Do you have any clues? Are there perhaps some kernel parameters to tune (buffer size, dma...)?
Best Regards,
Hermann
Signature · 4 lines
,_, (O,O) "There is more to life than increasing its speed." ( ) -- Gandhi -"-"--------------------------------------------------------------
Quoted 5 lines · Linus Torvalds
Big device numbers are _not_ a solution. I will accept a 32-bit one, but no more, and I will _not_ accept a "manage by hand" approach any more. The time has long since come to say "No". Which I've done. If you can't make it manage the thing automatically with a script, you won't get a hardcoded major device number just because you're lazy.
As far as I can see it just needs a /proc/devices that also outputs minor ranges with names, and a small program similar to scsidev to generate nodes in /dev based on that on the fly on early bootup.
Is that what you have in mind?
-Andi
Quoted 10 lines · Andi Kleen
Quoted 5 lines · Linus Torvalds
Big device numbers are _not_ a solution. I will accept a 32-bit one, but no more, and I will _not_ accept a "manage by hand" approach any more. The time has long since come to say "No". Which I've done. If you can't make it manage the thing automatically with a script, you won't get a hardcoded major device number just because you're lazy.
As far as I can see it just needs a
/proc/devicesthat also outputs minor ranges with names, and a small program similar to scsidev to generate nodes in /dev based on that on the fly on early bootup.
You can do that with devfs. It provides all this information. If you really don't want to mount devfs over /dev, then mount it elsewhere and just use it as an information source to populate /dev. No need to add more code to the kernel to do it another way.
Regards, Richard.... Permanent: [email protected] Current: [email protected]
Quoted 3 lines
Note also that persistence of permissions and hardcoded in-kernel naming is a problem throughout proc... It's not unique to in-driver filesystems.
And the /proc namespace is a walking testimony to why numbers are not the primarily problem in /dev space and tidyness
Quoted 8 lines · Neil Brown
So I need a major number - to give to
devfs_register_blkdevat least. You don't want me to have a hardcoded one (which is fine) so I need a dynamically allocated one - yes?This means that we need some analogue to {get,put}_unnamed_dev that manages a range of dynamically allocated majors.
Is there such a beast already, or does someone need to write it? What range(s) should be used for block devices?
register_blkdev will assign a dynamic major to your block device, if a static one is not provided. This has been true since 2.2, maybe 2.0 IIRC.
Signature · 3 lines
Jeff Garzik | Game called on account of naked chick Building 1024 | MandrakeSoft |
Quoted 5 lines · Jeff Garzik
Note also that persistence of permissions and hardcoded in-kernel naming is a problem throughout proc... It's not unique to in-driver filesystems.
It's not so much about hardcoding the names as hardcoding the *STRUCTURE* of the names. For example, the current devfs has /dev/misc/* which is completely bogus -- it exposes an implementation detail (using the miscdev API as opposed to the charmajor API) which should be hidden; in fact a number of drivers have started their lives as miscdev devices and changed over time.
-hpa
Signature · 3 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt
Quoted 3 lines
It's not so much about hardcoding the names as hardcoding the *STRUCTURE* of the names. For example, the current devfs has
/dev/misc/*which is completely bogus -- it exposes an implementation detail (using the
The fact kernel space touches on naming directly is itself bogus. devfsd doing it is nice, devfs doing naming - well it could be done.
Quoted 3 lines
miscdev API as opposed to the charmajor API) which should be hidden; in fact a number of drivers have started their lives as miscdev devices and changed over time.
IHMO We have three types of namespaces
1. Kernel interface namespace. Policy set by the kernel. Mappings
constant and well defined where the underlying objects are well defined
- inodes, dev_t
You can make it a string if you like but at the end of the day has to be an opaque handle. For constant devices it also has to be a constant name. Otherwise the /dev file I archived with the corporate backup system turns out to be a different device when I restore the box after a problem and I reformat the wrong disk...
And yes some stuff really is dynamic. Trying to talk about USB devices in a constant way is kind of hard.
We could re-encode these as strings. In fact thats how AmigaOS and VMS seem to do it. But we have the standards that are based on numbers and people who do like to assume they have meaning (eg hdparm, some scsi tools, ...). At best the string is a variable length encoding of a cookie.
Another real horror we have is trademarks. We've already had people force changes on the name of kernel modules by threatening/asking because names have trademark value and they argue module names could be confusing.
*NOBODY* at the 2.5 kernel summit had an answer to that problem.
2. User namespaces. Language dependant. Policy dependant.
Can be dynamic, can be static, can be arbitary. Not set by kernel policy
/dev/foo
Generally has to be centrally managed to put an order on the name spaces.
3. Enumeration spaces
Things like /dev/disc on devfs. Spaces that allow you to walk across all devices with a given property. A device can be in many
I don't care how #2 is implemented. I care that I can implement #2 any way I like. I care that I can implement #2 compatibly with my existing apps and my existing backup system. I care that people who dont speak a word of English can internationalise it.
Quoted 5 lines · Alan Cox
You can make it a string if you like but at the end of the day has to be an opaque handle. For constant devices it also has to be a constant name. Otherwise the /dev file I archived with the corporate backup system turns out to be a different device when I restore the box after a problem and I reformat the wrong disk...
Why can't we configure this in user space? I think of something like /etc/major-numbers. We could then tell the kernel at module load time what major number to use for a given driver.
The corporate backup system then only needs to restore /dev and /etc/major-numbers at the same time.
I don't think this is the ideal solution. But it has some nice properties:
- no policy in kernel. Neither device names nor numbers are hard-coded
- no daemons needed, only some simple startup scripts
- no special filesystems needed, /dev is simple tar-compatible directory
- everybody can add drivers to his system as he wants, without the need to register a number. One entry in a config file is enough
- every single system only needs as many major numbers as there are drivers - so even 256 majors should be enough in most cases. (this may be limited by the fact that the existing numbers should be recommended as standard entries in /etc/major-numbers to stay backward compatible)
Of course there are disadvantages, the biggest problem I see are drivers compiled into the kernel. They need to get their major number from the command line, I think, which is pretty ugly.
Perhaps the above is pure bullshit and my proposal is not working for serveral reasons. But I think we should try to define our requirements to the device numbering/naming system, and then find a solution that meats these requirements - the final reason for choosing one solution should be a technical one, not personal preference.
Jan
Quoted 3 lines
Why can't we configure this in user space? I think of something like
/etc/major-numbers. We could then tell the kernel at module load time what major number to use for a given driver.
We've got one of those lists. H Peter Anvin maintains it.
Don't get me wrong - if in 2.5.x someone can produce a scheme which works and works well I'll be more than happy to be proved wrong, and Im sure hpa will be glad his registrar role now becomes default device naming not numbers and I suspect moves into the FHS/LSB. After all numbering or not most vendors will want to ship a common device naming scheme, at least unless they have fundamental reasons why not to (eg a desire to use arabic names)
Alan
Quoted 10 lines · Alan Cox
Quoted 9 lines
Quoted 4 lines
(c) does not require devfs. most distros ship without it afaik, and switching to it is not an overnight process, and requires devfsd to be useful in the real world.
It does, however, not manage permissions, nor does it provide for a sane namespace (it exposes too many internal implementation details in the interface -- in particular, the driver becomes part of the namespace, and devices move around between drivers regularly.)
Quoted 4 lines
It is also very hard to tar that device file.
As to devfsd well Al Viro was reporting races in it long ago that I don't believe Richard has had time to fix nor has anyone else fixed.
Actually, it was devfs, not devfsd that Al was complaining about. Fortunately these races are hard to trigger without deliberately trying to trigger them, otherwise I'd be inundated with bug reports :-/
Quoted 1 line
What is the state on devfs there ?
Getting very close now. This last weekend was my first time for ages that I've had an uninterrupted weekend to hack on Linux and didn't have other really urgent stuff to deal with.
Regards, Richard.... Permanent: [email protected] Current: [email protected]
Quoted 11 lines · H. Peter Anvin
Quoted 5 lines · Jeff Garzik
Register block device using existing API, and obtain a dynamically assigned major number. Export a tiny ramfs which lists all device nodes. Mounted on
/dev/snap,/dev/snap/0would be the first blkdev for snap's dynamically assigned major. (Al Viro said he has skeleton code to create such an fs, IIRC)It does, however, not manage permissions, nor does it provide for a sane namespace (it exposes too many internal implementation details in the interface -- in particular, the driver becomes part of the namespace, and devices move around between drivers regularly.)
True -- that capability is provided by devfs+devfsd, which is supported in the driver by using the existing 2.4 devfs hooks. For that case one would not mount the driver's devfs.
I look at it as an effective transition mechanism. Device numbers are frozen now, but devfs is not deployed now. My solution gets us from point A to point B, and is IMHO workable in the stable 2.4 series. We can go 100% devfs or whatever in 2.5 or 3.0..
Regards,
Jeff
Signature · 3 lines
Jeff Garzik | Game called on account of naked chick Building 1024 | MandrakeSoft |
Quoted 2 lines · Richard Gooch
So we add yet another series of hacks to avoid doing what's necessary?!?
We cannot change the world in a day. :)
"Doing what's necessary" is way beyond the scope of 2.4, IMHO.
Signature · 3 lines
Jeff Garzik | Game called on account of naked chick Building 1024 | MandrakeSoft |
Hi HPA, Linus, Alan,
Quoted 7 lines · H. Peter Anvin
Linus Torvalds has requested a moratorium on new device number assignments. His hope is that a new and better method for device space handing will emerge as a result.
Alan Cox has requested that I maintain a forked registry for his -ac kernel patch tree. I have agreed to do so once I have forked off the "final" version of the registry for Linus' tree.
[...]
I've been following the discussion and would like to throw in my few cents.
First of all, I see perfectly Linus' point of disliking the manual maintenance of device numbers. As the current solution is not elegant and requires a lot of work by the device registrar and probably more and more work in the future, this should be replaced by a better - automatic and elegant - mechanism in the future. Point taken.
But I'm really surprised reading that the device registry is about to close now.
Well, we need the better mechanism, before doing so.
At first sight, devfs looks like the solution to this. But, on a second sight, devfs looks like a compromise between a new system, which would completely abstract the details of the underlying hardware and just present the devices from a user interface point of view, and the current system. We get rid of static major/minors, but the naming scheme still imposes to know lots of details about the way your hardware is plugged together. Furthermore, it seems, many people dislike devfs a lot. Instead of fixing a few problems with devfs or (more likely) with devfsd, they seem to believe the concept is fundamentally broken, otherwise their behaviour could only be considered ridiculous.
So, we currently don't have a solution to this problem. A lot of good ideas have been proposed in this thread, but no working code that addresses all the issues (autoloading of modules, repeatability of naming, devices needed early in boot stage, ...) is there or was at least designed to a point where implementation is just a question of writing it down. Furthermore, some userspace apps use the major no to determine the exact type of a (otherwise similar) device to decide what functionality to offer or how to implement certain operations.
In short: This change breaks currently working things.
This can all be fixed, of course, but I doubt it can happen in very short time.
To be honest, I fail to believe that such a policy change is happening now, in the middle of a stable kernel series, and I fail to believe that this is really what Linus suggested.
IMHO, this policy change affects the kernel more than a major rework of VM, to just give an example. It's very definitely not stuff for 2.4.
As far as I know, HPA has not complained about his workload for the manual maintenance of the the LANANA. Currently, it still seems doable, and HPA is doing it, fortunately. Thanks! I've not seen anybody complain about the way he does it either.
So, I would be very pleased if we could agree, that it's acceptable to go on with the old manual device registry of HPA for the rest of the 2.4 kernel series. Let's start the new policy with 2.5.1!
And please no fork! Every fork splits the community in two parts and basically halves our power. I don't think this would help Linux to be accepted by more people or to be able to be used to solve more problems in a nice and efficient way.
I think I do very well understand one of the reasons, why Alan wants to stay with the old scheme. It (still) works.
How would you imagine to make a stable Linux distribution, if such a change happens now? I do not think that all apps can be fixed and a stable, reproducible and reliable mechanism to manage device nodes can be introduced within the time frame of 2.4 kernels.
Even switching a distro to use devfs only looks easier than this. So, we would need to keep to the old mechanism, if we don't want to risk stability and manageability of a distro. Which is paramount ... I would not like to be forced to use -ac kernels.
(Alan, don't get this wrong! It's great that you prepare kernels to test
somewhat more experimental features or drivers, but I would like to have the choice.)
If we start the new device management with 2.5.1, there's plenty of time to have the mechanism and the kernel stabilize, to get issues like automatic module loading sorted and to adapt distributions before 2.6/3.0 comes out. That's fine with me.
Well, maybe you never considered applying this policy change right now within 2.4, Linus. Well, ignore my posting then, if you like.
Best regards,
Signature · 4 lines
Kurt Garloff <[email protected]> [Eindhoven, NL] Physics: Plasma simulations <[email protected]> [TU Eindhoven, NL] Linux: SCSI, Security <[email protected]> [SuSE Nuernberg, FRG] (See mail header or public key servers for PGP2 and GPG public keys.)
Hi!
Quoted 6 lines
First of all, I apologize for not having sent this notice out sooner. This kind of writing is very painful to deal with.
Linus Torvalds has requested a moratorium on new device number assignments. His hope is that a new and better method for device space handing will emerge as a result.
Linus, Is that wise? I could understand moratorium during 2.5, but during 2.4?!
And worse, what about drivers that want to be merged into 2.2?
Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
Quoted 2 lines
Linus, Is that wise? I could understand moratorium during 2.5, but during 2.4?! And worse, what about drivers that want to be merged into 2.2?
2.2 will be using the same forked registry as 2.4-ac. I dont anticipate much being added to it that will need a major however