* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
@ 2010-01-06 1:05 Bartłomiej Zimoń
2010-01-06 22:48 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Bartłomiej Zimoń @ 2010-01-06 1:05 UTC (permalink / raw)
To: linux-kernel
Cc: rjw, aeriksson, stefan.seyfried, linux-pm, danborkmann, awalls
Dnia 6 stycznia 2010 0:05 "Rafael J. Wysocki" <rjw@sisk.pl> napisał(a):
> Well, I think you have some specific issue with pm-utils, but you're not
> telling us what it is. So, why exactly is pm-utils not suitable for your
> needs?
>
Rafael to be honest it's more dbus specific. I'm talking about
dbus as it is standard for system<->apps communication.
But please understand if we'll create kernel device with simple pm notification
It could be hooked by udev and next ... by DeviceKit-power/upower and after that
we have real standard. But to have this we must export "power" device - something
like my proof-of-concept module. This could be realy good start.
Best regards.
Bartłomiej Zimoń
PLD Linux, Kadu Team, FreeRunner user
http://kadu-im.blogspot.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
2010-01-06 1:05 [linux-pm] [suspend/resume] Re: userspace notification from module Bartłomiej Zimoń
@ 2010-01-06 22:48 ` Rafael J. Wysocki
0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-01-06 22:48 UTC (permalink / raw)
To: Bartłomiej Zimoń
Cc: linux-kernel, aeriksson, stefan.seyfried, linux-pm, danborkmann, awalls
On Wednesday 06 January 2010, Bartłomiej Zimoń wrote:
> Dnia 6 stycznia 2010 0:05 "Rafael J. Wysocki" <rjw@sisk.pl> napisał(a):
> > Well, I think you have some specific issue with pm-utils, but you're not
> > telling us what it is. So, why exactly is pm-utils not suitable for your
> > needs?
> >
>
> Rafael to be honest it's more dbus specific. I'm talking about
> dbus as it is standard for system<->apps communication.
That was my impression. :-)
Well, I don't like dbus too, but ...
> But please understand if we'll create kernel device with simple pm notification
> It could be hooked by udev and next ... by DeviceKit-power/upower and after that
> we have real standard. But to have this we must export "power" device - something
> like my proof-of-concept module. This could be realy good start.
... that doesn't make me think it should be sneakily replaced with "magic"
kernel modules or similar stuff.
As I already said many times in this thread before, please look for a solution
in the user space.
Rafael
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
2010-01-06 14:35 ` Anders Eriksson
@ 2010-01-15 20:02 ` Pavel Machek
0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2010-01-15 20:02 UTC (permalink / raw)
To: Anders Eriksson
Cc: Bart?omiej Zimo?, linux-kernel, awalls, linux-pm, danborkmann
On Wed 2010-01-06 15:35:34, Anders Eriksson wrote:
>
> uzi18@o2.pl said:
> > Ummm sorry, it's IM App, to be realible for such app it's needed to close
> > conn before suspend, because after resume tcp connections will wait
> > (especialy on linux) quiet a lot of time to broke and reconnect.
>
> I don't know the details here, but shouldn't the kernel fix this internally?
>
> If sufficient time have elapsed so the kernel _should_ have sent keep alives
> etc on an othervise idle connection, they shold be sent immediately on resume.
> If the other end has disappeared by then, the resulting port unreachable
> should trigger a local closure of the tcp state which the app will notice
> (EBADF, or similar). Or?
Patches welcome.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
[not found] ` <1ab86ec9.7bc73105.4b43cd45.c2747@o2.pl>
@ 2010-01-06 14:35 ` Anders Eriksson
2010-01-15 20:02 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Anders Eriksson @ 2010-01-06 14:35 UTC (permalink / raw)
To: Bartłomiej Zimoń
Cc: linux-kernel, awalls, linux-pm, Anders Eriksson, danborkmann
uzi18@o2.pl said:
> Ummm sorry, it's IM App, to be realible for such app it's needed to close
> conn before suspend, because after resume tcp connections will wait
> (especialy on linux) quiet a lot of time to broke and reconnect.
I don't know the details here, but shouldn't the kernel fix this internally?
If sufficient time have elapsed so the kernel _should_ have sent keep alives
etc on an othervise idle connection, they shold be sent immediately on resume.
If the other end has disappeared by then, the resulting port unreachable
should trigger a local closure of the tcp state which the app will notice
(EBADF, or similar). Or?
Seems to me the kernel should sit on enough info to handle this nicely.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
[not found] ` <11f818a7.4b53f68a.4b43bb9b.b3a7f@o2.pl>
@ 2010-01-05 23:05 ` Rafael J. Wysocki
0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-01-05 23:05 UTC (permalink / raw)
To: Bartłomiej Zimoń
Cc: linux-kernel, Anders Eriksson, Stefan Seyfried, linux-pm,
danborkmann, awalls
On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> Dnia 5 stycznia 2010 22:26 Stefan Seyfried <stefan.seyfried@googlemail.com> napisał(a):
> > On Tue, 05 Jan 2010 10:07:06 +0100
> > Anders Eriksson <aeriksson@fastmail.fm> wrote:
> >
> > >
> > > rjw@sisk.pl 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.
> >
> > No. 99% of the processes don't care about suspend. They don't need
> > notifications or anything.
> > The few that do care, register themselves with the power manager. They
> > get notified before suspend and the power manager might wait until they
> > tell him that they are ready.
> > A special case are processes that only want to inhibit suspend - the CD
> > burning application case - they just tell the power manager "I am
> > important and you must not suspend now". They do this even if there is
> > no suspend notification, and once they are done with the critical part
> > of their work, they remove their "inhibit flag".
> >
> > This all works pretty well already, and is really not very complicated.
>
> So pm could be very simple, and i think we don't need more.
> I want ask You how usualy such user (not root) process notification is done,
> You are talking about pm-utils right?
Well, I think you have some specific issue with pm-utils, but you're not
telling us what it is. So, why exactly is pm-utils not suitable for your
needs?
Rafael
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
2010-01-05 22:12 ` Bartłomiej Zimoń
@ 2010-01-05 23:03 ` Rafael J. Wysocki
[not found] ` <1ab86ec9.7bc73105.4b43cd45.c2747@o2.pl>
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-01-05 23:03 UTC (permalink / raw)
To: Bartłomiej Zimoń
Cc: linux-kernel, Anders Eriksson, linux-pm, awalls, danborkmann
On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> Dnia 5 stycznia 2010 22:23 "Rafael J. Wysocki" <rjw@sisk.pl> napisał(a):
> > On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> > > Dnia 5 stycznia 2010 10:07 Anders Eriksson <aeriksson@fastmail.fm> napisał(a):
> > > >
> > > > rjw@sisk.pl 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
2010-01-05 21:23 ` Rafael J. Wysocki
@ 2010-01-05 22:12 ` Bartłomiej Zimoń
2010-01-05 23:03 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Bartłomiej Zimoń @ 2010-01-05 22:12 UTC (permalink / raw)
To: linux-kernel; +Cc: uzi18, rjw, Anders Eriksson, linux-pm, awalls, danborkmann
Dnia 5 stycznia 2010 22:23 "Rafael J. Wysocki" <rjw@sisk.pl> napisał(a):
> On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> > Dnia 5 stycznia 2010 10:07 Anders Eriksson <aeriksson@fastmail.fm> napisał(a):
> > >
> > > rjw@sisk.pl 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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
2010-01-05 9:07 ` [linux-pm] " Anders Eriksson
[not found] ` <7e89c5d.77f82021.4b43a8d7.127e1@o2.pl>
@ 2010-01-05 21:26 ` Stefan Seyfried
[not found] ` <11f818a7.4b53f68a.4b43bb9b.b3a7f@o2.pl>
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Seyfried @ 2010-01-05 21:26 UTC (permalink / raw)
To: Anders Eriksson
Cc: Rafael J. Wysocki, Bartłomiej Zimoń,
linux-pm, linux-kernel, danborkmann, awalls
On Tue, 05 Jan 2010 10:07:06 +0100
Anders Eriksson <aeriksson@fastmail.fm> wrote:
>
> rjw@sisk.pl 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.
No. 99% of the processes don't care about suspend. They don't need
notifications or anything.
The few that do care, register themselves with the power manager. They
get notified before suspend and the power manager might wait until they
tell him that they are ready.
A special case are processes that only want to inhibit suspend - the CD
burning application case - they just tell the power manager "I am
important and you must not suspend now". They do this even if there is
no suspend notification, and once they are done with the critical part
of their work, they remove their "inhibit flag".
This all works pretty well already, and is really not very complicated.
--
Stefan Seyfried
"Any ideas, John?"
"Well, surrounding them's out."
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
[not found] ` <7e89c5d.77f82021.4b43a8d7.127e1@o2.pl>
@ 2010-01-05 21:23 ` Rafael J. Wysocki
2010-01-05 22:12 ` Bartłomiej Zimoń
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-01-05 21:23 UTC (permalink / raw)
To: Bartłomiej Zimoń
Cc: linux-kernel, Anders Eriksson, linux-pm, awalls, danborkmann
On Tuesday 05 January 2010, Bartłomiej Zimoń wrote:
> Dnia 5 stycznia 2010 10:07 Anders Eriksson <aeriksson@fastmail.fm> napisał(a):
> >
> > rjw@sisk.pl 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-pm] [suspend/resume] Re: userspace notification from module
2010-01-04 19:43 ` Rafael J. Wysocki
@ 2010-01-05 9:07 ` Anders Eriksson
[not found] ` <7e89c5d.77f82021.4b43a8d7.127e1@o2.pl>
2010-01-05 21:26 ` Stefan Seyfried
0 siblings, 2 replies; 10+ messages in thread
From: Anders Eriksson @ 2010-01-05 9:07 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Bartłomiej Zimoń, awalls, linux-pm, linux-kernel, danborkmann
rjw@sisk.pl 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.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-01-15 20:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-06 1:05 [linux-pm] [suspend/resume] Re: userspace notification from module Bartłomiej Zimoń
2010-01-06 22:48 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2010-01-02 13:29 Bartłomiej Zimoń
2010-01-03 23:45 ` [suspend/resume] " Rafael J. Wysocki
2010-01-04 0:51 ` Bartłomiej Zimoń
2010-01-04 19:43 ` Rafael J. Wysocki
2010-01-05 9:07 ` [linux-pm] " Anders Eriksson
[not found] ` <7e89c5d.77f82021.4b43a8d7.127e1@o2.pl>
2010-01-05 21:23 ` Rafael J. Wysocki
2010-01-05 22:12 ` Bartłomiej Zimoń
2010-01-05 23:03 ` Rafael J. Wysocki
[not found] ` <1ab86ec9.7bc73105.4b43cd45.c2747@o2.pl>
2010-01-06 14:35 ` Anders Eriksson
2010-01-15 20:02 ` Pavel Machek
2010-01-05 21:26 ` Stefan Seyfried
[not found] ` <11f818a7.4b53f68a.4b43bb9b.b3a7f@o2.pl>
2010-01-05 23:05 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®