All of lore.kernel.org
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Tomas Janousek <tjanouse@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, tsmetana@redhat.com,
	riel@redhat.com, Albert Cahalan <acahalan@gmail.com>
Subject: Re: [PATCH] Use boot based time for uptime in /proc
Date: Thu, 10 May 2007 11:47:09 -0700	[thread overview]
Message-ID: <1178822829.6011.5.camel@localhost.localdomain> (raw)
In-Reply-To: <5189f7a1983d01ddaef747b594f39dadf655baba.1178816485.git.tomi@nomi.cz>

On Thu, 2007-05-10 at 19:10 +0200, Tomas Janousek wrote:
> Commit 411187fb05cd11676b0979d9fbf3291db69dbce2 caused uptime not to increase
> during suspend. This may cause confusion so I restore the old behaviour by
> using the boot based time instead of monotonic for uptime.
> 
> Signed-off-by: Tomas Janousek <tjanouse@redhat.com>

Acked-by: John Stultz <johnstul@us.ibm.com>

> ---
>  fs/proc/proc_misc.c |    1 +
>  kernel/timer.c      |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
> index 0782d34..d84956c 100644
> --- a/fs/proc/proc_misc.c
> +++ b/fs/proc/proc_misc.c
> @@ -107,6 +107,7 @@ static int uptime_read_proc(char *page, char **start, off_t off,
>  	cputime_t idletime = cputime_add(init_task.utime, init_task.stime);
> 
>  	do_posix_clock_monotonic_gettime(&uptime);
> +	monotonic_to_bootbased(&uptime);
>  	cputime_to_timespec(idletime, &idle);
>  	len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
>  			(unsigned long) uptime.tv_sec,
> diff --git a/kernel/timer.c b/kernel/timer.c
> index d5e1d6f..3a8ba7d 100644
> --- a/kernel/timer.c
> +++ b/kernel/timer.c
> @@ -1106,6 +1106,7 @@ int do_sysinfo(struct sysinfo *info)
>  		getnstimeofday(&tp);
>  		tp.tv_sec += wall_to_monotonic.tv_sec;
>  		tp.tv_nsec += wall_to_monotonic.tv_nsec;
> +		monotonic_to_bootbased(&tp);
>  		if (tp.tv_nsec - NSEC_PER_SEC >= 0) {
>  			tp.tv_nsec = tp.tv_nsec - NSEC_PER_SEC;
>  			tp.tv_sec++;
> -- 
> 1.5.1.4
> 
> 


  reply	other threads:[~2007-05-10 18:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03 15:03 Broken process startup times after suspend (regression) Tomas Janousek
2007-05-03 19:59 ` john stultz
2007-05-04 16:13   ` Tomas Janousek
2007-05-04 18:18     ` john stultz
2007-05-04 19:09       ` Tomas Janousek
2007-05-10 17:10       ` [PATCH] Introduce boot based time Tomas Janousek
2007-05-10 17:10         ` [PATCH] Use boot based time for process start time and boot time in /proc Tomas Janousek
2007-05-10 18:44           ` john stultz
2007-05-10 23:40           ` Andrew Morton
2007-05-11  8:45             ` Tomas Janousek
2007-05-11 19:51               ` Andrew Morton
2007-05-11 23:37                 ` Tomas Janousek
2007-05-11  8:46             ` Tomas Janousek
2007-05-10 17:10         ` [PATCH] Use boot based time for uptime " Tomas Janousek
2007-05-10 18:47           ` john stultz [this message]
2007-05-10 18:42         ` [PATCH] Introduce boot based time john stultz
2007-05-10 19:48         ` Ingo Oeser
2007-05-10 20:00           ` Tomas Janousek
2007-05-10 20:02           ` john stultz
2007-05-10 22:22             ` Ingo Oeser
2007-05-10 23:40         ` Andrew Morton

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=1178822829.6011.5.camel@localhost.localdomain \
    --to=johnstul@us.ibm.com \
    --cc=acahalan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=tjanouse@redhat.com \
    --cc=tsmetana@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.