public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Moore <timothymoore@bigfoot.com>
To: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] /proc/uptime on SMP machines
Date: Sat, 17 Mar 2001 19:41:12 -0800	[thread overview]
Message-ID: <3AB42E58.1FF1895F@bigfoot.com> (raw)
In-Reply-To: <15027.62364.751528.388435@siemens.ikp.physik.tu-darmstadt.de>

> Same for 2.2.19p17

except that init_tasks is a 2.4 struc.  Corrected as below.

rgds,
tim

--- 2.2.19pre17/fs/proc/array.c.old     Fri Mar 16 04:09:41 2001
+++ 2.2.19pre17/fs/proc/array.c.idle    Sat Mar 17 19:35:36 2001
@@ -339,9 +339,16 @@
 {
        unsigned long uptime;
        unsigned long idle;
+       int i;
 
        uptime = jiffies;
+#ifdef CONFIG_SMP
+       for (idle =0,i = 0; i < smp_num_cpus; i++)
+       idle += (task[i]->times.tms_utime +
+               task[i]->times.tms_stime)/smp_num_cpus;
+#else
        idle = task[0]->times.tms_utime + task[0]->times.tms_stime;
+#endif
 
        /* The formula for the fraction parts really is ((t * 100) / HZ) % 100, but
           that would overflow about every five days at HZ == 100.

--

  parent reply	other threads:[~2001-03-18  3:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-17 23:30 [PATCH] /proc/uptime on SMP machines Uwe Bonnes
2001-03-18  3:26 ` Tim Moore
2001-03-18  3:41 ` Tim Moore [this message]
2001-03-18  4:46   ` Tim Moore

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=3AB42E58.1FF1895F@bigfoot.com \
    --to=timothymoore@bigfoot.com \
    --cc=bon@elektron.ikp.physik.tu-darmstadt.de \
    --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