Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbcDPXrl (ORCPT ); Sat, 16 Apr 2016 19:47:41 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:63383 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbcDPXrk (ORCPT ); Sat, 16 Apr 2016 19:47:40 -0400 From: Arnd Bergmann To: Tina Ruchandani Cc: y2038@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Wentao Xu , Thierry Reding , Hai Li Subject: Re: [PATCH v2] drm/msm: Use 64-bit timekeeping Date: Sun, 17 Apr 2016 01:47:24 +0200 Message-ID: <4683452.tNFHTvCUEu@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160413095214.GA101605@localhost> References: <20160413095214.GA101605@localhost> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:zgt3z1IySw1OkyBi8MlkEkCm4nUB+a2k19xSCrx0n9hH0WSQqfT TTCD+bIZkDDMIS7OXlQBCn8AJ27L26HQDQneGCoPFQx/4n2otEETmF8L/71qBqZxLss5Op/ Yt6fYmws/0lTHsDUwg5f8PQcx+ZEjHuoT5uaoQ1gjPSox3zKLCs7GSaDLaJSwZOtwdTdCyZ Uvg60EETifYuNxiJGQ6rQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:iwppVuHVw0A=:SpsYcIWS+5FhskYKcY2O6v 2FQxBHpUZO/XSCbZAfXuf/9HW+9nt7Tn2b2TAsUbePG5RON7iHfRQFQEnQYQ8fgF+1igpYYBw qChDgLHzY28jAkfQ2FnV92EM19r0gDByCEDDC/goqw2Jn4OnSRKV5Ue7npe4gQ005AzhcW76t XvYfCUZfr5BiRffCahh5nO4l6c/qAMtaXb8rqIlHYVuGDQ+xhqkTG3kx1EMNuELVsjCx+2CVH fHP5SjgYG2zMl6uQk0PJ7FPpvehNHWWWqrQeizbHx8cyBmJO9cfzrmuhM1WWRB0e+xwhBVS1w X5O2LCWvoP5uaNjppzbFMvTBlMlV71m9FLGwoIBKmvpKbar80OgDFmoLgF6s+E8K2OcQOgONw WesY7gZXjBRlja1m1ZhFrC9cif7bhqedhqGUxMp+bqkR0jHWID74IVZgTVBaQljQc7pTwioWk 4GZ1J+E9UWURlv1jitt5WWLdrCaTNWkY2LvrBb6UsvJbF9KcSJEJw8uPdPtrvUWSp0Vn7E6eO kv7gJ8b1VYSGkxRFfLaRSYootFZFmkU//CHI1AYNwPVWahog92QamuDB0p99PQfcEy6C6QwJh yGjiBCdRViWrHWSL0Rp7v8CmPCe2R8PmWj11wNLxnhjPHageM2luYzNS43bn8MBzIFheThvvi U06BYDAiWJOE3WJrmH7+Jx5X0rt09RG71xhhwfDdFprMd3TiBzvJDi/2wNA+MHJVWrlPZJCEA U7pJnAlhnlDPsTDe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 862 Lines: 23 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