From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Bill Gatliff <bgat@billgatliff.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] evdev: discard oldest event on buffer overflow
Date: Wed, 27 Oct 2010 16:57:04 -0700 [thread overview]
Message-ID: <20101027235704.GA12179@core.coreip.homeip.net> (raw)
In-Reply-To: <1288199398-7198-1-git-send-email-bgat@billgatliff.com>
On Wed, Oct 27, 2010 at 12:09:58PM -0500, Bill Gatliff wrote:
> On a buffer overflow, the head and tail pointers collide.
> This makes the buffer suddenly look empty, rather than
> full, which may confuse applications.
>
> This patch moves the tail pointer up one event on a buffer
> overflow, which "consumes" the oldest event in the buffer
> to make room for the incoming event. Thus, although data
> is lost due to the overflow (which is unavoidable), the
> data that remains is both recent and still time-ordered.
>
It does not really matter... You are losing part of the hardware state
regardless so the packet is invalid anyway. What would probably make
more sense is to ignore all events up until next packet boundary
(EV_SYN/SYN_REPORT) so userspace would get most up-to-date _full_ packet
(when it catches up).
Thanks.
--
Dmitry
next prev parent reply other threads:[~2010-10-27 23:57 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 [this message]
2010-10-28 0:11 ` Bill Gatliff
2010-10-28 0:30 ` Dmitry Torokhov
2010-10-28 4:25 ` Bill Gatliff
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=20101027235704.GA12179@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=bgat@billgatliff.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).