From: Andrew Morton <akpm@osdl.org>
To: Petri Kaukasoina <kaukasoi@elektroni.ee.tut.fi>
Cc: johnstul@us.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: 2.6.1: process start times by procps
Date: Thu, 29 Jan 2004 14:51:48 -0800 [thread overview]
Message-ID: <20040129145148.47cae69a.akpm@osdl.org> (raw)
In-Reply-To: <20040129203340.GA1169@elektroni.ee.tut.fi>
Petri Kaukasoina <kaukasoi@elektroni.ee.tut.fi> wrote:
>
> On Thu, Jan 29, 2004 at 11:48:49AM -0800, john stultz wrote:
> > On Thu, 2004-01-29 at 06:38, Petri Kaukasoina wrote:
> > > Yes, on linux-2.2.24 I can see that /proc/uptime is just the jiffies and
> > > btime is current time - jiffies. But in linux-2.6.1 /proc/uptime is now
> > > do_posix_clock_monotonic_gettime(), whatever that means, and /proc/uptime
> > > gives a correct value. But btime is still gettimeofday-jiffies and it does
> > > not stay constant. My patch changed btime to be
> > > gettimeofday-do_posix_clock_monotonic_gettime() and after that it stays
> > > constant.
> >
> > Does George Anzinger's patch work as well?
>
> I must have missed that... Any references?
>
This one.
diff -puN fs/proc/proc_misc.c~proc-stat-btime-fix-2 fs/proc/proc_misc.c
--- 25/fs/proc/proc_misc.c~proc-stat-btime-fix-2 Tue Jan 27 17:46:57 2004
+++ 25-akpm/fs/proc/proc_misc.c Tue Jan 27 17:46:57 2004
@@ -360,23 +360,12 @@ int show_stat(struct seq_file *p, void *
{
int i;
extern unsigned long total_forks;
- u64 jif;
+ unsigned long jif;
unsigned int sum = 0, user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0, softirq = 0;
- struct timeval now;
- unsigned long seq;
- /* Atomically read jiffies and time of day */
- do {
- seq = read_seqbegin(&xtime_lock);
-
- jif = get_jiffies_64();
- do_gettimeofday(&now);
- } while (read_seqretry(&xtime_lock, seq));
-
- /* calc # of seconds since boot time */
- jif -= INITIAL_JIFFIES;
- jif = ((u64)now.tv_sec * HZ) + (now.tv_usec/(1000000/HZ)) - jif;
- do_div(jif, HZ);
+ jif = - wall_to_monotonic.tv_sec;
+ if (wall_to_monotonic.tv_nsec)
+ --jif;
for_each_cpu(i) {
int j;
_
next prev parent reply other threads:[~2004-01-29 22:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-23 19:47 2.6.1: process start times by procps Petri Kaukasoina
2004-01-25 11:08 ` Petri Kaukasoina
2004-01-27 15:52 ` Petri Kaukasoina
2004-01-27 17:31 ` Petri Kaukasoina
2004-01-29 2:21 ` john stultz
2004-01-29 14:38 ` Petri Kaukasoina
2004-01-29 19:48 ` john stultz
2004-01-29 20:33 ` Petri Kaukasoina
2004-01-29 22:51 ` Andrew Morton [this message]
2004-01-30 12:42 ` Petri Kaukasoina
2004-01-29 20:13 ` Petri Kaukasoina
2004-02-01 20:18 ` Bill Davidsen
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=20040129145148.47cae69a.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=johnstul@us.ibm.com \
--cc=kaukasoi@elektroni.ee.tut.fi \
--cc=linux-kernel@vger.kernel.org \
/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