userspace notification from module
Dnia 2 stycznia 2010 22:01 "Rafael J. Wysocki" <[email protected]> napisał(a):
Quoted 26 lines · Bartłomiej Zimoń
Quoted 21 lines
Dnia 2 stycznia 2010 16:56 Daniel Borkmann <[email protected]> napisał(a):
Quoted 11 lines
Hi Andy,
2010/1/2 Andy Walls <[email protected]>:
Quoted 8 lines
Why not:
a. write a module that implements a device node that supports
poll(), andb. have a user space process
select()on the fd for read or exception notificationQuoted 8 lines
Quoted 1 line
?
This is, of course, another possible solution that is more "cleaner" than the one with the signals.
Then, your userspace program would have another thread polling for the device node. Question is which timeout would be appropriate to be "CPU friendly" and to keep notification latency short?Quoted 3 lines
Just need as fast as possible solution and on the other hand acceptable for kernel sources. Usually programs needs just to disconnect something or set one flag.
Even if program will have no time for this it could be enough just to send this precious info.
Quoted 6 lines
Perhaps I don't understand correctly what you're trying to achieve, but at the moment suspend is always started from user space, this way or another, and on the majority (all?) of the modern distros pm-utils is involved in that. So, why don't you provide a pm-utils hook for your process (like, for example, NetworkManager)?
Thanks for Your answare.
Some points of my idea:
- don't think everyone want to use pm-utils (didn't say it is bad)
- this code is standard for all implementation of suspend/hibernate/resume
- it is small
- it have less overhead, dont need dbus and all rest services.
- could be even used partialy by pm-utils
- it is perfect just to notify about event
Some opposits:
- program will have less time to do what it want than with pm-utils
- all rest
Please correct me if i'm wrong.
Best regards
Bartłomiej Zimoń
PLD Linux, Kadu Team