From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 01/21] fs: Replace CURRENT_TIME_SEC with current_fs_time() Date: Sat, 11 Jun 2016 22:55:52 +0200 Message-ID: <6859475.Y26Py76amW@wuerfel> References: <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com> <3091973.UMxUogx2eG@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: Jan Kara , Bob Copeland , Adrian Hunter , David Howells , Andreas Dilger , linux-afs@lists.infradead.org, y2038@lists.linaro.org, Christoph Hellwig , coda@cs.cmu.edu, linux-ext4@vger.kernel.org, Evgeniy Dushistov , Al Viro , Thomas Gleixner , OGAWA Hirofumi , Jan Harkes , Theodore Ts'o , Artem Bityutskiy , "Tigran A. Aivazian" , Linux Kernel Mailing List , Jan Kara , Linux FS-devel Mailing List , linux-mtd , Linus Torvalds , linux-karma To: Deepa Dinamani Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: y2038-bounces@lists.linaro.org Sender: "Y2038" List-Id: linux-ext4.vger.kernel.org T24gRnJpZGF5LCBKdW5lIDEwLCAyMDE2IDEwOjAzOjE0IFBNIENFU1QgRGVlcGEgRGluYW1hbmkg d3JvdGU6Cj4gT24gRnJpLCBKdW4gMTAsIDIwMTYgYXQgMzoyMSBQTSwgQXJuZCBCZXJnbWFubiA8 YXJuZEBhcm5kYi5kZT4gd3JvdGU6Cgo+ID4KPiA+IEluIGFuIGVhcmxpZXIgdmVyc2lvbiwgeW91 IGhhZCBhIHNtYWxsIG9wdGltaXphdGlvbiB0bwo+ID4gdXNlIGt0aW1lX2dldF9yZWFsX3NlY29u ZHMoKSBpbnN0ZWFkIG9mIGN1cnJlbnRfa2VybmVsX3RpbWUoKQo+ID4gd2hlbiB0aGUgZ3JhbnVs YXJpdHkgaXMgc2Vjb25kcy4KPiA+Cj4gPiBEbyB5b3Ugc3RpbGwgc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IG9mIHJhbmdlIGNoZWNraW5nLgoKTWFrZXMg c2Vuc2UuIEkgZ3Vlc3Mgd2UgY2FuIHNraXAgdGhlIHJhbmdlIGNoZWNraW5nIGZvcgpjdXJyZW50 X2ZzX3RpbWUoKSBpZiB3ZSBlbmQgdXAgbm90IGFsbG93aW5nIHdyaXRhYmxlIG1vdW50cyBvbgpm aWxlIHN5c3RlbXMgdGhhdCBjYW5ub3QgcmVwcmVzZW50IHRoZSBjdXJyZW50IHRpbWUsIGJ1dCB3 ZQpkbyB3YW50IHRoZSByYW5nZSBjaGVja2luZyBmb3IgdGhlIG90aGVyIHVzZXJzIG9mCnRpbWVz cGVjX3RydW5jKCkuCgoJQXJuZAoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX18KWTIwMzggbWFpbGluZyBsaXN0ClkyMDM4QGxpc3RzLmxpbmFyby5vcmcKaHR0 cHM6Ly9saXN0cy5saW5hcm8ub3JnL21haWxtYW4vbGlzdGluZm8veTIwMzgK From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann To: Deepa Dinamani Cc: Bob Copeland , Linux FS-devel Mailing List , Linux Kernel Mailing List , Thomas Gleixner , Al Viro , Linus Torvalds , y2038@lists.linaro.org, Artem Bityutskiy , Adrian Hunter , linux-mtd , Evgeniy Dushistov , OGAWA Hirofumi , Jan Kara , linux-ext4@vger.kernel.org, David Howells , linux-afs@lists.infradead.org, "Tigran A. Aivazian" , Theodore Ts'o , Andreas Dilger , Jan Kara , Jan Harkes , coda@cs.cmu.edu, linux-karma-devel@lists.sourceforge.net, Christoph Hellwig Subject: Re: [PATCH 01/21] fs: Replace CURRENT_TIME_SEC with current_fs_time() Date: Sat, 11 Jun 2016 22:55:52 +0200 Message-ID: <6859475.Y26Py76amW@wuerfel> In-Reply-To: References: <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com> <3091973.UMxUogx2eG@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Friday, June 10, 2016 10:03:14 PM CEST Deepa Dinamani wrote: > On Fri, Jun 10, 2016 at 3:21 PM, Arnd Bergmann wrote: > > > > In an earlier version, you had a small optimization to > > use ktime_get_real_seconds() instead of current_kernel_time() > > when the granularity is seconds. > > > > Do you still plan to send that one, or did you decide we don't > > need it? > > I was actually planning to use get_seconds() instead of current_kernel_time(). > And, transition both along with vfs to y2038 safe apis. > Difference between ktime_get_real_seconds() and current_kernel_time64() > is not much because they both require sequence counter. > > It didn't make sense to me to optimize current_fs_time() for seconds > only, and not optimize for 1ns granularity also. Ah, you are right: adding another check for second granularity would probably cost more than it would save, since we already don't calculate the exact nanoseconds but just use the timestamp of the last timer tick. > I plan to make changes to the function depending on how we end up > using timespec_trunc() after the addition of range checking. Makes sense. I guess we can skip the range checking for current_fs_time() if we end up not allowing writable mounts on file systems that cannot represent the current time, but we do want the range checking for the other users of timespec_trunc(). Arnd