linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Aniroop Mathur <aniroop.mathur@gmail.com>
Cc: linux-input@vger.kernel.org, a.mathur@samsung.com
Subject: Re: [PATCH] Input: Evdev - Avoid data loss when clock type is changed
Date: Tue, 4 Aug 2015 09:50:49 -0700	[thread overview]
Message-ID: <20150804165049.GA37185@dtor-ws> (raw)
In-Reply-To: <1438381732-29681-1-git-send-email-aniroop.mathur@gmail.com>

Hi Aniroop,

On Sat, Aug 01, 2015 at 03:58:52AM +0530, Aniroop Mathur wrote:
> When clock type is changed, previously stored data is flushed
> and therfore does not reach to upper layer or application.
> Data is critically important along with the timestamp.
> So to avoid data loss and send correct timestamp as well,
> lets not flush data upon clock type change and
> to send correct timestamp, store only monotonic timestamp during write
> and change monotonic clock time to desired clock time during read.

I wonder if this matters that much. The only time where this change would make
difference is when you have a reader thread and then a controlling
thread changing clocks. Then you probably do not want to lose events,
but you also would not know for given event what kind of timestamp it
uses.

On the other hand I expect that your application changes clock type the
very first thing after opening the event device. In this case the
flushing queue does not matter: you are losing events that happened
before you opened the device, so it does not really matter if you lose a
few more in the beginning.

I guess I need better understanding of your use case.

Thanks.

-- 
Dmitry

  reply	other threads:[~2015-08-04 16:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 22:28 [PATCH] Input: Evdev - Avoid data loss when clock type is changed Aniroop Mathur
2015-08-04 16:50 ` Dmitry Torokhov [this message]
2015-08-04 21:59   ` Aniroop Mathur
2015-08-04 22:24     ` Aniroop Mathur
2015-08-04 23:22     ` Dmitry Torokhov
2015-08-05  0:07       ` Aniroop Mathur
2015-08-05  0:19         ` Dmitry Torokhov

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=20150804165049.GA37185@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=a.mathur@samsung.com \
    --cc=aniroop.mathur@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).