reliability and scalability
I've got a couple more ideas for improving udevd, but before I go crazy with this I wanted to get some opinions from people more experienced than me.
First, how paranoid should we be about reliability? Right now there is a (low) possibility of udevd crashing with unhandled messages on its rx buffer, thus losing one or more hotplug events. Is this a problem? Would people welcome a patch that closes the loop by sending an ack back to udevsend?
Second, how many udev instances are we expecting to have outstanding at a time? There are a couple of places in udevd (specifically the devpath check and the udev_done code) that with the current data structures end up being worst case ofO(n^2). Is this a problem? The average user will never have an issue, but if we suddenly plug in a few thousand disks (a number that's been mentioned before), is it a big deal if it takes a bit longer to add them all? I see ways of getting around this, but it may be overkill.
Comments, anyone?
Chris
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 1 line · Chris Friesen
Comments, anyone?
Better get rid of udevd and keep track of the latest add and remove SEQNUMs in the database. unlink the devnodes and symlinks before creating new ones during add events.
Signature · 14 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Chris Friesen
I've got a couple more ideas for improving udevd, but before I go crazy with this I wanted to get some opinions from people more experienced than me.
First, how paranoid should we be about reliability? Right now there is a (low) possibility of udevd crashing with unhandled messages on its rx buffer, thus losing one or more hotplug events. Is this a problem? Would people welcome a patch that closes the loop by sending an ack back to udevsend?
I don't care. What you want to do with the information in udevsend?
Quoted 8 lines
Second, how many udev instances are we expecting to have outstanding at a time? There are a couple of places in udevd (specifically the devpath check and the
udev_donecode) that with the current data structures end up being worst case ofO(n^2). Is this a problem? The average user will never have an issue, but if we suddenly plug in a few thousand disks (a number that's been mentioned before), is it a big deal if it takes a bit longer to add them all? I see ways of getting around this, but it may be overkill.
We may limit the size of the run_queue, and hold back the forks when to many udev's already running.
thanks,
Kay
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 7 lines · Olaf Hering
Quoted 1 line · Chris Friesen
Comments, anyone?
Better get rid of udevd and keep track of the latest add and remove SEQNUMs in the database. unlink the devnodes and symlinks before creating new ones during add events.
And how would you re-order events in this situation?
No, udevd is needed.
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Chris Friesen
I've got a couple more ideas for improving udevd, but before I go crazy with this I wanted to get some opinions from people more experienced than me.
First, how paranoid should we be about reliability? Right now there is a (low) possibility of udevd crashing with unhandled messages on its rx buffer, thus losing one or more hotplug events. Is this a problem? Would people welcome a patch that closes the loop by sending an ack back to udevsend?
I would welcome this. We really don't want to loose events. But how long should udevsend wait before retrying the message? I can see this getting messy...
Quoted 2 lines
Second, how many udev instances are we expecting to have outstanding at a time?
As many as possible? :)
Quoted 7 lines
There are a couple of places in udevd (specifically the devpath check and the
udev_donecode) that with the current data structures end up being worst case ofO(n^2). Is this a problem? The average user will never have an issue, but if we suddenly plug in a few thousand disks (a number that's been mentioned before), is it a big deal if it takes a bit longer to add them all? I see ways of getting around this, but it may be overkill.
This is very easy to test with scsi-debug. I don't really think this is a issue right now, but if you want to try improving it a bit, please do.
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Greg KH
Quoted 7 lines · Olaf Hering
Quoted 1 line · Chris Friesen
Comments, anyone?
Better get rid of udevd and keep track of the latest add and remove SEQNUMs in the database. unlink the devnodes and symlinks before creating new ones during add events.
And how would you re-order events in this situation?
What do you mean with reorder? Maybe I miss the point.
I assume the database has some locking to serialize writes (maybe even reads).
- If an add event arrives, check if a remove event was recoreded. If the remove event had a higher number than this add event, record this add event as seen if no newer add event was seen, then exit. If no remove and no newer add event was seen, unlink the node and symlinks and recreate them. Record the current number as 'add'.
- If a remove event arrives, check if an add event was recorded. If the add event had a higher number, record this remove event if no newer remove event was seen, then exit.
Maybe something like this:
switch(action)
case add:
if (last.add > seqnum)
exit
if (last.remove > seqnum)
exit
last.add = seqnum
unlink (node)
mknod (node)
if (symlink) {
unlink (symlink)
ln (node, symlink)
}
exit
case remove:
if (last.add > seqnum)
exit
if (last.remove > seqnum)
exit
last.remove = seqnum
unlink (node)
if (symlink)
unlink (symlink)
exit
Quoted 1 line
No, udevd is needed.
I'm not convinced.
Signature · 14 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 6 lines · Chris Friesen
I've got a couple more ideas for improving udevd, but before I go crazy with this I wanted to get some opinions from people more experienced than me.
First, how paranoid should we be about reliability?
Oh, if forgot the paranoia :)
What should we do with the abstract socket.
It is open to any user, not only root.
We have to fix this!
Kay
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 7 lines · Olaf Hering
Quoted 5 lines · Greg KH
Quoted 4 lines · Olaf Hering
Quoted 1 line · Chris Friesen
Comments, anyone?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Better get rid of udevd and keep track of the latest add and remove SEQNUMs in the database. unlink the devnodes and symlinks before creating new ones during add events.
And how would you re-order events in this situation?
What do you mean with reorder? Maybe I miss the point.
You have to order the events that come in by the seqnum, right?
So if you get a new one, you have to place it in the proper place amoung all other outstanding events.
Quoted 8 lines
Maybe something like this:
switch(action)
case add:
if (last.add > seqnum)
exit
if (last.remove > seqnum)
exit
exit? Then do what? Sit and spin? You need something persistant to stick around and figure out what to do next.
And udev is not big at _all_. On my box it's the tiniest thing running by a _large_ ammount:
$ size /sbin/udevd text data bss dec hex filename 5205 52 20 5277 149d /sbin/udevd
It's still smaller than /bin/true :)
$ size /bin/true text data bss dec hex filename 8623 724 0 9347 2483 /bin/true
thanks,
greg k-h
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel