1. 22 3月, 2010 1 次提交
  2. 05 10月, 2009 1 次提交
  3. 29 8月, 2009 1 次提交
    • J
      fib_trie: resize rework · 80b71b80
      Jens Låås 提交于
      Here is rework and cleanup of the resize function.
      
      Some bugs we had. We were using ->parent when we should use 
      node_parent(). Also we used ->parent which is not assigned by
      inflate in inflate loop.
      
      Also a fix to set thresholds to power 2 to fit halve 
      and double strategy.
      
      max_resize is renamed to max_work which better indicates
      it's function.
      
      Reaching max_work is not an error, so warning is removed. 
      max_work only limits amount of work done per resize.
      (limits CPU-usage, outstanding memory etc).
      
      The clean-up makes it relatively easy to add fixed sized 
      root-nodes if we would like to decrease the memory pressure
      on routers with large routing tables and dynamic routing.
      If we'll need that...
      
      Its been tested with 280k routes.
      
      Work done together with Robert Olsson.
      Signed-off-by: NJens Låås <jens.laas@its.uu.se>
      Signed-off-by: NRobert Olsson <robert.olsson@its.uu.se>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      80b71b80
  4. 06 8月, 2009 1 次提交
  5. 20 7月, 2009 3 次提交
  6. 09 7月, 2009 1 次提交
    • J
      ipv4: Fix fib_trie rebalancing, part 4 (root thresholds) · 345aa031
      Jarek Poplawski 提交于
      Pawel Staszewski wrote:
      <blockquote>
      Some time ago i report this:
      http://bugzilla.kernel.org/show_bug.cgi?id=6648
      
      and now with 2.6.29 / 2.6.29.1 / 2.6.29.3 and 2.6.30 it back
      dmesg output:
      oprofile: using NMI interrupt.
      Fix inflate_threshold_root. Now=15 size=11 bits
      ...
      Fix inflate_threshold_root. Now=15 size=11 bits
      
      cat /proc/net/fib_triestat
      Basic info: size of leaf: 40 bytes, size of tnode: 56 bytes.
      Main:
              Aver depth:     2.28
              Max depth:      6
              Leaves:         276539
              Prefixes:       289922
              Internal nodes: 66762
                1: 35046  2: 13824  3: 9508  4: 4897  5: 2331  6: 1149  7: 5
      9: 1  18: 1
              Pointers: 691228
      Null ptrs: 347928
      Total size: 35709  kB
      </blockquote>
      
      It seems, the current threshold for root resizing is too aggressive,
      and it causes misleading warnings during big updates, but it might be
      also responsible for memory problems, especially with non-preempt
      configs, when RCU freeing is delayed long after call_rcu.
      
      It should be also mentioned that because of non-atomic changes during
      resizing/rebalancing the current lookup algorithm can miss valid leaves
      so it's additional argument to shorten these activities even at a cost
      of a minimally longer searching.
      
      This patch restores values before the patch "[IPV4]: fib_trie root
      node settings", commit: 965ffea4 from
      v2.6.22.
      
      Pawel's report:
      <blockquote>
      I dont see any big change of (cpu load or faster/slower
      routing/propagating routes from bgpd or something else) - in avg there
      is from 2% to 3% more of CPU load i dont know why but it is - i change
      from "preempt" to "no preempt" 3 times and check this my "mpstat -P ALL
      1 30"
      always avg cpu load was from 2 to 3% more compared to "no preempt"
      [...]
      cat /proc/net/fib_triestat
      Basic info: size of leaf: 20 bytes, size of tnode: 36 bytes.
      Main:
              Aver depth:     2.44
              Max depth:      6
              Leaves:         277814
              Prefixes:       291306
              Internal nodes: 66420
                1: 32737  2: 14850  3: 10332  4: 4871  5: 2313  6: 942  7: 371  8: 3  17: 1
              Pointers: 599098
      Null ptrs: 254865
      Total size: 18067  kB
      </blockquote>
      
      According to this and other similar reports average depth is slightly
      increased (~0.2), and root nodes are shorter (log 17 vs. 18), but
      there is no visible performance decrease. So, until memory handling is
      improved or added parameters for changing this individually, this
      patch resets to safer defaults.
      Reported-by: NPawel Staszewski <pstaszewski@itcare.pl>
      Reported-by: NJorge Boncompte [DTI2] <jorge@dti2.net>
      Signed-off-by: NJarek Poplawski <jarkao2@gmail.com>
      Tested-by: NPawel Staszewski <pstaszewski@itcare.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      345aa031
  7. 01 7月, 2009 1 次提交
  8. 18 6月, 2009 1 次提交
    • J
      ipv4: Fix fib_trie rebalancing, part 2 · 7b85576d
      Jarek Poplawski 提交于
      My previous patch, which explicitly delays freeing of tnodes by adding
      them to the list to flush them after the update is finished, isn't
      strict enough. It treats exceptionally tnodes without parent, assuming
      they are newly created, so "invisible" for the read side yet.
      
      But the top tnode doesn't have parent as well, so we have to exclude
      all exceptions (at least until a better way is found). Additionally we
      need to move rcu assignment of this node before flushing, so the
      return type of the trie_rebalance() function is changed.
      Reported-by: NYan Zheng <zheng.yan@oracle.com>
      Signed-off-by: NJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7b85576d
  9. 15 6月, 2009 1 次提交
    • J
      ipv4: Fix fib_trie rebalancing · e0f7cb8c
      Jarek Poplawski 提交于
      While doing trie_rebalance(): resize(), inflate(), halve() RCU free
      tnodes before updating their parents. It depends on RCU delaying the
      real destruction, but if RCU readers start after call_rcu() and before
      parent update they could access freed memory.
      
      It is currently prevented with preempt_disable() on the update side,
      but it's not safe, except maybe classic RCU, plus it conflicts with
      memory allocations with GFP_KERNEL flag used from these functions.
      
      This patch explicitly delays freeing of tnodes by adding them to the
      list, which is flushed after the update is finished.
      Reported-by: NYan Zheng <zheng.yan@oracle.com>
      Signed-off-by: NJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0f7cb8c
  10. 22 5月, 2009 1 次提交
  11. 19 5月, 2009 1 次提交
  12. 31 10月, 2008 1 次提交
  13. 18 7月, 2008 2 次提交
  14. 11 7月, 2008 1 次提交
  15. 06 7月, 2008 1 次提交
  16. 12 6月, 2008 1 次提交
  17. 24 4月, 2008 1 次提交
  18. 14 4月, 2008 1 次提交
  19. 10 4月, 2008 3 次提交
  20. 26 3月, 2008 1 次提交
  21. 24 3月, 2008 1 次提交
  22. 23 3月, 2008 1 次提交
  23. 13 2月, 2008 2 次提交
  24. 05 2月, 2008 1 次提交
  25. 01 2月, 2008 2 次提交
  26. 29 1月, 2008 8 次提交