转:http://blog.csdn.net/nerdx/article/details/12312325
-
-
-
-
1.1 void __init ip_init(void)
-
{
-
dev_add_pack(&ip_packet_type);
-
ip_rt_init();
-
inet_initpeers();
-
}
-
-
-
-
-
-
-
1.2 void __init inet_initpeers(void)
-
{
-
struct sysinfo si;
-
-
-
si_meminfo(&si);
-
-
if (si.totalram <= (32768*1024)/PAGE_SIZE)
-
inet_peer_threshold >>= 1;
-
if (si.totalram <= (16384*1024)/PAGE_SIZE)
-
inet_peer_threshold >>= 1;
-
if (si.totalram <= (8192*1024)/PAGE_SIZE)
-
inet_peer_threshold >>= 2;
-
-
peer_cachep = kmem_cache_create("inet_peer_cache",
-
sizeof(struct inet_peer),
-
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
-
NULL);
-
-
peer_periodic_timer.expires = jiffies
-
+ net_random() % inet_peer_gc_maxtime
-
+ inet_peer_gc_maxtime;
-
add_timer(&peer_periodic_timer);
-
}
-
阅读(480) | 评论(0) | 转发(0) |