Re: [Hdaps-devel] [PATCH] hdaps - switch to using input-polldev

From: Shem Multinymous
Date: Mon Jul 09 2007 - 02:13:24 EST


Hi,

On 7/9/07, Dmitry Torokhov <dtor@xxxxxxxxxxxxx> wrote:
On Monday 09 July 2007 01:29, Shem Multinymous wrote:
> > Every input event carries a timestamp so even if there are irregularities
> > in taking the samples you should be able to account for it.
>
> The issue is how good are the input event timestamps. The way it works
> is that the EC samples the analog sensor at some fixed rate and makes
> them available over the LPC bus. If the hdaps driver consumes these
> samples at the same rate then the timestamps will be accurate up to a
> small phase difference, which is mostly inconsequential. But if the
> hdaps driver gets scheduled irregularly, its timestamps will be offset
> by varying amounts, which will completely throw off computation (e.g.,
> think of estimating the angular velocity).

Timers do not guarantee you that they will be fired at the exact time.
If system is under load and there are hard IRQs they will also be
delayed.

I understand there's no guaranteed scheduling with either timers or
workqueues, but that doesn't mean we should ignore the quantitative
difference when it's so relevant.

Are there any hard numbers on this?


> A delay of 20ms in invoking the userspace daemon is negligible, but a
> timing variance of 20ms in the driver's measurements is devastating.

Even if you know that there is such variance?

Yes, because you'll now need 4-5 samples to reasonably estimate
something like angular velocity, and 100ms are no longer negligible.


> > Have 2nd input device's ->open() method call input_open_device() for
> > the first one.
>
> Won't that create an overhead by the redundant, unused notifications?

They won't leave input core so nothing really noticeable.

Sounds good, then. It's a bit of a hack, but the benefits are well
worth it (if we can resolve the scheduling issue).

Shem
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/