From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
schwidefsky@googlemail.com, johnstul@us.ibm.com,
zippel@linux-m68k.org, clameter@engr.sgi.com,
linux-kernel@vger.kernel.org, ralf@linux-mips.org, ak@muc.de
Subject: Re: [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem)
Date: Tue, 08 Aug 2006 10:11:59 +0200 [thread overview]
Message-ID: <1155024719.26277.12.camel@localhost> (raw)
In-Reply-To: <20060807125810.e021c91b.akpm@osdl.org>
On Mon, 2006-08-07 at 12:58 -0700, Andrew Morton wrote:
> > [PATCH] cleanup do_timer and update_times
> >
> > Pass ticks to do_timer() and update_times().
> >
> > This also make a barrier added by
> > 5aee405c662ca644980c184774277fc6d0769a84 needless.
> >
> > Also adjust x86_64 and s390 timer interrupt handler with this change.
> >
>
> This is a rather terse description for a change of this nature..
>
> Why was this patch created? What problem is it solving? etcetera.
The problem is that we are wasting time calling do_timer in a loop. This
is especially true on system that switch off the timer interrupt while
the cpu is idle. You can easily have thousands of lost ticks.
> > ...
> >
> > --- a/kernel/timer.c
> > +++ b/kernel/timer.c
> > @@ -1218,7 +1218,7 @@ static inline void calc_load(unsigned lo
> > static int count = LOAD_FREQ;
> >
> > count -= ticks;
> > - if (count < 0) {
> > + while (count < 0) {
> > count += LOAD_FREQ;
> > active_tasks = count_active_tasks();
> > CALC_LOAD(avenrun[0], EXP_1, active_tasks);
>
> OK, we do need the loop here to get the arithmetic in CALC_LOAD to work
> correctly.
>
> But I don't think the expensive count_active_tasks() needs to be evaluated
> each time around.
This is what I hoped would happen. The loops gets pushed through the
layers to the place where it is actually needed. The next step could be
to get rid of the loop altogether by changing CALC_LOAD.
--
blue skies,
Martin.
Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2006-08-08 8:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 14:02 [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem) Atsushi Nemoto
2006-03-02 15:51 ` Atsushi Nemoto
2006-03-02 19:09 ` Christoph Lameter
2006-03-03 2:44 ` Atsushi Nemoto
2006-03-03 3:04 ` Andrew Morton
2006-03-03 3:20 ` Andi Kleen
2006-03-03 4:31 ` Atsushi Nemoto
2006-03-03 5:45 ` David S. Miller
2006-03-03 16:26 ` Atsushi Nemoto
2006-03-03 16:31 ` Atsushi Nemoto
2006-03-04 8:18 ` Andrew Morton
2006-03-04 11:20 ` Andi Kleen
2006-03-04 11:40 ` Andrew Morton
2006-03-04 5:21 ` Andi Kleen
2006-03-04 23:13 ` Paul Mackerras
2006-03-06 2:32 ` Atsushi Nemoto
2006-03-04 11:42 ` Paul Mackerras
2006-03-04 11:44 ` Andrew Morton
2006-03-04 12:33 ` Paul Mackerras
2006-03-04 16:43 ` Atsushi Nemoto
2006-03-03 20:17 ` john stultz
2006-03-03 21:15 ` Andrew Morton
2006-03-04 17:15 ` Atsushi Nemoto
2006-07-30 14:54 ` Atsushi Nemoto
2006-07-31 10:36 ` Martin Schwidefsky
2006-08-01 14:44 ` Atsushi Nemoto
2006-08-02 12:50 ` Martin Schwidefsky
2006-08-03 15:53 ` Atsushi Nemoto
2006-08-04 14:02 ` Martin Schwidefsky
2006-08-06 16:13 ` Atsushi Nemoto
2006-08-07 11:28 ` Martin Schwidefsky
2006-08-07 19:58 ` Andrew Morton
2006-08-08 8:11 ` Martin Schwidefsky [this message]
2006-08-09 15:07 ` Atsushi Nemoto
2006-03-03 18:13 ` john stultz
2006-03-04 2:34 ` Ralf Baechle
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=1155024719.26277.12.camel@localhost \
--to=schwidefsky@de.ibm.com \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=clameter@engr.sgi.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=schwidefsky@googlemail.com \
--cc=zippel@linux-m68k.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