Re: [suspend/resume] Re: userspace notification from module

From: BartÅomiej ZimoÅ
Date: Sun Jan 03 2010 - 18:18:12 EST


Dnia 3 stycznia 2010 22:29 "Rafael J. Wysocki" <rjw@xxxxxxx> napisaÅ(a):
> > > 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.
> >
> > 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.

> 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/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/