Garbage Collection for Neighbors To avoid wasting unnecessary storage space, the neighbor subsystem maintains a garbage collection mechanism that deletes invalid or long-term neighbor entries. Recall that there is a timer struct timer_list gc_timer structure in the neighbor table (neigh_table), let's see how it is initialized. In neigh_table_init() {…….init_timer(&tbl->gc_timer);tbl->gc_timer.data = (unsigned long)tbl;tbl->gc_timer.function = neigh_periodic_timer;tbl-> Gc_timer.expires = now + 1; add_timer(&tbl->gc_timer;…} After a tick, the timer expires, running the timer handler neigh_periodic_timer() static void neigh_periodic_timer(unsigned long arg){struct neigh_table * Tbl = (struct neigh_table *) arg; struct neighbour *n, **np;unsigned long expire, now = jiffies;NEIGH_CACHE_STAT_INC(tbl, periodic_gc_runs);write_lock(&tbl->lock);/** periodically recompute ReachableTime From random function*///Randomly initialize REACHABLE state timeout time every 300HZ if (time_after(now, tbl->last_rand + 300 * HZ)) {struct neigh_parms *p;tbl->last_rand = now;for (p = &tbl->parms; p; p = p->next)p->reachable_time =neigh_rand_reach_time(p->base_reachable_time);}//hash_chain_gc is processed in the initialization function //so, here Zero np = &tbl->has H_buckets[tbl->hash_chain_gc];//Have hash_chain_gc to the next item, if it exceeds the maximum value hash_mash//then return to the initial value tbl->hash_chain_gc = ((tbl->hash_chain_gc + 1) & Tbl->hash_mask);while ((n = *np) != NULL) {unsigned int state;write_lock(&n->lock);state = n->nud_state;//if the corresponding is static Item, or is being initialized by the timer if (state & (NUD_PERMANENT
LDM/STM instructions are mainly used for field protection, data copying, parameter transfer, etc. ST
The Gentoo Linux operating system (pronounced /ˈdʒɛntuː/) is a Linux meta-release
1. Lock the redundant self-built account in the systemCheck method:Execute the command#cat /etc/pas
This period win8.1 Mac OS X 10.9 Mavericks Two operating systems almost simultaneously released, i
Clean up memory and Cache method under Linux /proc/sys/vm/drop
Linux awk array operation details
Linux system command sudo use detailed explanation
What are the benefits of using Linux/Unix as a server?
Modify IP, DNS and other network configurations under Linux operating system
Linux SSH jump server reported Host key verification failed problem solved
Exchange 2010 removal and reinstallation issues
Windows Server 2003 DNS service installation diagram articles
How to solve the language bar in Windows XP system gray?
XP LAN settings and inaccessible solutions
Windows8 system automatically returns to the login interface after the black screen.
Tomato Garden win7 64-bit system detailed system classification function and how to close
Win8 system disk name can not be modified Solution Description
Preventing the web graphics from teaching the wireless network to no longer card