diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-03-22 20:43:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-22 20:43:59 -0400 |
commit | 817bc4db7794d6dc6594265ddea88d2b839cf2f8 (patch) | |
tree | 280b5e41521845a8af39095cc561c571b56e28af /net/ipv4/route.c | |
parent | ce259990785595420ace616faece09255bad1163 (diff) |
[IPV4] route: use read_mostly
The route table parameters are set based on system memory and sysctl
values that almost never change. Also the genid only changes every
10 minutes.
RTprint is defined by never used.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 9ba3413a9909..2941ef21f203 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -118,21 +118,19 @@ | |||
118 | #define RT_GC_TIMEOUT (300*HZ) | 118 | #define RT_GC_TIMEOUT (300*HZ) |
119 | 119 | ||
120 | static int ip_rt_max_size; | 120 | static int ip_rt_max_size; |
121 | static int ip_rt_gc_timeout = RT_GC_TIMEOUT; | 121 | static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT; |
122 | static int ip_rt_gc_interval = 60 * HZ; | 122 | static int ip_rt_gc_interval __read_mostly = 60 * HZ; |
123 | static int ip_rt_gc_min_interval = HZ / 2; | 123 | static int ip_rt_gc_min_interval __read_mostly = HZ / 2; |
124 | static int ip_rt_redirect_number = 9; | 124 | static int ip_rt_redirect_number __read_mostly = 9; |
125 | static int ip_rt_redirect_load = HZ / 50; | 125 | static int ip_rt_redirect_load __read_mostly = HZ / 50; |
126 | static int ip_rt_redirect_silence = ((HZ / 50) << (9 + 1)); | 126 | static int ip_rt_redirect_silence __read_mostly = ((HZ / 50) << (9 + 1)); |
127 | static int ip_rt_error_cost = HZ; | 127 | static int ip_rt_error_cost __read_mostly = HZ; |
128 | static int ip_rt_error_burst = 5 * HZ; | 128 | static int ip_rt_error_burst __read_mostly = 5 * HZ; |
129 | static int ip_rt_gc_elasticity = 8; | 129 | static int ip_rt_gc_elasticity __read_mostly = 8; |
130 | static int ip_rt_mtu_expires = 10 * 60 * HZ; | 130 | static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ; |
131 | static int ip_rt_min_pmtu = 512 + 20 + 20; | 131 | static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; |
132 | static int ip_rt_min_advmss = 256; | 132 | static int ip_rt_min_advmss __read_mostly = 256; |
133 | static int ip_rt_secret_interval = 10 * 60 * HZ; | 133 | static int ip_rt_secret_interval __read_mostly = 10 * 60 * HZ; |
134 | |||
135 | #define RTprint(a...) printk(KERN_DEBUG a) | ||
136 | 134 | ||
137 | static void rt_worker_func(struct work_struct *work); | 135 | static void rt_worker_func(struct work_struct *work); |
138 | static DECLARE_DELAYED_WORK(expires_work, rt_worker_func); | 136 | static DECLARE_DELAYED_WORK(expires_work, rt_worker_func); |
@@ -252,10 +250,10 @@ static inline void rt_hash_lock_init(void) | |||
252 | } | 250 | } |
253 | #endif | 251 | #endif |
254 | 252 | ||
255 | static struct rt_hash_bucket *rt_hash_table; | 253 | static struct rt_hash_bucket *rt_hash_table __read_mostly; |
256 | static unsigned rt_hash_mask; | 254 | static unsigned rt_hash_mask __read_mostly; |
257 | static unsigned int rt_hash_log; | 255 | static unsigned int rt_hash_log __read_mostly; |
258 | static atomic_t rt_genid; | 256 | static atomic_t rt_genid __read_mostly; |
259 | 257 | ||
260 | static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); | 258 | static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); |
261 | #define RT_CACHE_STAT_INC(field) \ | 259 | #define RT_CACHE_STAT_INC(field) \ |