idle detection

Sean Egan seanegan at gmail.com
Thu Aug 2 00:21:32 EDT 2007


Did you really just reply to this today, or did it get massively delayed?

On 8/1/07, Richard Laager <rlaager at wiktel.com> wrote:
> On Wed, 2007-07-25 at 16:39 -0700, Sean Egan wrote:
> > 1. The preference for "how long before going idle," is effectively
> > useless
> I didn't realize we had a pref for this when I was looking at that code.

It was actually "how long before going auto-away as a result of idle,"
so I can understand the confusion. I changed the preference to mean
"how long before going idle," which seems to make much more sense.

> >  and poll that frequently when not idle.
> The current code should deliver this effect if you make the
> aforementioned change, right? We'd also need a pref change callback to
> fire check_idleness_timer() if that pref is updated.

I made the changes described, but didn't do anything on the pref
updating corner case.

> Once a second is insane. The current polling should be working with
> idle_recheck_interval, which is set to 60 seconds if you're using system
> idle. If it's not working like that, that's a bug.

It was not working like that, which caused a few "not coming back for
10 minutes" tickets.

> I picked the 60 seconds as a reasonable value, and I'm not alone in
> that:
> On Thu, 2007-07-26 at 01:33 -0400, John Bailey wrote:
> > a one minute poll interval seems a reasonable
> > compromise, because at most you're inaccruately shown as idle for 59
> > seconds or so
>
> Also, the average is approximately 30 seconds, which seems reasonable.

Not to me, it doesn't! :)

 If my Pidgin is set to "Show me as idle according to my keyboard and
mouse" use, and I've been using the keyboard and mouse for 50 seconds
(or even 30 seconds), I'm considering it a bug, and I'm not alone in
that.

We're currently every polling 3 seconds, which is fine by me. We used
to poll every 5 seconds, and we can swing that, too.

Without knowledge of how the power-saving kernel scheduler works, I
suspect polling every 60 seconds makes that huge a power difference
over every 5 or every 3.

A little bit of Googling shows at least one person
(http://lkml.org/lkml/2007/5/20/82) saving power by changing poll
times from 10 times a second to twice a second, so once every 3 or 5
seconds still seems fairly minor on the
how-often-are-interrupts-happening scale.

I would actually love to see an actual trial. Anyone volunteering?

> Back to your e-mail...
> On Wed, 2007-07-25 at 16:39 -0700, Sean Egan wrote:
> > This negates some of the power-saving goals of #1113, but if polling
> > is the only way to determine idle time, that seems unavoidable.
>
> I think everyone everywhere agrees we shouldn't be polling. We're
> waiting on X server changes, which, according to the source Mark found,
> have apparently happened but haven't made it to the users yet.

I think we should keep what we have now, polling as-needed when not
idle and once every 3 seconds to ensure decent user-visible latency,
and wait for whatever changes are needed for us to get a push model.

People who are super concerned about power usage should turn off idle
detection; perhaps – if we're feeling really tree-hugging – we can
even default not to do it on laptops, but given that this affects very
few people (only people using kernel 2.6.21 and later) and that I'd be
even most of those people who are using a very recent Linux on a
laptop would prefer a very low come-back-from-idle latency, I don't
think we should sacrifice user experience for this.

Thoughts?

-s.




More information about the Devel mailing list