Skip to contentSkip to conversation

userspace notification from module

suspend/resume Bartłomiej Zimoń 1 participant 1 message Jan 3, 2010

lore
Share & tools
lore
#0 lore raw

Dnia 3 stycznia 2010 22:29 "Rafael J. Wysocki" <[email protected]> napisał(a):

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

To put it in a different way, you apparently want the kernel to notify the user space of an event originating from the user space and my question is why not to set up the user space to generate the notification without relying on the kernel to do that.

Quoted 9 lines
Quoted 1 line

Because now kernel know better what is going on.

That's because it's just been told by the user space about that.

Basically, you want something like this to happen:

process A ->(suspend) kernel
kernel ->(suspending) process B

Yes.

Quoted 8 lines

where the kernel won't wait for process B to do whatever it has to do before suspending. In my opinion it'd be better to do something like this

process A ->(suspending) process B
process B ->(ack) process A
process A ->(suspend) kernel

...

Please forget for a moment about pm-utils.

I was thinking about sf like this:
pm-notify is registered in pm_notifier_chain or called before pm_notifiers_chain pm-notify -> (suspending) all registerd processes
some processes ->(ack) pm-notify
to consider - after timeout ( 1s. could be ok) pm-notify will send NOTIFY_OK, kernel will cont. suspending

It could be even UIO module but there are no pm events reachable there?

I cant understand why kernel cant be simple power manager.

Consider this: add one more signal (SIGPREFREEZ, SIGPOSTFREEZ) and send this before/after suspend to processes. It could be simplest way and we have notified processes.

If pm-notify idea is not clean, we must extend pm-utils or write something new (with backends dbus, ipc, scripts, ...)
But You see? We still have no information from kernel about events (especialy resume) or maybe i dont see this ;/

Thanks for your understanding Rafael :)

Best regards.
Bartłomiej Zimoń
PLD Linux, Kadu Team, FreeRunner user
http://kadu-im.blogspot.com/