LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dmitry Safonov <dima@arista.com>
To: Cyril Hrubis <chrubis@suse.cz>, linux-kernel@vger.kernel.org
Cc: Andrei Vagin <avagin@openvz.org>,
	Thomas Gleixner <tglx@linutronix.de>, Jiri Bohac <jbohac@suse.cz>
Subject: Re: [PATCH] sys/sysinfo: Respect boottime inside time namespace
Date: Tue, 3 Mar 2020 16:40:56 +0000	[thread overview]
Message-ID: <9ab86b0c-8a32-39ae-5a14-78b872be6d82@arista.com> (raw)
In-Reply-To: <20200303150638.7329-1-chrubis@suse.cz>

On 3/3/20 3:06 PM, Cyril Hrubis wrote:
> The sysinfo() syscall includes uptime in seconds this makes it
> consistent with the /proc/uptime inside of a time namespace.
> 
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>

Reviewed-by: Dmitry Safonov <dima@arista.com>

> ---
>  kernel/sys.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/sys.c b/kernel/sys.c
> index f9bc5c303e3f..d325f3ab624a 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -47,6 +47,7 @@
>  #include <linux/syscalls.h>
>  #include <linux/kprobes.h>
>  #include <linux/user_namespace.h>
> +#include <linux/time_namespace.h>
>  #include <linux/binfmts.h>
>  
>  #include <linux/sched.h>
> @@ -2546,6 +2547,7 @@ static int do_sysinfo(struct sysinfo *info)
>  	memset(info, 0, sizeof(struct sysinfo));
>  
>  	ktime_get_boottime_ts64(&tp);
> +	timens_add_boottime(&tp);
>  	info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
>  
>  	get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);
> 

Thanks for noticing,
          Dmitry

  reply	other threads:[~2020-03-03 16:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 15:06 Cyril Hrubis
2020-03-03 16:40 ` Dmitry Safonov [this message]
2020-03-03 18:40 ` [tip: timers/urgent] " tip-bot2 for Cyril Hrubis

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=9ab86b0c-8a32-39ae-5a14-78b872be6d82@arista.com \
    --to=dima@arista.com \
    --cc=avagin@openvz.org \
    --cc=chrubis@suse.cz \
    --cc=jbohac@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH] sys/sysinfo: Respect boottime inside time namespace' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).