亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: CONFIG_NET_NS宏與TCP計(jì)數(shù)器之間的關(guān)系 [打印本頁(yè)]

作者: asweisun_shan    時(shí)間: 2011-02-15 15:20
標(biāo)題: CONFIG_NET_NS宏與TCP計(jì)數(shù)器之間的關(guān)系
本帖最后由 asweisun_shan 于 2011-02-15 15:31 編輯

最新內(nèi)核中,inet_twdr_twcal_tick()中有如下的代碼:
  1. inet_twdr_twcal_tick()
  2. 446 #ifdef CONFIG_NET_NS
  3. 447                                 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED);
  4. 448 #endif
復(fù)制代碼
twsk_net()中已經(jīng)針對(duì)是否啟用CONFIG_NET_NS,而選擇不同的命名空間。
twsk_net()的定義如下:
  1. 217 static inline
  2. 218 struct net *twsk_net(const struct inet_timewait_sock *twsk)
  3. 219 {
  4. 220 #ifdef CONFIG_NET_NS
  5. 221         return rcu_dereference_raw(twsk->tw_net); /* protected by locking, */
  6. 222                                                   /* reference counting, */
  7. 223                                                   /* initialization, or RCU. */
  8. 224 #else
  9. 225         return &init_net;
  10. 226 #endif
  11. 227 }
復(fù)制代碼
為何CONFIG_NET_NS宏未定義時(shí),不增加LINUX_MIB_TIMEWAITKILLED值。
有人知道這樣實(shí)現(xiàn)的目的嗎?
作者: asweisun_shan    時(shí)間: 2011-02-18 14:53
有誰(shuí)懂namespace?
看懂這個(gè)patch的幫忙解釋下吧。

commit f2bf415cfed703de5ba94d25cdb160920c01fb00
Author: Pavel Emelyanov <xemul@openvz.org>
Date:   Wed Jul 16 20:32:25 2008 -0700

    mib: add net to NET_ADD_STATS_BH
   
    This one is tricky.
   
    The thing is that this macro is only used when killing tw buckets,
    but since this killer is promiscuous wrt to which net each particular
    tw belongs to, I have to use it only when NET_NS is off. When the net
    namespaces are on, I use the INET_INC_STATS_BH for each bucket.
   
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2