Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150959
b: refs/heads/master
c: 125bb8f
h: refs/heads/master
i:
  150957: 6e1899d
  150955: 14f16e7
  150951: c79389a
  150943: 5ead86e
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 14, 2009
1 parent 18e9431 commit 34facb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13be8a126850692839934116fbdaf008bfdedec1
refs/heads/master: 125bb8f5637bd653244728f734bcac218986d910
11 changes: 8 additions & 3 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ static int ip_rt_min_advmss __read_mostly = 256;
static int ip_rt_secret_interval __read_mostly = 10 * 60 * HZ;
static int rt_chain_length_max __read_mostly = 20;

static void rt_worker_func(struct work_struct *work);
static DECLARE_DELAYED_WORK(expires_work, rt_worker_func);
static struct delayed_work expires_work;
static unsigned long expires_ljiffies;

/*
* Interface to generic destination cache.
Expand Down Expand Up @@ -787,9 +787,12 @@ static void rt_check_expire(void)
struct rtable *rth, *aux, **rthp;
unsigned long samples = 0;
unsigned long sum = 0, sum2 = 0;
unsigned long delta;
u64 mult;

mult = ((u64)ip_rt_gc_interval) << rt_hash_log;
delta = jiffies - expires_ljiffies;
expires_ljiffies = jiffies;
mult = ((u64)delta) << rt_hash_log;
if (ip_rt_gc_timeout > 1)
do_div(mult, ip_rt_gc_timeout);
goal = (unsigned int)mult;
Expand Down Expand Up @@ -3397,6 +3400,8 @@ int __init ip_rt_init(void)
/* All the timers, started at system startup tend
to synchronize. Perturb it a bit.
*/
INIT_DELAYED_WORK_DEFERRABLE(&expires_work, rt_worker_func);
expires_ljiffies = jiffies;
schedule_delayed_work(&expires_work,
net_random() % ip_rt_gc_interval + ip_rt_gc_interval);

Expand Down

0 comments on commit 34facb0

Please sign in to comment.