Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934572AbdHYVRA (ORCPT ); Fri, 25 Aug 2017 17:17:00 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:33028 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932374AbdHYVQ7 (ORCPT ); Fri, 25 Aug 2017 17:16:59 -0400 MIME-Version: 1.0 In-Reply-To: References: <1495856035-6622-1-git-send-email-john.stultz@linaro.org> <1495856035-6622-5-git-send-email-john.stultz@linaro.org> <150366841319.27971.6041120504203143444@mail.alporthouse.com> From: John Stultz Date: Fri, 25 Aug 2017 14:16:57 -0700 Message-ID: Subject: Re: [RFC][PATCH 4/4] time: Clean up CLOCK_MONOTONIC_RAW time handling To: Chris Wilson Cc: lkml , Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Kevin Brodsky , Will Deacon , Daniel Mentz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 841 Lines: 19 On Fri, Aug 25, 2017 at 11:55 AM, John Stultz wrote: > I'll look over the code again to see if I can catch anything by > review. Worse case if we can't get any traction on this in a day or so > I'll submit a revert. I think I found the issue. In tk_update_ktime_data() I add the raw_sec and shifted down tk->tkr_raw.xtime_nsec to the base. But we already add the tk->tkr_raw.xtime_nsec to the offset and shift it all down in the timekeeping_delta_to_ns called from ktime_get_raw, so we effectively are accumulating the nsecs portion faster then we should. This only crops up for internal ktime_get_raw() users, but not getrawmonotonic64() which uses the timespec generation rather then the ktime method, which is why this wasn't seen by userspace time tests. I'll send a patch for testing shortly. thanks -john