From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965072AbcKJRxf (ORCPT ); Thu, 10 Nov 2016 12:53:35 -0500 Received: from casper.infradead.org ([85.118.1.10]:56408 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935657AbcKJRxd (ORCPT ); Thu, 10 Nov 2016 12:53:33 -0500 Date: Thu, 10 Nov 2016 17:53:31 +0000 (GMT) From: James Simmons To: Arnd Bergmann cc: Greg Kroah-Hartman , "Dilger, Andreas" , "devel@driverdev.osuosl.org" , "Drokin, Oleg" , Linux Kernel Mailing List , Lustre Development List Subject: Re: [lustre-devel] [PATCH] staging: lustre: ldlm: pl_recalc time handling is wrong In-Reply-To: <5149342.oboLeYkUcs@wuerfel> Message-ID: References: <1478573240-12850-1-git-send-email-jsimmons@infradead.org> <1594836.LAbS3nYoXQ@wuerfel> <20161110122108.GA7580@kroah.com> <5149342.oboLeYkUcs@wuerfel> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161110_175331_373981_E496B391 X-CRM114-Status: GOOD ( 24.02 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Thursday, November 10, 2016 1:21:08 PM CET Greg Kroah-Hartman wrote: > > > > > > the intention here is simply to have the console log keep the > > > same numbers as "date +%s" for absolute values. The patch that > > > James suggested converting everything to ktime_get_seconds() > > > would result in the same intervals that have always been there > > > (until I broke it by using time domains inconsistently), but > > > would mean we could use a u32 type for pl_recalc_time and > > > pl_recalc_period because that doesn't overflow until 136 years > > > after booting. (signed time_t overflows 68 years after 1970, > > > i.e 2038). > > > > So, is this patch correct and should be merged to the tree, or not? > > > > No, I think it's wrong in a different way as before. After my > patch, there were six instances of ktime_get_real_seconds() and > three instances of ktime_get_seconds(), and that was wrong. > > James's patch converts three of the six instances to > ktime_get_seconds(), which is equally wrong, just different. > > We can either convert the six ktime_get_real_seconds() > to ktime_get_seconds(), or convert the four (one was added > in the meantime) ktime_get_seconds() to ktime_get_real_seconds(). > > I'll follow up with a patch for the latter as it is what I > had originally intended. We can also do what James intended > instead. I tought about it and yes ktime_get_real_seconds() is the right way to go due to the debug message. Especially if the node happens to reboot. Having a debug message after a reboot with a smaller time reported in the debug message compared to a earlier debug message might be confusing to someone.