[PATCH 2.6.23.1] Kill STP hello timer if STP is not enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quick CPU eater kill. This might be not the best fix possible.

Without this patch, hello_timer is firing 250 times/sec and eating about
8% CPU time on my an otherwise idle system (dynticks enabled). 2.6.21.5 was
even worse - 20% (HZ=1000). (br->hello_time was supposedly 0 when STP was
disabled).

Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>

--- qmqm/net/bridge/br_stp_if.c.orig	2007-10-15 10:30:24.000000000 +0200
+++ qmqm/net/bridge/br_stp_if.c	2007-10-15 10:34:07.000000000 +0200
@@ -47,10 +47,12 @@
 	struct net_bridge_port *p;
 
 	spin_lock_bh(&br->lock);
-	mod_timer(&br->hello_timer, jiffies + br->hello_time);
+	if (br->stp_enabled == BR_KERNEL_STP)
+		mod_timer(&br->hello_timer, jiffies + br->hello_time);
 	mod_timer(&br->gc_timer, jiffies + HZ/10);
 
-	br_config_bpdu_generation(br);
+	if (br->stp_enabled == BR_KERNEL_STP)
+		br_config_bpdu_generation(br);
 
 	list_for_each_entry(p, &br->port_list, list) {
 		if ((p->dev->flags & IFF_UP) && netif_carrier_ok(p->dev))
_______________________________________________
Bridge mailing list
Bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/bridge

[Index of Archives]     [Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux