lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 17 Apr 2016 01:47:24 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Tina Ruchandani <ruchandani.tina@...il.com>
Cc:	y2038@...ts.linaro.org, dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org, Wentao Xu <wentaox@...eaurora.org>,
	Thierry Reding <treding@...dia.com>,
	Hai Li <hali@...eaurora.org>
Subject: Re: [PATCH v2] drm/msm: Use 64-bit timekeeping

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ