From f503f6b22fa54d1a65156a51d8b3311190c73ae5 Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Thu, 21 May 2009 22:22:37 +0200 Subject: udevd: implement a more efficient queue file format 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 --- udev/lib/libudev.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'udev/lib/libudev.h') diff --git a/udev/lib/libudev.h b/udev/lib/libudev.h index 9346eb4ddd..9b51ea3300 100644 --- a/udev/lib/libudev.h +++ b/udev/lib/libudev.h @@ -115,6 +115,8 @@ unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue) int udev_queue_get_udev_is_active(struct udev_queue *udev_queue); int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue); int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum); +int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue, + unsigned long long int start, unsigned long long int end); struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue); struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue); #endif -- cgit v1.2.3-54-g00ecf