* udevd messages lost on exit?
@ 2011-09-30 8:29 James Hunt
2011-09-30 9:03 ` Kay Sievers
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: James Hunt @ 2011-09-30 8:29 UTC (permalink / raw)
To: linux-hotplug
Hi All,
I'm investigating a problem in Ubuntu Oneiric where we think udev messages maybe be getting lost due
to the way that we're stopping udevd:
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/818177
In summary, at the end of our initramfs, we are doing this:
# Stop udevd, we'll miss a few events while we run init, but we catch up
udevadm control --exit
# Move /dev to the real filesystem
mount -n -o move /dev ${rootmnt}/dev
The problem is that most notably when using lvm2 the "--exit" call seems to be causing udev messages
relating to the *rootfs* to be lost so that the system fails to boot.
Looking at udevd.c, it does the following when requested to exit:
/* discard queued events and kill workers */
event_queue_cleanup(udev, EVENT_QUEUED);
worker_kill(udev, 0);
I'm currently trying to debug what is left in the queue to get a better handle on this, but I am
wondering if "udevadm control --exit" should request that udevd drain the queues rather than
discarding the messages for our case. Is the reason the messages are discarded to avoid slowing down
the boot coupled with the expectation that the caller will use "udevadm trigger" to catch up later?
Kind regards,
James.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: udevd messages lost on exit?
2011-09-30 8:29 udevd messages lost on exit? James Hunt
@ 2011-09-30 9:03 ` Kay Sievers
2011-09-30 9:33 ` James Hunt
2011-09-30 9:44 ` Kay Sievers
2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2011-09-30 9:03 UTC (permalink / raw)
To: linux-hotplug
On Fri, Sep 30, 2011 at 10:29, James Hunt <james.hunt@ubuntu.com> wrote:
> I'm investigating a problem in Ubuntu Oneiric where we think udev messages maybe be getting lost due
> to the way that we're stopping udevd:
>
> https://bugs.launchpad.net/ubuntu/+source/udev/+bug/818177
>
> In summary, at the end of our initramfs, we are doing this:
>
> # Stop udevd, we'll miss a few events while we run init, but we catch up
> udevadm control --exit
>
> # Move /dev to the real filesystem
> mount -n -o move /dev ${rootmnt}/dev
>
> The problem is that most notably when using lvm2 the "--exit" call seems to be causing udev messages
> relating to the *rootfs* to be lost so that the system fails to boot.
>
> Looking at udevd.c, it does the following when requested to exit:
>
> /* discard queued events and kill workers */
> event_queue_cleanup(udev, EVENT_QUEUED);
> worker_kill(udev, 0);
>
> I'm currently trying to debug what is left in the queue to get a better handle on this, but I am
> wondering if "udevadm control --exit" should request that udevd drain the queues rather than
> discarding the messages for our case. Is the reason the messages are discarded to avoid slowing down
> the boot coupled with the expectation that the caller will use "udevadm trigger" to catch up later?
--exit just does a clean shutdown, it will not check for pending
events, only already running stuff will be properly finished, but
nothing new will be started.
If you want queued stuff, queued in udevd or the kernel, to be all
handled before exiting, add a call to 'settle' before the --exit call.
Kay
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: udevd messages lost on exit?
2011-09-30 8:29 udevd messages lost on exit? James Hunt
2011-09-30 9:03 ` Kay Sievers
@ 2011-09-30 9:33 ` James Hunt
2011-09-30 9:44 ` Kay Sievers
2 siblings, 0 replies; 4+ messages in thread
From: James Hunt @ 2011-09-30 9:33 UTC (permalink / raw)
To: linux-hotplug
On 30/09/11 10:03, Kay Sievers wrote:
> --exit just does a clean shutdown, it will not check for pending
> events, only already running stuff will be properly finished, but
> nothing new will be started.
So if events are pending in udevd they will be lost unless trigger is called?
> If you want queued stuff, queued in udevd or the kernel, to be all
> handled before exiting, add a call to 'settle' before the --exit call.
Is that combination atomic?
Kind regards,
James Hunt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: udevd messages lost on exit?
2011-09-30 8:29 udevd messages lost on exit? James Hunt
2011-09-30 9:03 ` Kay Sievers
2011-09-30 9:33 ` James Hunt
@ 2011-09-30 9:44 ` Kay Sievers
2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2011-09-30 9:44 UTC (permalink / raw)
To: linux-hotplug
On Fri, Sep 30, 2011 at 11:33, James Hunt <james.hunt@ubuntu.com> wrote:
> On 30/09/11 10:03, Kay Sievers wrote:
>> --exit just does a clean shutdown, it will not check for pending
>> events, only already running stuff will be properly finished, but
>> nothing new will be started.
> So if events are pending in udevd they will be lost unless trigger is called?
There is no idea at all of any continuous handling of events from
initramfs to the real root. These are completely different rule sets
and the stuff from initramfs needs to be replayed anyway.
>> If you want queued stuff, queued in udevd or the kernel, to be all
>> handled before exiting, add a call to 'settle' before the --exit call.
> Is that combination atomic?
See above. You need to trigger anyway. The rootfs might configure the
devices differently than the initramfs. The device database usually
much more stuff to carry.
Kay
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-30 9:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30 8:29 udevd messages lost on exit? James Hunt
2011-09-30 9:03 ` Kay Sievers
2011-09-30 9:33 ` James Hunt
2011-09-30 9:44 ` Kay Sievers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).