1. 27 Oct, 2010 1 commit
  2. 16 Jun, 2010 1 commit
    • Eric Dumazet's avatar
      inetpeer: restore small inet_peer structures · 317fe0e6
      Eric Dumazet authored
      Addition of rcu_head to struct inet_peer added 16bytes on 64bit arches.
      
      Thats a bit unfortunate, since old size was exactly 64 bytes.
      
      This can be solved, using an union between this rcu_head an four fields,
      that are normally used only when a refcount is taken on inet_peer.
      rcu_head is used only when refcnt=-1, right before structure freeing.
      
      Add a inet_peer_refcheck() function to check this assertion for a while.
      
      We can bring back SLAB_HWCACHE_ALIGN qualifier in kmem cache creation.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      317fe0e6
  3. 15 Jun, 2010 3 commits
    • Eric Dumazet's avatar
      inetpeer: do not use zero refcnt for freed entries · 5f2f8920
      Eric Dumazet authored
      Followup of commit aa1039e7 (inetpeer: RCU conversion)
      
      Unused inet_peer entries have a null refcnt.
      
      Using atomic_inc_not_zero() in rcu lookups is not going to work for
      them, and slow path is taken.
      
      Fix this using -1 marker instead of 0 for deleted entries.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f2f8920
    • Eric Dumazet's avatar
      inetpeer: RCU conversion · aa1039e7
      Eric Dumazet authored
      inetpeer currently uses an AVL tree protected by an rwlock.
      
      It's possible to make most lookups use RCU
      
      1) Add a struct rcu_head to struct inet_peer
      
      2) add a lookup_rcu_bh() helper to perform lockless and opportunistic
      lookup. This is a normal function, not a macro like lookup().
      
      3) Add a limit to number of links followed by lookup_rcu_bh(). This is
      needed in case we fall in a loop.
      
      4) add an smp_wmb() in link_to_pool() right before node insert.
      
      5) make unlink_from_pool() use atomic_cmpxchg() to make sure it can take
      last reference to an inet_peer, since lockless readers could increase
      refcount, even while we hold peers.lock.
      
      6) Delay struct inet_peer freeing after rcu grace period so that
      lookup_rcu_bh() cannot crash.
      
      7) inet_getpeer() first attempts lockless lookup.
         Note this lookup can fail even if target is in AVL tree, but a
      concurrent writer can let tree in a non correct form.
         If this attemps fails, lock is taken a regular lookup is performed
      again.
      
      8) convert peers.lock from rwlock to a spinlock
      
      9) Remove SLAB_HWCACHE_ALIGN when peer_cachep is created, because
      rcu_head adds 16 bytes on 64bit arches, doubling effective size (64 ->
      128 bytes)
      In a future patch, this is probably possible to revert this part, if rcu
      field is put in an union to share space with rid, ip_id_count, tcp_ts &
      tcp_ts_stamp. These fields being manipulated only with refcnt > 0.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa1039e7
    • Eric Dumazet's avatar
      inetpeer: various changes · d6cc1d64
      Eric Dumazet authored
      Try to reduce cache line contentions in peer management, to reduce IP
      defragmentation overhead.
      
      - peer_fake_node is marked 'const' to make sure its not modified.
        (tested with CONFIG_DEBUG_RODATA=y)
      
      - Group variables in two structures to reduce number of dirtied cache
      lines. One named "peers" for avl tree root, its number of entries, and
      associated lock. (candidate for RCU conversion)
      
      - A second one named "unused_peers" for unused list and its lock
      
      - Add a !list_empty() test in unlink_from_unused() to avoid taking lock
      when entry is not unused.
      
      - Use atomic_dec_and_lock() in inet_putpeer() to avoid taking lock in
      some cases.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d6cc1d64
  4. 13 Nov, 2009 1 commit
    • Eric Dumazet's avatar
      inetpeer: Optimize inet_getid() · 2c1409a0
      Eric Dumazet authored
      While investigating for network latencies, I found inet_getid() was a
      contention point for some workloads, as inet_peer_idlock is shared
      by all inet_getid() users regardless of peers.
      
      One way to fix this is to make ip_id_count an atomic_t instead
      of __u16, and use atomic_add_return().
      
      In order to keep sizeof(struct inet_peer) = 64 on 64bit arches
      tcp_ts_stamp is also converted to __u32 instead of "unsigned long".
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c1409a0
  5. 03 Nov, 2008 1 commit
  6. 11 Jun, 2008 1 commit
  7. 12 Nov, 2007 1 commit
  8. 20 Jul, 2007 1 commit
    • Patrick McHardy's avatar
      [IPV4]: Fix inetpeer gcc-4.2 warnings · fc7b9380
      Patrick McHardy authored
        CC      net/ipv4/inetpeer.o
      net/ipv4/inetpeer.c: In function 'unlink_from_pool':
      net/ipv4/inetpeer.c:297: warning: the address of 'stack' will always evaluate as 'true'
      net/ipv4/inetpeer.c:297: warning: the address of 'stack' will always evaluate as 'true'
      net/ipv4/inetpeer.c: In function 'inet_getpeer':
      net/ipv4/inetpeer.c:409: warning: the address of 'stack' will always evaluate as 'true'
      net/ipv4/inetpeer.c:409: warning: the address of 'stack' will always evaluate as 'true'
      
      "Fix" by checking for != NULL.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc7b9380
  9. 19 Jul, 2007 1 commit
    • Paul Mundt's avatar
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt authored
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      20c2df83
  10. 25 Apr, 2007 1 commit
    • Eric Dumazet's avatar
      [IPV4]: Optimize inet_getpeer() · 243bbcaa
      Eric Dumazet authored
      1) Some sysctl vars are declared __read_mostly
      
      2) We can avoid updating stack[] when doing an AVL lookup only.
      
          lookup() macro is extended to receive a second parameter, that may be NULL
      in case of a pure lookup (no need to save the AVL path). This removes
      unnecessary instructions, because compiler knows if this _stack parameter is
      NULL or not.
      
          text size of net/ipv4/inetpeer.o is 2063 bytes instead of 2107 on x86_64
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      243bbcaa
  11. 14 Feb, 2007 1 commit
    • Tim Schmielau's avatar
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau authored
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: default avatarTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  12. 07 Dec, 2006 1 commit
  13. 16 Oct, 2006 1 commit
  14. 28 Sep, 2006 1 commit
  15. 22 Sep, 2006 1 commit
  16. 10 Jul, 2006 1 commit
  17. 09 Jan, 2006 1 commit
  18. 03 Jan, 2006 1 commit
  19. 09 Sep, 2005 1 commit
  20. 29 Aug, 2005 3 commits
  21. 23 Aug, 2005 1 commit
    • Dave Johnson's avatar
      [IPV4]: Fix negative timer loop with lots of ipv4 peers. · 1344a416
      Dave Johnson authored
      From: Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>
      
      Found this bug while doing some scaling testing that created 500K inet
      peers.
      
      peer_check_expire() in net/ipv4/inetpeer.c isn't using inet_peer_gc_mintime
      correctly and will end up creating an expire timer with less than the
      minimum duration, and even zero/negative if enough active peers are
      present.
      
      If >65K peers, the timer will be less than inet_peer_gc_mintime, and with
      >70K peers, the timer duration will reach zero and go negative.
      
      The timer handler will continue to schedule another zero/negative timer in
      a loop until peers can be aged.  This can continue for at least a few
      minutes or even longer if the peers remain active due to arriving packets
      while the loop is occurring.
      
      Bug is present in both 2.4 and 2.6.  Same patch will apply to both just
      fine.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1344a416
  22. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4