Re: [RFC PATCH] kobject: fix uevent helper execution order issues

From: zhoumin
Date: Wed Aug 20 2025 - 10:21:27 EST


Hi Greg

Thanks for your patience.

> Why are you not looking at the SEQNUM value? That should be what orders
> the events, right? Otherwise how would any of this work? :)

> Also, what usermode helper program are you using that requires a binary?
> What is wrong with udev?

Due to historical reasons, our system does not use udev and relies entirely
on custom shell scripts to handle kobject events.

The helper_lock and UMH_WAIT_EXEC in the kernel ensure that the uevent
helper serializes the execution of our shell scripts. That is why I
proposed the RFC patch to change UMH_NO_WAIT to UMH_WAIT_EXEC—for our use
case, this change provides clear benefits without downsides, aslo it avoids
blocking like UMH_WAIT_PROC while improving script execution order.

Regarding SEQNUM: using it would require parsing and tracking global
sequence numbers manually. In contrast, using a file lock would allow me to
focus only on serializing events for the same kobject, since events from
different objects don’t require synchronization.

If you believe this patch isn’t suitable for mainline, I’m open to
implementing a SEQNUM-based approach for better event ordering instead.

Best regards,
zhoumin