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-next>] [day] [month] [year] [list]
Message-ID: <20091216222028.GA15841@verge.net.au>
Date:	Thu, 17 Dec 2009 09:20:28 +1100
From:	Simon Horman <horms@...ge.net.au>
To:	linux-kernel@...r.kernel.org
Cc:	Thomas Gleixner <tglx@...utronix.de>
Subject: [RFC] timers: Remove duplicate setting of new_base in __mod_timer()

Hi,

I am wondering if the first line of the following snippet of
__mod_timer() can be removed as new_base always seems to be reset.

Alternatively perhaps smp_processor_id() and  per_cpu() could
be moved to inside the #if and the call to __get_cpu_var() moved to
inside #else ?

        new_base = __get_cpu_var(tvec_bases);

        cpu = smp_processor_id();
        
#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
        if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) {
                int preferred_cpu = get_nohz_load_balancer();
                        
                if (preferred_cpu >= 0)
                        cpu = preferred_cpu;
        }
#endif
        new_base = per_cpu(tvec_bases, cpu);

Signed-off-by: Simon Horman <horms@...ge.net.au>

Index: linux-2.6/kernel/timer.c
===================================================================
--- linux-2.6.orig/kernel/timer.c	2009-12-17 07:02:57.000000000 +0900
+++ linux-2.6/kernel/timer.c	2009-12-17 07:03:17.000000000 +0900
@@ -656,8 +656,6 @@ __mod_timer(struct timer_list *timer, un
 
 	debug_activate(timer, expires);
 
-	new_base = __get_cpu_var(tvec_bases);
-
 	cpu = smp_processor_id();
 
 #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
--
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