All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents
@ 2009-05-26  9:52 Alan Jenkins
  2009-05-26 10:17 ` Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-05-26  9:52 UTC (permalink / raw)
  To: linux-hotplug

I believe this is the correct behaviour.  I'm highlighting this change
by making it a separate commit (even though the specific code will be
removed in the following commit).

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>

diff --git a/udev/test-udev.c b/udev/test-udev.c
index c6b8bf5..35737c1 100644
--- a/udev/test-udev.c
+++ b/udev/test-udev.c
@@ -70,7 +70,10 @@ int main(int argc, char *argv[])
 	sigaction(SIGTERM, &act, NULL);
 
 	/* trigger timeout to prevent hanging processes */
-	alarm(UDEV_EVENT_TIMEOUT);
+	if (udev_device_get_timeout(event->dev) > 0)
+		alarm(udev_device_get_timeout(event->dev));
+	else
+		alarm(UDEV_EVENT_TIMEOUT);
 
 	action = getenv("ACTION");
 	devpath = getenv("DEVPATH");
diff --git a/udev/udevd.c b/udev/udevd.c
index 5ee61d2..03ea26d 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -156,7 +156,10 @@ static void event_fork(struct udev_event *event)
 		sigaction(SIGHUP, &act, NULL);
 
 		/* set timeout to prevent hanging processes */
-		alarm(UDEV_EVENT_TIMEOUT);
+		if (udev_device_get_timeout(event->dev) > 0)
+			alarm(udev_device_get_timeout(event->dev));
+		else
+			alarm(UDEV_EVENT_TIMEOUT);
 
 		/* apply rules, create node, symlinks */
 		err = udev_event_execute_rules(event, rules);



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents
  2009-05-26  9:52 [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents Alan Jenkins
@ 2009-05-26 10:17 ` Kay Sievers
  2009-05-26 10:19 ` Alan Jenkins
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2009-05-26 10:17 UTC (permalink / raw)
  To: linux-hotplug

On Tue, May 26, 2009 at 11:52, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> I believe this is the correct behaviour.  I'm highlighting this change
> by making it a separate commit (even though the specific code will be
> removed in the following commit).

> -       alarm(UDEV_EVENT_TIMEOUT);
> +       if (udev_device_get_timeout(event->dev) > 0)
> +               alarm(udev_device_get_timeout(event->dev));
> +       else
> +               alarm(UDEV_EVENT_TIMEOUT);

That's the kernel supplied timeout value used for the firmware loader.
You really don't want to kill the event when this timeout expires. :)

The event_timeout is what we want, but that comes from the rules and
is not set at this time in the daemon.

Kay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents
  2009-05-26  9:52 [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents Alan Jenkins
  2009-05-26 10:17 ` Kay Sievers
@ 2009-05-26 10:19 ` Alan Jenkins
  2009-05-26 15:31 ` Kay Sievers
  2009-05-26 16:55 ` Alan Jenkins
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-05-26 10:19 UTC (permalink / raw)
  To: linux-hotplug

Kay Sievers wrote:
> On Tue, May 26, 2009 at 11:52, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
>   
>> I believe this is the correct behaviour.  I'm highlighting this change
>> by making it a separate commit (even though the specific code will be
>> removed in the following commit).
>>     
>
>   
>> -       alarm(UDEV_EVENT_TIMEOUT);
>> +       if (udev_device_get_timeout(event->dev) > 0)
>> +               alarm(udev_device_get_timeout(event->dev));
>> +       else
>> +               alarm(UDEV_EVENT_TIMEOUT);
>>     
>
> That's the kernel supplied timeout value used for the firmware loader.
> You really don't want to kill the event when this timeout expires. :)
>
> The event_timeout is what we want, but that comes from the rules and
> is not set at this time in the daemon.
>
> Kay
>   

Ok, I'm glad I kept this separate.  Don't apply patch 2 then :-).  I'll
remove this and resubmit.

Thanks
Alan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents
  2009-05-26  9:52 [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents Alan Jenkins
  2009-05-26 10:17 ` Kay Sievers
  2009-05-26 10:19 ` Alan Jenkins
@ 2009-05-26 15:31 ` Kay Sievers
  2009-05-26 16:55 ` Alan Jenkins
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2009-05-26 15:31 UTC (permalink / raw)
  To: linux-hotplug

On Tue, May 26, 2009 at 12:19, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:

> Don't apply patch 2 then :-).

No worry, we can not be that fast here. :) We need to get numbers first.

Threads don't come for free, they make udev much less reliable and
harder to debug, compared to the current model. When all events share
the same address space, and the memory for the events gets reused for
forever, a simple bug will likely bring down the entire service,
unlike today where an event process may crash, but the event
management daemon will survive. Actually, I don't remember that the
main udev ever crashed, and that will definitely change with the
threads. :)

I'm not against a threaded udevd, but we should have a good reason to
do it that way. We also need to get numbers on bigger boxes. Udev runs
on boxes with many thousands of events at bootup. we've seen boxes
with 20.000+ disks, where every disk has ~10 devices in sysfs. Some of
the SUSE customers requested to be able to run 4000+ events in
parallel, to bring the bootup time on such boxes down to a reasonable
time. That all works fine with today's udev and we need to be really
careful here.

Thanks,
Kay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents
  2009-05-26  9:52 [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents Alan Jenkins
                   ` (2 preceding siblings ...)
  2009-05-26 15:31 ` Kay Sievers
@ 2009-05-26 16:55 ` Alan Jenkins
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-05-26 16:55 UTC (permalink / raw)
  To: linux-hotplug

Kay Sievers wrote:
> On Tue, May 26, 2009 at 12:19, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
>
>   
>> Don't apply patch 2 then :-).
>>     
>
> No worry, we can not be that fast here. :) We need to get numbers first.
>
> Threads don't come for free, they make udev much less reliable and
> harder to debug, compared to the current model. When all events share
> the same address space, and the memory for the events gets reused for
> forever, a simple bug will likely bring down the entire service,
> unlike today where an event process may crash, but the event
> management daemon will survive. Actually, I don't remember that the
> main udev ever crashed, and that will definitely change with the
> threads. :)
>
> I'm not against a threaded udevd, but we should have a good reason to
> do it that way. We also need to get numbers on bigger boxes. Udev runs
> on boxes with many thousands of events at bootup. we've seen boxes
> with 20.000+ disks, where every disk has ~10 devices in sysfs. Some of
> the SUSE customers requested to be able to run 4000+ events in
> parallel, to bring the bootup time on such boxes down to a reasonable
> time. That all works fine with today's udev and we need to be really
> careful here.
>
> Thanks,
> Kay
>   

Noted and agreed.  I'll work towards a complete series which can be
tested and reviewed as a whole.

Thanks
Alan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-26 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26  9:52 [PATCH 1/2] udevd: respect the value of TIMEOUT in uevents Alan Jenkins
2009-05-26 10:17 ` Kay Sievers
2009-05-26 10:19 ` Alan Jenkins
2009-05-26 15:31 ` Kay Sievers
2009-05-26 16:55 ` Alan Jenkins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.