mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Zygo Blaxell <zblaxell@furryterror.org>
Cc: John Stultz <john.stultz@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: A desktop environment[1] kernel wishlist
Date: Tue, 28 Oct 2014 13:36:45 +0100	[thread overview]
Message-ID: <1414499805.2406.6.camel@hadess.net> (raw)
In-Reply-To: <20141027205936.GE17380@hungrycats.org>

On Mon, 2014-10-27 at 16:59 -0400, Zygo Blaxell wrote:
> On Mon, Oct 27, 2014 at 03:28:04PM +0100, Bastien Nocera wrote:
> > On Wed, 2014-10-22 at 13:04 -0400, Zygo Blaxell wrote:
> > > On Tue, Oct 21, 2014 at 08:09:38PM +0200, Bastien Nocera wrote:
> > > > On Tue, 2014-10-21 at 11:00 -0700, John Stultz wrote:
> > > > > On Tue, Oct 21, 2014 at 10:14 AM, Bastien Nocera <hadess@hadess.net> wrote:
> > > > > >> As for: 'Export of "wake reason" when the system wakes up (rtc alarm,
> > > > > >> lid open, etc.) and wakealarm (/sys/class/rtc/foo/wakealarm)
> > > > > >> documentation'
> > > > > >>
> > > > > >> Can you expand more on the rational for the need here? Is this for UI
> > > > > >> for power debugging, or something else?
> > > > > >
> > > > > > No, it would be used for automating backups, or implementing
> > > > > > suspend->hibernation transitions. For example, right before the machine
> > > > > > suspends, I would schedule it to wake up in a hour. If I get woken up by
> > > > > > the rtc alarm (and not by the user through a lid open), I might:
> > > > > > - check that I'm plugged into the AC, it's night, and in the vicinity of
> > > > > > the server that handles my backups and so backup the system.
> > > > > > - check whether the battery is low, and hibernate the machine (if it
> > > > > > supports it, obviously).
> > > > > >
> > > > > > We cannot do that if we can't make out whether the wake-up came from a
> > > > > > user action, or the alarm we set.
> > > > > 
> > > > > I suspect wakeup type reporting is maybe not the best way to go about
> > > > > this, since there may be a number of causes for wakeups and they can
> > > > > arrive closely together in different orders, which can result in
> > > > > races.
> > > > > 
> > > > > For instance, if the machine suspends, and sets an alarm to be woken
> > > > > up at midnight to do a backup, if the user resumes their laptop at
> > > > > 11:59:59, should the backup still proceed at midnight?
> > > > 
> > > > No. And I would expect that we would get a wake up type of "power
> > > > button" or "lid open" in this case.
> > > 
> > > I have been using something like this for the last 7 years or so.
> > > The relevant inputs are:
> > > 
> > > 	1. is the user present (is there recent input on HID devices,
> > > 	keyboard/mouse, but ignore devices like light sensors, 3D
> > > 	accelerometers, and ACPI virtual keys)?
> > 
> > If the user woke the machine up through the power button, you wouldn't
> > see that from user-space. You could detect that the lid was opened,
> > because you have state.
> > 
> > > 	2. which network connection(s) are available to reach the
> > > 	backup server?
> > > 
> > > 	3. how much power is available (if on battery, how much run
> > > 	time left?)
> > > 
> > > 	4. what is the policy (do backups happen at a specific time
> > > 	of day, or whenever they can?)
> > > 
> > > 	5. was a backup completed successfully in the last N hours?
> > > 
> > > Note the absence of any information about the cause of recent
> > > suspend/resume activity, or any input from suspend/resume at all.
> > 
> > How do I tell my environment not to wake the screen up when the machine
> > was woken up by an alarm I scheduled to launch a backup? 
> 
> Lid closed?  Screen off (nobody can see it, it wastes power on battery,
> and lengthens charge time on AC).
> 
> Lid open and user input?  Screen on.
> 
> Lid open and user disabled time-based screen power saving?  Screen on.
> 
> These are not symmetrical.  To wake up the screen, the screen needs to
> be visible, and the policy conditions to wake up the screen need to be
> met.  Spontaneously firing up a backlight at full power in a dark room
> in the middle of the night may not be appreciated by the system owner.

How do I detect that the screen is visible on a tablet? I could turn on
the webcam to see if a face is detected ;)

Maybe the wake-up reason isn't good enough on its own, but how do I know
which one the possible wake-up reasons was the last one to trigger?


  reply	other threads:[~2014-10-28 11:37 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  8:49 Bastien Nocera
2014-10-21 13:11 ` Sergey
2014-10-22  2:58   ` Minchan Kim
2014-10-22 16:52   ` Dan Streetman
2014-10-22 20:16   ` Heinrich Schuchardt
2014-10-27 16:11     ` Sergey "Shnatsel" Davidoff
2014-10-27  9:23   ` Pavel Machek
2014-10-27 16:02     ` Sergey "Shnatsel" Davidoff
2014-10-31  9:36       ` Jan Kara
2014-11-03 18:21         ` Heinrich Schuchardt
2014-11-04  9:28           ` Jan Kara
2014-11-04 19:55             ` Heinrich Schuchardt
2014-11-05 17:18               ` Jan Kara
2014-10-21 17:04 ` John Stultz
2014-10-21 17:14   ` Bastien Nocera
2014-10-21 18:00     ` John Stultz
2014-10-21 18:09       ` Bastien Nocera
2014-10-21 19:10         ` John Stultz
2014-10-27 14:19           ` Bastien Nocera
2014-10-27 16:56             ` John Stultz
2014-10-28 22:57               ` One Thousand Gnomes
2014-10-30 14:41                 ` Bastien Nocera
2014-10-30 23:39                   ` One Thousand Gnomes
2014-10-31 14:03                     ` Bastien Nocera
2014-11-03 14:17                       ` One Thousand Gnomes
2014-10-30 14:35               ` Bastien Nocera
2014-10-30 23:25                 ` One Thousand Gnomes
2014-10-31 14:01                   ` Bastien Nocera
2014-11-21 19:08             ` Pavel Machek
2014-10-21 19:23         ` Andy Lutomirski
2014-10-22 17:04         ` Zygo Blaxell
2014-10-27 14:28           ` Bastien Nocera
2014-10-27 20:59             ` Zygo Blaxell
2014-10-28 12:36               ` Bastien Nocera [this message]
2014-10-28 14:36                 ` John Stultz
2014-10-31 13:54                   ` Bastien Nocera
2014-10-31 17:38                     ` John Stultz
     [not found]                 ` <CANszf4gaozN9YHzxUToRP9CaA1VVEV9vcz_X6LDL1zW3fH4Fow@mail.gmail.com>
2014-10-28 16:41                   ` Fwd: " Rogelio Serrano
2014-10-27  9:28         ` Pavel Machek
2014-10-27 14:31           ` Bastien Nocera
2014-10-28 18:50             ` suspend to partition " Pavel Machek
2014-10-30 13:57               ` Bastien Nocera
2014-10-29 19:19             ` Andy Lutomirski
2014-10-29 20:26               ` Theodore Ts'o
2014-10-29 21:16                 ` Pavel Machek
2014-10-30 14:45                   ` Bastien Nocera
2014-10-30 14:53                     ` Andy Lutomirski
2014-10-30 15:07                       ` Bastien Nocera
2014-10-30 18:23                         ` Pavel Machek
2014-10-31 13:57                           ` Bastien Nocera
2014-10-30 15:05                     ` Theodore Ts'o
2014-10-30 15:15                       ` Bastien Nocera
2014-10-30 15:34                         ` Theodore Ts'o
2014-10-30 15:36                           ` Bastien Nocera
2014-10-30 17:41                         ` Pavel Machek
2014-10-31 13:59                           ` Bastien Nocera
2014-10-30 23:21                         ` One Thousand Gnomes
2014-10-30 23:19                       ` One Thousand Gnomes
2014-10-30 14:42                 ` Bastien Nocera
2014-10-28 22:42           ` One Thousand Gnomes
2014-10-21 18:24     ` Geert Uytterhoeven
2014-10-27 14:20       ` Bastien Nocera
2014-10-27 15:31         ` Geert Uytterhoeven
2014-10-27 15:44           ` Bastien Nocera
2015-04-30 16:25   ` Bastien Nocera
2015-04-30 17:10     ` John Stultz
2015-04-30 17:23       ` Olof Johansson
2015-04-30 18:54         ` Chirantan Ekbote
2015-05-01  9:02           ` Tomeu Vizoso
2015-05-04 22:19             ` Rafael J. Wysocki
2015-05-05  6:05               ` Tomeu Vizoso
2015-05-05 12:31                 ` Rafael J. Wysocki
2015-05-07 16:54                   ` One Thousand Gnomes
2015-05-07 21:03                     ` Rafael J. Wysocki
2015-05-08  7:09                       ` Tomeu Vizoso
2015-05-04 22:12           ` Rafael J. Wysocki
2015-05-04 23:30             ` Chirantan Ekbote
2015-05-05 10:46               ` Bastien Nocera
2015-05-05 19:22                 ` Chirantan Ekbote
2015-05-06 12:41                   ` Bastien Nocera
2015-05-05 14:39               ` Alan Stern
2015-05-05 17:58                 ` Chirantan Ekbote
2015-05-05 19:35                   ` Alan Stern
2015-05-05 20:58                     ` Chirantan Ekbote
2015-05-05 23:56                       ` Rafael J. Wysocki
2015-05-05 23:38                         ` David Lang
2015-05-05 23:51                           ` Rafael J. Wysocki
2015-05-07 17:03                       ` One Thousand Gnomes
2015-05-07 18:21                         ` Chirantan Ekbote
2015-05-05 23:47               ` Rafael J. Wysocki
2015-05-06 17:40                 ` Chirantan Ekbote
2015-05-07 23:19                   ` Rafael J. Wysocki
2015-05-11 22:12                 ` Pavel Machek
2015-05-12  0:45                   ` Rafael J. Wysocki
2014-10-21 19:28 ` Andy Lutomirski
2014-10-21 19:43   ` Al Viro
2014-10-21 19:47     ` Andy Lutomirski
2014-10-27 13:55   ` Bastien Nocera
2014-10-27 15:12     ` Andy Lutomirski
2014-10-27 15:45       ` Bastien Nocera
2014-10-27 16:08         ` Andy Lutomirski
2014-10-27 16:09           ` Bastien Nocera
2014-10-27 16:22             ` Al Viro

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=1414499805.2406.6.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zblaxell@furryterror.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome