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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 7 Aug 2006 12:58:10 -0700
From:	Andrew Morton <akpm@...l.org>
To:	Atsushi Nemoto <anemo@....ocn.ne.jp>
Cc:	schwidefsky@...glemail.com, johnstul@...ibm.com,
	zippel@...ux-m68k.org, clameter@...r.sgi.com,
	linux-kernel@...r.kernel.org, ralf@...ux-mips.org, ak@....de,
	schwidefsky@...ibm.com
Subject: Re: [PATCH] simplify update_times (avoid jiffies/jiffies_64
 aliasing problem)

On Mon, 07 Aug 2006 01:13:19 +0900 (JST)
Atsushi Nemoto <anemo@....ocn.ne.jp> wrote:

> On Fri, 4 Aug 2006 16:02:43 +0200, "Martin Schwidefsky" <schwidefsky@...glemail.com> wrote:
> > Good start, now you only have the change the 30+ calls to do_timer in
> > the various architecture backends.
> 
> OK, then this is a patch contains the changes.
> Adding S390 maintainer Martin Schwidefsky to CC.
> 
> This patch is against current git tree, so does not contains a change
> to arch/avr32 which is in mm tree.  I can create a patch against mm
> tree if expected.
> 
> 
> [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.

> ...
>
> --- 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.

-
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