IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Event processes now get re-used after they handled an event. This reduces
pressure on the CPU significantly because cloned event processes no longer
cause page faults in the main daemon. After the events have settled, the
no longer needed worker processes get killed.
The math in skip_to() was the wrong way round and allocated a
variable size array on the stack with a massively negative size.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
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>
UDev follows the kernel given name, and re-uses the kernel created
device node. If the kernel and spcecified udev rules disagree, the
udev specified node node is created and the kernel-created on is
deleted.
On Thu, Apr 23, 2009 at 11:39, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> I'm puzzled by this function:
>
> /* if we have not seen this seqnum, check if it is/was already queued */
> if (seqnum < udev_queue->last_seen_udev_seqnum) {
> udev_queue_get_udev_seqnum(udev_queue);
> if (seqnum < udev_queue->last_seen_udev_seqnum)
>
> Shouldn't the test be (seqnum > udev_queue->last_seen_udev_seqnum) ?
Messages send back by the udev daemon to the netlink socket are
multiplexed by the kernel and delivered to multiple clients. The
clients can upload a socket filter to let the kernel drop messages
not belonging to a certain subsystem. This prevent needless wakeups
and message processing for users who are only interested in a
subset of available events.
Recent kernels allow untrusted users to listen to the netlink
messages.
The messages send by the udev daemon are versioned, to prevent any
custom software reading them without libudev. The message wire format
may change with any udev version update.
For added protection, ignore any unicast message received on the
netlink socket or any multicast message on the kernel group not
received from the kernel.
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
The netlink socket is now used by udev event processes. We should take
care not to pass it to the programs they execute. This is the same way
the inotify fd was handled.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Instead of of our own private monitor socket, we send the
processed event back to our netlink socket, to the multicast
group 2 -- so any number of users can listen to udev events,
just like they can listen to kernel emitted events on group 1.
On Wed, Mar 18, 2009 at 16:00, Matthias Schwarzott <zzam@gentoo.org> wrote:
found out how the error occurs:
It is a difference between
A. udevadm test /sys/class/mem/null/
and
B. udevadm test /sys/class/mem/null
Case A was the case that showed the error behaviour. It seems udevadm is
confused by the trailing slash. This behaviour seems to be there since ages.
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>