Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-16 Thread Thomas Gleixner
Bruce, On Wed, Oct 14 2020 at 18:05, J. Bruce Fields wrote: > On Mon, Oct 12, 2020 at 05:13:08PM -0400, J. Bruce Fields wrote: >> On Fri, Oct 09, 2020 at 10:08:15PM +0200, Thomas Gleixner wrote: >> I'll give it a shot. > > I took your code above verbatim, but should I really be following the >

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-14 Thread J. Bruce Fields
On Mon, Oct 12, 2020 at 05:13:08PM -0400, J. Bruce Fields wrote: > On Fri, Oct 09, 2020 at 10:08:15PM +0200, Thomas Gleixner wrote: > > In fact the whole thing can be simplified. You can just use time in > > nanoseconds retrieved via ktime_get_coarse_boottime() which does not > > read the

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-13 Thread Christian Brauner
On Sat, Oct 10, 2020 at 12:19:14AM -0700, Andrei Vagin wrote: > On Fri, Oct 09, 2020 at 03:28:15PM +0200, Christian Brauner wrote: > > On Thu, Oct 08, 2020 at 07:39:42AM +0200, Michael Weiß wrote: > > > getboottime64() provides the time stamp of system boot. In case of > > > time namespaces, the

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-12 Thread Thomas Gleixner
On Mon, Oct 12 2020 at 17:13, J. Bruce Fields wrote: > On Fri, Oct 09, 2020 at 10:08:15PM +0200, Thomas Gleixner wrote: >> You wish. That's clearly wrong because that code is not guaranteed to >> always run in a context which belongs to the root time namespace. > > Argh, right, thanks. > >>

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-12 Thread J. Bruce Fields
On Fri, Oct 09, 2020 at 10:08:15PM +0200, Thomas Gleixner wrote: > On Fri, Oct 09 2020 at 09:55, J. Bruce Fields wrote: > > Looking at how it's used in net/sunrpc/cache.c All it's doing is > > comparing times which have all been calculated relative to the time > > returned by getboottime64().

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-10 Thread Thomas Gleixner
Michael, On Sat, Oct 10 2020 at 13:50, Michael Weiß wrote: > On 10.10.20 09:19, Andrei Vagin wrote: >> And I think we need to consider an option to not change getbootime64 and >> apply a timens offset right in the show_stat(fs/proc/stat.c) >> function. That's what I meant and failed to express

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-10 Thread Michael Weiß
On 10.10.20 09:19, Andrei Vagin wrote: > On Fri, Oct 09, 2020 at 03:28:15PM +0200, Christian Brauner wrote: >> On Thu, Oct 08, 2020 at 07:39:42AM +0200, Michael Weiß wrote: >>> getboottime64() provides the time stamp of system boot. In case of >>> time namespaces, the offset to the boot time

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-10 Thread Andrei Vagin
On Fri, Oct 09, 2020 at 03:28:15PM +0200, Christian Brauner wrote: > On Thu, Oct 08, 2020 at 07:39:42AM +0200, Michael Weiß wrote: > > getboottime64() provides the time stamp of system boot. In case of > > time namespaces, the offset to the boot time stamp was not applied > > earlier. However,

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-09 Thread Thomas Gleixner
On Fri, Oct 09 2020 at 09:55, J. Bruce Fields wrote: > On Fri, Oct 09, 2020 at 03:28:15PM +0200, Christian Brauner wrote: >> On Thu, Oct 08, 2020 at 07:39:42AM +0200, Michael Weiß wrote: >> > getboottime64() provides the time stamp of system boot. In case of >> > time namespaces, > > Huh, I didn't

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-09 Thread J. Bruce Fields
On Fri, Oct 09, 2020 at 03:28:15PM +0200, Christian Brauner wrote: > On Thu, Oct 08, 2020 at 07:39:42AM +0200, Michael Weiß wrote: > > getboottime64() provides the time stamp of system boot. In case of > > time namespaces, Huh, I didn't know there were time namespaces. > > the offset to the boot

Re: [PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-09 Thread Christian Brauner
On Thu, Oct 08, 2020 at 07:39:42AM +0200, Michael Weiß wrote: > getboottime64() provides the time stamp of system boot. In case of > time namespaces, the offset to the boot time stamp was not applied > earlier. However, getboottime64 is used e.g., in /proc/stat to print > the system boot time to

[PATCH v2 2/4] time: make getboottime64 aware of time namespace

2020-10-07 Thread Michael Weiß
getboottime64() provides the time stamp of system boot. In case of time namespaces, the offset to the boot time stamp was not applied earlier. However, getboottime64 is used e.g., in /proc/stat to print the system boot time to userspace. In container runtimes which utilize time namespaces to