2010-01-05 21:23:11

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [linux-pm] [suspend/resume] Re: userspace notification from module

On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> Dnia 5 stycznia 2010 10:07 Anders Eriksson <[email protected]> napisał(a):
> >
> > [email protected] said:
> > >> > I don't see a problem with this in principle, although I don't think signals
> > >> > are very suitable for this particular purpose, because you need two-way
> > >> > communication between the power manager and the processes it's going to
> > >> > notify (because it has to wait for the processes to finish their preparations
> > >> > and to tell it that they are ready).
> >
> > Wouldn't there need to be dependecy tracking for the userspace processes? A
> > process couldn't signal "done" until it know there's no more work to do, which
> > requires all other processes to finish up first.
> >
>
> Not all processes will need pm notification.
>
> Just in case, could this "power manager" be provided as userspace
> driver for kernel (for example compiled as UIO)?

I don't really understand why you want to do that in the kernel. Is there
any particular reason why this cannot be done in the user space?

Rafael


2010-01-05 22:12:23

by Bartłomiej Zimoń

[permalink] [raw]
Subject: Re: [linux-pm] [suspend/resume] Re: userspace notification from module

Dnia 5 stycznia 2010 22:23 "Rafael J. Wysocki" <[email protected]> napisał(a):
> On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> > Dnia 5 stycznia 2010 10:07 Anders Eriksson <[email protected]> napisał(a):
> > >
> > > [email protected] said:
> > > >> > I don't see a problem with this in principle, although I don't think signals
> > > >> > are very suitable for this particular purpose, because you need two-way
> > > >> > communication between the power manager and the processes it's going to
> > > >> > notify (because it has to wait for the processes to finish their preparations
> > > >> > and to tell it that they are ready).
> > >
> > > Wouldn't there need to be dependecy tracking for the userspace processes? A
> > > process couldn't signal "done" until it know there's no more work to do, which
> > > requires all other processes to finish up first.
> > >
> >
> > Not all processes will need pm notification.
> >
> > Just in case, could this "power manager" be provided as userspace
> > driver for kernel (for example compiled as UIO)?
>
> I don't really understand why you want to do that in the kernel. Is there
> any particular reason why this cannot be done in the user space?
>

Problem is with notification from pm-utils. Dbus for session is only
user session waid and it is almost imposible to send something
from systembus or it needs lots of magic.

Even if i'll use pm-utils, must provide way to notify my app.
Looks like no standard way here, that's bad, every app has it's own?

I think this way - if kernel is processes manager and if it sends
"some unknown" signal to every process before kernel suspend so why
not send sepcific and known signal instread.

But now we have DeviceKit-power/upower whatever but it doesn't provide
this feature or something simmilar to relay on.

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

2010-01-05 23:03:13

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [linux-pm] [suspend/resume] Re: userspace notification from module

On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> Dnia 5 stycznia 2010 22:23 "Rafael J. Wysocki" <[email protected]> napisał(a):
> > On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> > > Dnia 5 stycznia 2010 10:07 Anders Eriksson <[email protected]> napisał(a):
> > > >
> > > > [email protected] said:
> > > > >> > I don't see a problem with this in principle, although I don't think signals
> > > > >> > are very suitable for this particular purpose, because you need two-way
> > > > >> > communication between the power manager and the processes it's going to
> > > > >> > notify (because it has to wait for the processes to finish their preparations
> > > > >> > and to tell it that they are ready).
> > > >
> > > > Wouldn't there need to be dependecy tracking for the userspace processes? A
> > > > process couldn't signal "done" until it know there's no more work to do, which
> > > > requires all other processes to finish up first.
> > > >
> > >
> > > Not all processes will need pm notification.
> > >
> > > Just in case, could this "power manager" be provided as userspace
> > > driver for kernel (for example compiled as UIO)?
> >
> > I don't really understand why you want to do that in the kernel. Is there
> > any particular reason why this cannot be done in the user space?
> >
>
> Problem is with notification from pm-utils. Dbus for session is only
> user session waid and it is almost imposible to send something
> from systembus or it needs lots of magic.

Don't use dbus, then.

> Even if i'll use pm-utils, must provide way to notify my app.
> Looks like no standard way here, that's bad, every app has it's own?

Isn't there a possibility to introduce a standard way of doing that without
involving the kernel directly?

> I think this way - if kernel is processes manager and if it sends
> "some unknown" signal to every process before kernel suspend so why
> not send sepcific and known signal instread.

We _can_ do that, but what would a process be supposed to do after receiving
such a signal?

> But now we have DeviceKit-power/upower whatever but it doesn't provide
> this feature or something simmilar to relay on.

You're still not saying what you really need. So, what's the application you
have in mind that needs a notification from the _kernel_ so badly?

Rafael