2006-08-14 20:07:56

by Giuseppe Bilotta

[permalink] [raw]
Subject: Polling for battery stauts and lost keypresses (was: Touchpad problems with latest kernels)

On Mon, 14 Aug 2006 12:06:06 -0400, Dmitry Torokhov wrote:

> On many laptops (including mine) polling battery takes a loooong time
> and is done in SMI mode in BIOS causing lost keypresses, jerky mouse
> etc. It is pretty common problem. I think I have my ACPI client
> refreshing every 3 minutes.

BTW, polling battery status takes a lot on a Dell Inspiron 8200 too,
and all keypresses and mouse movements (and I think even network
IRQs?) are totally *dead* while polling.

However, The Other OS(tm) *seems* to do it right enough to have no
noticeable keypress losses, even when updating the battery status. Is
it using different system calls, or what?

--
Giuseppe "Oblomov" Bilotta

[W]hat country can preserve its liberties, if its rulers are not
warned from time to time that [the] people preserve the spirit of
resistance? Let them take arms...The tree of liberty must be
refreshed from time to time, with the blood of patriots and
tyrants.
-- Thomas Jefferson, letter to Col. William S. Smith, 1787


2006-08-14 20:17:04

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: Polling for battery stauts and lost keypresses (was: Touchpad problems with latest kernels)

On 8/14/06, Giuseppe Bilotta <[email protected]> wrote:
> On Mon, 14 Aug 2006 12:06:06 -0400, Dmitry Torokhov wrote:
>
> > On many laptops (including mine) polling battery takes a loooong time
> > and is done in SMI mode in BIOS causing lost keypresses, jerky mouse
> > etc. It is pretty common problem. I think I have my ACPI client
> > refreshing every 3 minutes.
>
> BTW, polling battery status takes a lot on a Dell Inspiron 8200 too,
> and all keypresses and mouse movements (and I think even network
> IRQs?) are totally *dead* while polling.
>
> However, The Other OS(tm) *seems* to do it right enough to have no
> noticeable keypress losses, even when updating the battery status. Is
> it using different system calls, or what?
>

I am not sure, but there are many things that may affect it:

1. Battry attributes are divided into 2 groups - static (i think they
go into /proc/acpi/battery/<name>/info and dynamic
(/proc/acpi/batetry/state). Static attributes take really long time to
pull and they do not change so it may wery well be they are polled one
at startup. Dynamic attributes are cheaper to poll and even then OS
may cache access or limit rate.

2. Quite often there are OEM drivers that are tweaked to a specific
hardware and involve hardware-specific hacks.

--
Dmitry