aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/neighbour.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-07-29 23:15:07 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-02 21:35:16 -0400
commite4c4e448cf557921ffbbbd6d6ddac81fdceacb4f (patch)
tree6813f4b0228e1ec26c26c5c56ef980a2a7c0963c /include/net/neighbour.h
parent1e3e238e9c4bf9987b19185235cd0cdc21ea038c (diff)
neigh: Convert garbage collection from softirq to workqueue
Current neigh_periodic_timer() function is fired by timer IRQ, and scans one hash bucket each round (very litle work in fact) As we are supposed to scan whole hash table in 15 seconds, this means neigh_periodic_timer() can be fired very often. (depending on the number of concurrent hash entries we stored in this table) Converting this to a workqueue permits scanning whole table, minimizing icache pollution, and firing this work every 15 seconds, independantly of hash table size. This 15 seconds delay is not a hard number, as work is a deferrable one. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r--include/net/neighbour.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index d8d790e56d3d..18b69b6cecaf 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -24,6 +24,7 @@
24 24
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/sysctl.h> 26#include <linux/sysctl.h>
27#include <linux/workqueue.h>
27#include <net/rtnetlink.h> 28#include <net/rtnetlink.h>
28 29
29/* 30/*
@@ -167,7 +168,7 @@ struct neigh_table
167 int gc_thresh2; 168 int gc_thresh2;
168 int gc_thresh3; 169 int gc_thresh3;
169 unsigned long last_flush; 170 unsigned long last_flush;
170 struct timer_list gc_timer; 171 struct delayed_work gc_work;
171 struct timer_list proxy_timer; 172 struct timer_list proxy_timer;
172 struct sk_buff_head proxy_queue; 173 struct sk_buff_head proxy_queue;
173 atomic_t entries; 174 atomic_t entries;
@@ -178,7 +179,6 @@ struct neigh_table
178 struct neighbour **hash_buckets; 179 struct neighbour **hash_buckets;
179 unsigned int hash_mask; 180 unsigned int hash_mask;
180 __u32 hash_rnd; 181 __u32 hash_rnd;
181 unsigned int hash_chain_gc;
182 struct pneigh_entry **phash_buckets; 182 struct pneigh_entry **phash_buckets;
183}; 183};
184 184