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:	Fri, 10 Dec 2010 20:25:56 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Venkatesh Pallipadi <venki@...gle.com>,
	Mikael Pettersson <mikpe@...uu.se>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	John Stultz <johnstul@...ibm.com>
Subject: Re: [BUG] 2.6.37-rc3 massive interactivity regression on ARM

On Fri, 2010-12-10 at 19:10 +0100, Peter Zijlstra wrote:
> > > +   delta = sched_clock_cpu(cpu_of(rq)) - rq->clock;
> > > +   rq->clock += delta;
> > 
> > Hmm.  Can you tell me how this is different to:
> > 
> >       new_clock = sched_clock_cpu(cpu_of(rq));
> >       delta = new_clock - rq->clock;
> >       rq->clock = new_clock;
> > 
> > which I think may be simpler in terms of 64-bit math for 32-bit compilers
> > to deal with?
> 
> Its not, I could write it like that, the only reason I didn't is because
> it uses an extra variable. If gcc on 32bit targets really generates
> hideous code for it I'll happily change it. 

Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -1863,6 +1863,7 @@ void account_system_vtime(struct task_st
 {
        unsigned long flags;
        s64 delta;
+       u64 now;
        int cpu;
 
        if (!sched_clock_irqtime)
@@ -1870,8 +1871,9 @@ void account_system_vtime(struct task_st
 
        local_irq_save(flags);
        cpu = smp_processor_id();
-       delta = sched_clock_cpu(cpu) - per_cpu(irq_start_time, cpu);
-       per_cpu(irq_start_time, cpu) += delta;
+       now = sched_clock_cpu(cpu);
+       delta = now - per_cpu(irq_start_time, cpu);
+       per_cpu(irq_start_time, cpu) = now;
 
        irq_time_write_begin(cpu);
 
On i386 (gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5):

Before: account_system_vtime: 160 bytes
After:  account_system_vtime: 214 bytes


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