linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Rob Landley <rob@landley.net>,
	linux-kernel@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: Question about /proc/uptime
Date: Mon, 30 Dec 2013 16:11:10 +0100	[thread overview]
Message-ID: <20131230151110.GA29636@redhat.com> (raw)
In-Reply-To: <20131230095656.4c78dd98@mschwide>

On 12/30, Martin Schwidefsky wrote:
<
> On Fri, 27 Dec 2013 15:45:04 +0100
> Oleg Nesterov <oleg@redhat.com> wrote:
>
> > Add Frederic, I am not sure I understand this correctly.
> >
> > On 12/25, Rob Landley wrote:
> > >
> > > There are two values here, the first is seconds since boot time (which
> > > is just elapsed time; at one point it was ajusted for suspend and that
> > > was revered as confusing).
> >
> > Hmm, uptime_proc_show() still uses get_monotonic_boottime(), this should
> > include suspend time?
>
> The first value of /proc/uptime is the amount of time the system has been
> running, the sum of the suspend time is not included.

Hmm. It uses get_monotonic_boottime() and this helper adds
timekeeper->total_sleep_time to the returned value? Even the comment says

	* This is similar to CLOCK_MONTONIC/ktime_get_ts, but also
	* includes the time spent in suspend.

> timekeeping_resume()
> is supposed to take care of that.

Not sure I understand... except that timekeeping_resume() does
__timekeeping_inject_sleeptime().

> > > The second value isn't documented but looking at fs/proc/uptime.c I
> > > think it's idle time?
> >
> > And this cpustat[CPUTIME_IDLE] doesn't match get_idle_time(), I guess
> > it only counts ticks.
>
> The second value of /proc/uptime is the sum of the idle time of all cpus.
> The value should roughly match the sum over get_idle_time() for all cpus.
> The difference is that get_idle_time() uses arch_idle_time to add the
> time for the currently running idle period as well (at least for s390).

Only if defined(arch_idle_time) ?

Otherwise get_idle_time() uses get_cpu_idle_time_us() and
CONFIG_NO_HZ_COMMON makes a difference.

> That does make a difference if the cpus stay idle for long periods of
> time.

Yes.

Oleg.


  reply	other threads:[~2013-12-30 15:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-26  2:30 Question about /proc/uptime Rob Landley
2013-12-27 14:45 ` Oleg Nesterov
2013-12-30  8:56   ` Martin Schwidefsky
2013-12-30 15:11     ` Oleg Nesterov [this message]
2013-12-30 15:26       ` Martin Schwidefsky
2014-01-01  4:17         ` Rob Landley
2014-01-01 12:41           ` Martin Schwidefsky
2014-01-01 21:21             ` Rob Landley
2014-01-02  8:28               ` Martin Schwidefsky

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=20131230151110.GA29636@redhat.com \
    --to=oleg@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=schwidefsky@de.ibm.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;
as well as URLs for NNTP newsgroup(s).