From: "Martin Schwidefsky" <schwidefsky@googlemail.com>
To: "Atsushi Nemoto" <anemo@mba.ocn.ne.jp>
Cc: johnstul@us.ibm.com, akpm@osdl.org, 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: Mon, 31 Jul 2006 12:36:38 +0200 [thread overview]
Message-ID: <6e0cfd1d0607310336o355693a5l939db098b9210d81@mail.gmail.com> (raw)
In-Reply-To: <20060730.235403.108306254.anemo@mba.ocn.ne.jp>
On 7/30/06, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
> index 7a9b182..298027f 100644
> --- a/arch/x86_64/kernel/time.c
> +++ b/arch/x86_64/kernel/time.c
> @@ -423,7 +423,8 @@ #endif
>
> if (lost > 0) {
> handle_lost_ticks(lost, regs);
> - jiffies += lost;
> + while (lost--)
> + do_timer(regs);
> }
>
> /*
I think that this is going into the wrong direction. There are a
number of architectures that call do_timer(regs) in a while loop. It
would be much nicer if do_timer would get the number of passed ticks
as an argument. And the "regs" argument to do_timer is just useless.
> diff --git a/kernel/timer.c b/kernel/timer.c
> index 05809c2..3981cae 100644
> --- a/kernel/timer.c
> +++ b/kernel/timer.c
> @@ -1267,12 +1267,9 @@ void run_local_timers(void)
> */
> static inline void update_times(void)
> {
> - unsigned long ticks;
> -
> - ticks = jiffies - wall_jiffies;
> - wall_jiffies += ticks;
> + wall_jiffies++;
> update_wall_time();
> - calc_load(ticks);
> + calc_load(1);
> }
>
> /*
Pass "ticks" from do_timer and do "wall_jiffies += ticks". To make
calc_load work correctly the "if (count < 0)" in calc_load needs to
be replaced with "while (count < 0)".
> @@ -1284,8 +1281,6 @@ static inline void update_times(void)
> void do_timer(struct pt_regs *regs)
> {
> jiffies_64++;
> - /* prevent loading jiffies before storing new jiffies_64 value. */
> - barrier();
> update_times();
> }
>
Change do_timer and make architectures to pass "ticks", do "jiffies64
+= ticks" and add ticks to the call of update_times.
--
blue skies,
Martin
next prev parent reply other threads:[~2006-07-31 10:36 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 14:02 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 [this message]
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
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=6e0cfd1d0607310336o355693a5l939db098b9210d81@mail.gmail.com \
--to=schwidefsky@googlemail.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=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
all inboxes | Powered by JetHome®