summaryrefslogtreecommitdiff
path: root/udev/udevadm-settle.c
AgeCommit message (Collapse)Author
2009-05-29udevadm: settle - add --exit-if-exists=<file>Kay Sievers
2009-05-21udevadm: settle - make --timeout=0 workingKay Sievers
2009-05-21udevd: implement a more efficient queue file formatAlan Jenkins
Directory lookups show up in profiling. The queue files are responsible for a large proportion of file-related system calls in udev coldplug. Instead of creating a file for each event, append their details to a log file. The file is periodically rebuilt (garbage-collected) to prevent it from growing indefinitely. This single queue file replaces both the queue directory and the uevent_seqnum file. On desktop systems the file tends not to grow beyond one page. So it should also save a small amount of memory in tmpfs. Tests on a running EeePC indicate average savings of 5% *udevd* cpu time as measured by oprofile. __link_path_walk is reduced from 1.5% to 1.3%. It is not completely clear where the rest of the gains come from. In tests running ~400 events, the queue file is rebuilt about 5 times. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-05-20udevadm: settle - fix timeoutAlan Jenkins
The timeout wasn't working when settle was run as root: # udevadm control --stop-exec-queue # udevadm trigger # udevadm settle --timeout=1 ... (hangs) Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-05-05remove asmlinkageKay Sievers
2009-03-12udevadm: settle - synchronise with the udev daemonScott James Remnant
There's still a slight race condition when using udevadm settle, if the udev daemon has a pending inotify event but hasn't yet generated the "change" uevent for it, the kernel and udev sequence numbers will match and settle will exit. Now udevadm settle will send a control message to udevd, which will respond by sending SIGUSR1 back to the waiting udevadm settle once it has completed the main loop iteration in which it received the control message. If there were no pending inotify events, this will simply wake up the udev daemon and allow settle to continue. If there are pending inotify events, they are handled first in the main loop so when settle is continued they will have been turned into uevents and the kernel sequence number will have been incremented. Since the inotify event is pending for udevd when the close() system call returns (it's queued as part of the kernel handling for that system call), and since the kernel sequence number is incremented by writing to the uevent file (as udevd does), this solves the race. When the settle continues, if there were pending inotify events that udevd had not read, they are now pending uevents which settle can wait for. Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-03-11udevadm: settle - use timeout signal, instead of loop counterKay Sievers
2009-03-07udevadm: add text for new options to command and man pageKay Sievers
2009-03-04udevadm: settle - add --seq-start= --seq-end=Kay Sievers
It might be useful in some cases not to wait for "all" events. $ read START < /sys/kernel/uevent_seqnum $ (do something which may create uevents) $ udevadm settle --seq-start=$START
2009-02-05test: add test for empty and non-existent ATTRKay Sievers
2009-01-23udevadm: settle - fix typoKay Sievers
2008-12-08udevadm: settle - allow --timeout=0 and --quietKay Sievers
2008-10-24fix uninitialized variable warningsKay Sievers
2008-10-02use no_argument, required_argument, optional_argument in longoptsKay Sievers
2008-10-01udevadm: settle - use libudev queueKay Sievers
2008-09-10use size definitions from libudevKay Sievers
2008-09-10get rid of udev_sysdeps.cKay Sievers
2008-09-10update file headersKay Sievers
2008-09-08move udev_ctrl to libudev-privateKay Sievers
2008-09-06use libudev code, unify logging, pass udev context around everywhereKay Sievers
2008-09-04udevadm: move init from commands to udevadmKay Sievers
2008-09-03udevadm: rename internal functions to udevadm_*Kay Sievers
2008-09-03udevadm: rename source filesKay Sievers