public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: parag.warudkar@gmail.com, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH 1/2] net: flow hash timer power saving
Date: Tue, 18 Dec 2007 18:18:27 -0800	[thread overview]
Message-ID: <20071218181827.5a35d634@shemminger-laptop> (raw)
In-Reply-To: <Pine.LNX.4.64.0712181956180.3616@mini.warudkars.net>

The net flow hash randomization timer runs every 10 minutes.
This time is low priority and doesn't need to wakeup the CPU.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/net/core/flow.c	2007-12-18 07:43:31.000000000 -0800
+++ b/net/core/flow.c	2007-12-18 07:44:32.000000000 -0800
@@ -81,8 +81,8 @@ static void flow_cache_new_hashrnd(unsig
 	for_each_possible_cpu(i)
 		flow_hash_rnd_recalc(i) = 1;
 
-	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
-	add_timer(&flow_hash_rnd_timer);
+	mod_timer(&flow_hash_rnd_timer,
+		  round_jiffies(jiffies + FLOW_HASH_RND_PERIOD));
 }
 
 static void flow_entry_kill(int cpu, struct flow_cache_entry *fle)
@@ -352,7 +352,7 @@ static int __init flow_cache_init(void)
 	flow_lwm = 2 * flow_hash_size;
 	flow_hwm = 4 * flow_hash_size;
 
-	init_timer(&flow_hash_rnd_timer);
+	init_timer_deferrable(&flow_hash_rnd_timer);
 	flow_hash_rnd_timer.function = flow_cache_new_hashrnd;
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
 	add_timer(&flow_hash_rnd_timer);

  reply	other threads:[~2007-12-19  2:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19  1:04 [PATCH] sch_generic.c: Make dev_watchdog use deferrable timer Parag Warudkar
2007-12-19  2:18 ` Stephen Hemminger [this message]
     [not found] ` <20071218174120.4b0ef6dd@shemminger-laptop>
2007-12-19  2:18   ` [PATCH 2/2] net: neighbor timer power saving Stephen Hemminger
2007-12-19  7:23     ` Eric Dumazet
2007-12-20 17:10       ` Stephen Hemminger
2007-12-20 18:16         ` Parag Warudkar
2007-12-20 23:28       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071218181827.5a35d634@shemminger-laptop \
    --to=shemminger@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=parag.warudkar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox