All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Bartłomiej Zimoń" <uzi18@o2.pl>
Cc: Andy Walls <awalls@radix.net>,
	Daniel Borkmann <danborkmann@googlemail.com>,
	linux-kernel@vger.kernel.org,
	pm list <linux-pm@lists.linux-foundation.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [suspend/resume] Re: userspace notification from module
Date: Sun, 3 Jan 2010 22:29:53 +0100	[thread overview]
Message-ID: <201001032229.53221.rjw@sisk.pl> (raw)
In-Reply-To: <65e5aef6.33251eb4.4b3fecf4.a2f99@o2.pl>

On Sunday 03 January 2010, Bartłomiej Zimoń wrote:
> Dnia 3 stycznia 2010 0:29 "Rafael J. Wysocki" <rjw@sisk.pl> napisał(a):
> > > Thanks for Your answare.
> > > Some points of my idea:
> > > - don't think everyone want to use pm-utils (didn't say it is bad)
> > 
> > That certainly is true, but I think these people won't have a problem setting
> > up their suspend scripts to trigger the notification anyway. :-)
> > 
> 
> But it means almoust always create dbus interface and send message by script.

Of course you don't need to do that.  For example, you can use a UNIX domain
socket for sending the notification from one user space process (a power
manager) to another one (application wanting to be notified) and the
confirmation that's safe to suspend the other way around.  Generally, arbitrary
message-passing interface between two processes would be fine IMO.

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

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

... 
> > At least, that requires some more discussion, so please tell us why you need
> > the kernel to notify the user space about suspend/hibernation.  IOW, what's the
> > final purpose of this?  [Added some CCs.]
> 
> Yes, it is only first step.
> Have created different point of view, not all linux boxes are desktops/laptops.
> What about embedeed solutions?
> Why app must implement all other to know about resume/suspend?
> Why not open file and know this easily?

And why not to open a socket?

Really, what I think you want is a standard way of notifying applications that
suspend or hibernation is going to happen, but you don't need the kernel to
take part in that directly.

Putting things into the kernel is not the only way to avoid overheads IMO.

... 
> First of all i want to start discussion about this topic and looks like started :)
> 
> So what was in my mind? There are lots of small devices today with linux.
> Lots of them has got unstandardized suspend/resume detection.

OK, so we need a standard here.  I can't agree more.  However, does that mean
the kernel has to be directly involved in that?  If it does, then why exactly?

> It could be too much info exposed from kernel by this module/propose i understand
> for program info about pm_post_resume event could be anought.
> 
> We have now 3types of suspend implementation and 1 kernel API inside.
> App typicaly need just 2-3 event types - suspending, resumming, idle.
> I dont want to slow down kernel suspend, block or something, just perform 
> some actions in apps - typicaly try to reconnect.
> It could be new kernel standard to easy adept some actions.
> 
> Why not pm-utils connect to such module and gather data?
> Then It could work as hal service.
> But hook on kernel like /sbin/init but for suspend and resume, looks like other solution.
> IOW sending event to kernel to perform action and launch userspace once 
> more just before pm-event chain ... check return_val, sounds like other 
> solution/ other kind of module.

Again, you don't need a kernel module for that.  Moreover, using a kernel
module for that is actually inconvenient.

> What about this discusion:
> http://lists.freedesktop.org/archives/devkit-devel/2009-December/000617.html

Well, it would be nice if the desktop people sent CCs of such discussions to
linux-pm.  Talking about the kernel without involving people who actually work
on it is not exactly productive IMO.

Rafael

  parent reply	other threads:[~2010-01-03 21:29 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-02 13:29 userspace notification from module Bartłomiej Zimoń
2010-01-02 14:04 ` Daniel Borkmann
2010-01-02 14:27   ` [suspend/resume] " Bartłomiej Zimoń
2010-01-02 15:11     ` Oliver Neukum
     [not found]     ` <6f52f5b81001020713j5435cfadr1143806a9026adc2@mail.gmail.com>
2010-01-02 15:15       ` Daniel Borkmann
2010-01-02 15:40         ` Andy Walls
2010-01-02 15:56           ` Daniel Borkmann
2010-01-02 18:26             ` Bartłomiej Zimoń
2010-01-02 21:01               ` Rafael J. Wysocki
     [not found]                 ` <7cf4f51f.5fc2a5cd.4b3fc3ad.c849c@o2.pl>
2010-01-02 23:29                   ` Rafael J. Wysocki
2010-01-02 23:29                     ` Rafael J. Wysocki
2010-01-03  1:03                     ` Bartłomiej Zimoń
2010-01-03  9:30                       ` Daniel Borkmann
2010-01-03  9:30                       ` Daniel Borkmann
2010-01-03 10:06                         ` Daniel Borkmann
2010-01-03 10:06                         ` Daniel Borkmann
2010-01-03 11:01                           ` Bartłomiej Zimoń
2010-01-03 21:49                             ` Rafael J. Wysocki
2010-01-03 21:49                             ` Rafael J. Wysocki
2010-01-04 13:38                               ` Stefan Seyfried
2010-01-04 13:38                               ` Stefan Seyfried
2010-01-03 21:33                         ` Rafael J. Wysocki
2010-01-03 21:33                         ` Rafael J. Wysocki
2010-01-03 21:29                       ` Rafael J. Wysocki
2010-01-03 21:29                       ` Rafael J. Wysocki [this message]
2010-01-03 22:53                         ` Bartłomiej Zimoń
2010-01-03 23:30                           ` Rafael J. Wysocki
2010-01-03 23:30                           ` Rafael J. Wysocki
2010-01-03 23:35                             ` Bartłomiej Zimoń
2010-01-03 23:45                               ` Rafael J. Wysocki
2010-01-03 23:45                               ` Rafael J. Wysocki
2010-01-04  0:51                                 ` Bartłomiej Zimoń
2010-01-04  0:51                                 ` Bartłomiej Zimoń
2010-01-04  1:06                                   ` Bartłomiej Zimoń
2010-01-04 19:43                                   ` Rafael J. Wysocki
2010-01-05  9:07                                     ` [linux-pm] " Anders Eriksson
2010-01-05 21:02                                       ` Bartłomiej Zimoń
2010-01-05 21:23                                         ` [linux-pm] " Rafael J. Wysocki
2010-01-05 22:12                                           ` Bartłomiej Zimoń
2010-01-05 22:12                                           ` [linux-pm] " Bartłomiej Zimoń
2010-01-05 23:03                                             ` Rafael J. Wysocki
2010-01-05 23:03                                             ` [linux-pm] " Rafael J. Wysocki
2010-01-05 23:37                                               ` Bartłomiej Zimoń
2010-01-06 14:35                                                 ` [linux-pm] " Anders Eriksson
2010-01-06 20:37                                                   ` [linux-pm] [suspend/resume] Re: userspace notific ation " Bartłomiej Zimoń
2010-01-06 20:49                                                     ` Roland Dreier
2010-01-06 20:56                                                       ` Roland Dreier
2010-01-06 20:56                                                       ` Roland Dreier
2010-01-06 20:49                                                     ` Roland Dreier
2010-01-06 20:37                                                   ` Bartłomiej Zimoń
2010-01-15 20:02                                                   ` [suspend/resume] Re: userspace notification " Pavel Machek
2010-01-15 20:02                                                   ` [linux-pm] " Pavel Machek
2010-01-06 14:35                                                 ` Anders Eriksson
2010-01-05 21:23                                         ` Rafael J. Wysocki
2010-01-05 21:26                                       ` [linux-pm] " Stefan Seyfried
2010-01-05 22:22                                         ` Bartłomiej Zimoń
2010-01-05 23:05                                           ` Rafael J. Wysocki
2010-01-05 23:05                                           ` [linux-pm] " Rafael J. Wysocki
2010-01-06  0:43                                             ` Bartłomiej Zimoń
2010-01-06 10:10                                           ` Stefan Seyfried
2010-01-05 21:26                                       ` Stefan Seyfried
2010-01-05  9:07                                     ` Anders Eriksson
2010-01-04 19:43                                   ` Rafael J. Wysocki
2010-01-04 12:46                                 ` Daniel Borkmann
2010-01-04 19:45                                   ` Rafael J. Wysocki
2010-01-04 19:45                                   ` Rafael J. Wysocki
2010-01-04 12:46                                 ` Daniel Borkmann
2010-01-03 23:35                             ` Bartłomiej Zimoń
2010-01-03 17:20                     ` Bartłomiej Zimoń
2010-01-03 17:20                     ` Bartłomiej Zimoń
2010-01-03 21:50                       ` Rafael J. Wysocki
2010-01-03 21:50                       ` Rafael J. Wysocki
2010-01-09 10:32                 ` Pavel Machek
2010-01-09 13:40                   ` Rafael J. Wysocki
2010-01-15 20:03                     ` Pavel Machek
2010-01-15 20:03                       ` Pavel Machek
2010-01-15 22:14                       ` Rafael J. Wysocki
2010-01-15 22:14                         ` Rafael J. Wysocki
2010-01-16  3:00                         ` Eric Miao
2010-01-16  3:00                           ` Eric Miao
2010-01-16 17:00                           ` Stanislav Brabec
2010-01-16 17:00                             ` Stanislav Brabec
2010-01-16 18:12                             ` Pavel Machek
2010-01-16 18:12                               ` Pavel Machek
2010-01-16 22:05                               ` Rafael J. Wysocki
2010-01-16 22:05                                 ` Rafael J. Wysocki
2010-01-16 22:19                                 ` Pavel Machek
2010-01-16 22:19                                   ` Pavel Machek
2010-01-16 22:25                                   ` Pavel Machek
2010-01-16 22:25                                     ` Pavel Machek
2010-01-16 22:31                                     ` Rafael J. Wysocki
2010-01-16 22:31                                       ` Rafael J. Wysocki
2010-01-16 22:26                                   ` Rafael J. Wysocki
2010-01-16 22:26                                     ` Rafael J. Wysocki
2010-01-17 13:07                                     ` Pavel Machek
2010-01-17 13:07                                       ` Pavel Machek
2010-01-17 13:26                                       ` Russell King - ARM Linux
2010-01-17 13:26                                         ` Russell King - ARM Linux
2010-01-19  5:15                                         ` Pavel Machek
2010-01-19  5:15                                           ` Pavel Machek
2010-01-16 22:32                                 ` Russell King - ARM Linux
2010-01-16 22:32                                   ` Russell King - ARM Linux
2010-01-16 18:12                           ` Pavel Machek
2010-01-16 18:12                             ` Pavel Machek
2010-01-16 18:12                         ` Pavel Machek
2010-01-16 18:12                           ` Pavel Machek
2010-01-16 22:07                           ` Rafael J. Wysocki
2010-01-16 22:07                             ` Rafael J. Wysocki
2010-01-16 22:14                             ` Pavel Machek
2010-01-16 22:14                               ` Pavel Machek
2010-01-16 22:21                               ` Rafael J. Wysocki
2010-01-16 22:21                                 ` Rafael J. Wysocki
2010-01-02 21:20               ` Bartłomiej Zimoń
2010-01-02 14:31   ` Bartłomiej Zimoń
2010-01-02 22:34 Bartłomiej Zimoń
2010-01-03  8:31 Bartłomiej Zimoń
2010-01-03 11:06 Bartłomiej Zimoń
2010-01-03 23:17 Bartłomiej Zimoń
2010-01-03 23:17 Bartłomiej Zimoń
2010-01-06  1:05 [linux-pm] " Bartłomiej Zimoń
2010-01-06 22:48 ` Rafael J. Wysocki
2010-01-06  1:05 Bartłomiej Zimoń

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001032229.53221.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=awalls@radix.net \
    --cc=danborkmann@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    --cc=uzi18@o2.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.