All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Tina Ruchandani <ruchandani.tina@gmail.com>
Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Thierry Reding <treding@nvidia.com>
Subject: Re: [PATCH v2] drm/msm: Use 64-bit timekeeping
Date: Sun, 17 Apr 2016 01:47:24 +0200	[thread overview]
Message-ID: <4683452.tNFHTvCUEu@wuerfel> (raw)
In-Reply-To: <20160413095214.GA101605@localhost>

On Wednesday 13 April 2016 02:52:14 Tina Ruchandani wrote:
>                         ktime_t rem = ktime_sub(*timeout, now);
> -                       struct timespec ts = ktime_to_timespec(rem);
> -                       remaining_jiffies = timespec_to_jiffies(&ts);
> +                       struct timespec64 ts = ktime_to_timespec64(rem);
> +
> +                       remaining_jiffies = timespec64_to_jiffies(&ts);
> 

Hi Tina,

The change looks correct to me, but I wonder if we should optimize
this code a little more, as it does two expensive 64-bit divisions.

How about

	remaining_jiffies = msecs_to_jiffies(ktime_ms_delta(*timeout, now));

which only does one 64-bit division, and it's one that we can probably
optimize out in the future (we can check in ktime_ms_delta whether the
difference is more than 2^32 nanoseconds as the fast path).

	Arnd
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Tina Ruchandani <ruchandani.tina@gmail.com>
Cc: y2038@lists.linaro.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Wentao Xu <wentaox@codeaurora.org>,
	Thierry Reding <treding@nvidia.com>, Hai Li <hali@codeaurora.org>
Subject: Re: [PATCH v2] drm/msm: Use 64-bit timekeeping
Date: Sun, 17 Apr 2016 01:47:24 +0200	[thread overview]
Message-ID: <4683452.tNFHTvCUEu@wuerfel> (raw)
In-Reply-To: <20160413095214.GA101605@localhost>

On Wednesday 13 April 2016 02:52:14 Tina Ruchandani wrote:
>                         ktime_t rem = ktime_sub(*timeout, now);
> -                       struct timespec ts = ktime_to_timespec(rem);
> -                       remaining_jiffies = timespec_to_jiffies(&ts);
> +                       struct timespec64 ts = ktime_to_timespec64(rem);
> +
> +                       remaining_jiffies = timespec64_to_jiffies(&ts);
> 

Hi Tina,

The change looks correct to me, but I wonder if we should optimize
this code a little more, as it does two expensive 64-bit divisions.

How about

	remaining_jiffies = msecs_to_jiffies(ktime_ms_delta(*timeout, now));

which only does one 64-bit division, and it's one that we can probably
optimize out in the future (we can check in ktime_ms_delta whether the
difference is more than 2^32 nanoseconds as the fast path).

	Arnd

  reply	other threads:[~2016-04-16 23:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  9:52 [PATCH v2] drm/msm: Use 64-bit timekeeping Tina Ruchandani
2016-04-13  9:52 ` Tina Ruchandani
2016-04-16 23:47 ` Arnd Bergmann [this message]
2016-04-16 23:47   ` Arnd Bergmann
2016-04-21 11:35   ` Tina Ruchandani
2016-04-21 11:39     ` Tina Ruchandani
2016-04-21 11:39       ` Tina Ruchandani
2016-04-21 12:21       ` Arnd Bergmann
2016-04-21 12:21         ` Arnd Bergmann

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=4683452.tNFHTvCUEu@wuerfel \
    --to=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruchandani.tina@gmail.com \
    --cc=treding@nvidia.com \
    --cc=y2038@lists.linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.