lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 31 Jul 2006 12:36:38 +0200
From:	"Martin Schwidefsky" <schwidefsky@...glemail.com>
To:	"Atsushi Nemoto" <anemo@....ocn.ne.jp>
Cc:	johnstul@...ibm.com, akpm@...l.org, zippel@...ux-m68k.org,
	clameter@...r.sgi.com, linux-kernel@...r.kernel.org,
	ralf@...ux-mips.org, ak@....de
Subject: Re: [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem)

On 7/30/06, Atsushi Nemoto <anemo@....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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ