From: Bill Gatliff <bgat@billgatliff.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] evdev: discard oldest event on buffer overflow
Date: Wed, 27 Oct 2010 21:25:23 -0700 [thread overview]
Message-ID: <AANLkTi=mSMSYR-FuqvRp6cW3PBuVaKgRKez5qZ0aQsEy@mail.gmail.com> (raw)
In-Reply-To: <20101028003048.GB12179@core.coreip.homeip.net>
On Wed, Oct 27, 2010 at 5:30 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Wed, Oct 27, 2010 at 05:11:28PM -0700, Bill Gatliff wrote:
>> I still think my patch is a genuine improvement as-is, however.
>
> Sorry, I am unconvinced that it is an improvement.
The current code clobbers the queue suddenly and entirely on overflow,
and replaces all the events therein with the current one. My version
simply discards the oldest event to make room for the newest one.
I'll agree that my patch doesn't utterly and completely fix the
problem, but I have verified that at least with a flood of incoming
multitouch packets, the system still generally behaves itself--- which
is far more than it was able to do with the code that I replaced.
How else would you be convinced? You can't possibly believe that the
current code needs to stay in place, can you?
The thing with touch events specifically is that they contain tons of
redundant information, so losing a few old ones here and there
generally doesn't cause problems--- but losing a whole bunch of them
at the moment of overflow DOES seem to cause problems. And touch
events tend to be bursty, making them more likely to trigger such
overflows in the first place.
With keycodes, on the other hand, you don't want to lose any of them.
Ever. But such devices don't tend to generate events as fast, and the
recent versions of the evdev queue did such a poor job on overflow
that it's pretty clear that overflows must not have happened that
often. Never, perhaps.
That's why even in its imperfect state, my patch seems to improve
things--- because it makes a difference under conditions where
dropping portions of a packet don't seem to matter as much. It
doesn't get triggered in cases where dropping an event will almost
certainly lead to problems.
The alternative, of course, is to smarten-up the evdev queues so that
they work at the level of entire packets, rather than individual
events. In the meantime, I'll proffer my patch as a small step in the
right direction. Especially considering where we are coming from.
b.g.
--
Bill Gatliff
bgat@billgatliff.com
next prev parent reply other threads:[~2010-10-28 4:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 17:09 [PATCH] evdev: discard oldest event on buffer overflow Bill Gatliff
2010-10-27 23:57 ` Dmitry Torokhov
2010-10-28 0:11 ` Bill Gatliff
2010-10-28 0:30 ` Dmitry Torokhov
2010-10-28 4:25 ` Bill Gatliff [this message]
2010-10-30 7:33 ` Dmitry Torokhov
2010-10-28 7:51 ` Henrik Rydberg
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='AANLkTi=mSMSYR-FuqvRp6cW3PBuVaKgRKez5qZ0aQsEy@mail.gmail.com' \
--to=bgat@billgatliff.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).