Re: Synaptics and keyboard losing interrupts w/ACPI ?

Karl Hegbloom
2004-04-04T05:54:39Z

On Sat, 2004-04-03 at 21:29, Dmitry Torokhov wrote:
> On Sunday 04 April 2004 12:16 am, Karl Hegbloom wrote:
> > Is there any reason why the ACPI code cannot cache that info, rather
> > than looking it up each time the /proc file is accessed? (which is what
> > I think it does now... am I right?)
>
> It sort of does.. that's why there /proc/acpi/battery/BATX/info (slow access,
> mostly static data) and /proc/acpi/battery/BATX/state. Now if only
> applications weren't reading both of them all the time...

But the thing is that the kernel can know when a battery gets jacked in,
removed, or swapped for a fresh one, but a user space application
cannot. If the application caches that information, there needs to be a
way for the kernel to notify it of a battery change. But if the kernel
caches it, reading the battery information only when a new battery is
inserted, then returning that cached information on read of the "info"
file, the application need not concern itself with such things, and the
read can happen quickly. Obviously the state information must be
updated each time it is requested.