public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Vagin <avagin@gmail.com>
To: "Michael Weiß" <michael.weiss@aisec.fraunhofer.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	linux-kernel@vger.kernel.org,
	"J . Bruce Fields" <bfields@fieldses.org>,
	Chuck Lever <chuck.lever@oracle.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>
Subject: Re: [PATCH v4 0/3] time namespace aware system boot time
Date: Thu, 22 Oct 2020 01:36:44 -0700	[thread overview]
Message-ID: <20201022083644.GA344600@gmail.com> (raw)
In-Reply-To: <20201019195257.10728-1-michael.weiss@aisec.fraunhofer.de>

On Mon, Oct 19, 2020 at 09:52:54PM +0200, Michael Weiß wrote:
> Time namespaces make it possible to virtualize time inside of
> containers, e.g., it is feasible to reset the uptime of a container
> to zero by setting the time namespace offset for boottime to the
> negated current value of the CLOCK_BOOTTIME.
> 
> However, the boot time stamp provided by getboottime64() does not
> take care of time namespaces. The resulting boot time stamp 'btime'
> provided by /proc/stat does not show a plausible time stamp inside
> the time namespace of a container.
> 
> We address this by shifting the value returned by getboottime64()
> by subtracting the boottime offset of the time namespace.
> (A selftest to check the expected /proc/stat 'btime' inside the
> namespace is provided.)
> 
> Further, to avoid to show processes as time travelers inside of the
> time namespace the boottime offset then needs to be added to the
> start_boottime provided by the task_struct.
> 
> v4 Changes:
> Avoid type conversions back and forth between timespec64 and ktime_t
> in 'proc/stat.c' as suggested by Andrei.
> Introduced timens_sub_boottime() in 'time_namespace.h' to provide
> better coder readability/consistency.
> 

Reviewed-by: Andrei Vagin <avagin@gmail.com>

Thanks,
Andrei

  parent reply	other threads:[~2020-10-22  8:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 19:52 [PATCH v4 0/3] time namespace aware system boot time Michael Weiß
2020-10-19 19:52 ` [PATCH v4 1/3] timens: additional helper functions for boottime offset handling Michael Weiß
2020-10-19 19:52 ` [PATCH v4 2/3] fs/proc: apply the time namespace offset to /proc/stat btime Michael Weiß
2020-10-26 10:28   ` Thomas Gleixner
2020-10-27 11:56     ` Michael Weiß
2020-10-19 19:52 ` [PATCH v4 3/3] selftests/timens: added selftest for " Michael Weiß
2020-10-22  8:36 ` Andrei Vagin [this message]
2020-10-26 10:27 ` [PATCH v4 0/3] time namespace aware system boot time Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201022083644.GA344600@gmail.com \
    --to=avagin@gmail.com \
    --cc=0x7f454c46@gmail.com \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.weiss@aisec.fraunhofer.de \
    --cc=tglx@linutronix.de \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox