1. 28 Jan, 2008 2 commits
    • Pavel Emelyanov's avatar
      [INET]: Uninline the __inet_lookup_established function. · 77a5ba55
      Pavel Emelyanov authored
      This is -700 bytes from the net/ipv4/built-in.o
      add/remove: 1/0 grow/shrink: 1/3 up/down: 340/-1040 (-700)
      function                                     old     new   delta
      __inet_lookup_established                      -     339    +339
      tcp_sacktag_write_queue                     2254    2255      +1
      tcp_v4_err                                  1304     973    -331
      tcp_v4_rcv                                  2089    1744    -345
      tcp_v4_do_rcv                                826     462    -364
      Exporting is for dccp module (used via e.g. inet_lookup).
      Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Pavel Emelyanov's avatar
      [INET]: Uninline the __inet_hash function. · 152da81d
      Pavel Emelyanov authored
      This one is used in quite many places in the networking code and
      seems to big to be inline.
      After the patch net/ipv4/build-in.o loses ~650 bytes:
      add/remove: 2/0 grow/shrink: 0/5 up/down: 461/-1114 (-653)
      function                                     old     new   delta
      __inet_hash_nolisten                           -     282    +282
      __inet_hash                                    -     179    +179
      tcp_sacktag_write_queue                     2255    2254      -1
      __inet_lookup_listener                       284     274     -10
      tcp_v4_syn_recv_sock                         755     493    -262
      tcp_v4_hash                                  389      35    -354
      inet_hash_connect                           1086     599    -487
      This version addresses the issue pointed by Eric, that
      while being inline this function was optimized by gcc
      in respect to the 'listen_possible' argument.
      Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  2. 07 Nov, 2007 1 commit
    • Eric Dumazet's avatar
      [INET]: Remove per bucket rwlock in tcp/dccp ehash table. · 230140cf
      Eric Dumazet authored
      As done two years ago on IP route cache table (commit
      ) , we can avoid using one
      lock per hash bucket for the huge TCP/DCCP hash tables.
      On a typical x86_64 platform, this saves about 2MB or 4MB of ram, for
      litle performance differences. (we hit a different cache line for the
      rwlock, but then the bucket cache line have a better sharing factor
      among cpus, since we dirty it less often). For netstat or ss commands
      that want a full scan of hash table, we perform fewer memory accesses.
      Using a 'small' table of hashed rwlocks should be more than enough to
      provide correct SMP concurrency between different buckets, without
      using too much memory. Sizing of this table depends on
      num_possible_cpus() and various CONFIG settings.
      This patch provides some locking abstraction that may ease a future
      work using a different model for TCP/DCCP table.
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  3. 18 Oct, 2007 1 commit
  4. 10 Oct, 2007 1 commit
  5. 11 Feb, 2007 1 commit
  6. 08 Feb, 2007 1 commit
    • Eric Dumazet's avatar
      [NET]: change layout of ehash table · dbca9b27
      Eric Dumazet authored
      ehash table layout is currently this one :
      First half of this table is used by sockets not in TIME_WAIT state
      Second half of it is used by sockets in TIME_WAIT state.
      This is non optimal because of for a given hash or socket, the two chain heads 
      are located in separate cache lines.
      Moreover the locks of the second half are never used.
      If instead of this halving, we use two list heads in inet_ehash_bucket instead 
      of only one, we probably can avoid one cache miss, and reduce ram usage, 
      particularly if sizeof(rwlock_t) is big (various CONFIG_DEBUG_SPINLOCK, 
      CONFIG_DEBUG_LOCK_ALLOC settings). So we still halves the table but we keep 
      together related chains to speedup lookups and socket state change.
      In this patch I did not try to align struct inet_ehash_bucket, but a future 
      patch could try to make this structure have a convenient size (a power of two 
      or a multiple of L1_CACHE_SIZE).
      I guess rwlock will just vanish as soon as RCU is plugged into ehash :) , so 
      maybe we dont need to scratch our heads to align the bucket...
      Note : In case struct inet_ehash_bucket is not a power of two, we could 
      probably change alloc_large_system_hash() (in case it use __get_free_pages()) 
      to free the unused space. It currently allocates a big zone, but the last 
      quarter of it could be freed. Again, this should be a temporary 'problem'.
      Patch tested on ipv4 tcp only, but should be OK for IPV6 and DCCP.
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  7. 07 Dec, 2006 2 commits
  8. 28 Sep, 2006 2 commits
  9. 22 Sep, 2006 2 commits
  10. 30 Jun, 2006 1 commit
  11. 14 Apr, 2006 1 commit
    • Adrian Bunk's avatar
      [IPV4]: Possible cleanups. · 6c97e72a
      Adrian Bunk authored
      This patch contains the following possible cleanups:
      - make the following needlessly global function static:
        - arp.c: arp_rcv()
      - remove the following unused EXPORT_SYMBOL's:
        - devinet.c: devinet_ioctl
        - fib_frontend.c: ip_rt_ioctl
        - inet_hashtables.c: inet_bind_bucket_create
        - inet_hashtables.c: inet_bind_hash
        - tcp_input.c: sysctl_tcp_abc
        - tcp_ipv4.c: sysctl_tcp_tw_reuse
        - tcp_output.c: sysctl_tcp_mtu_probing
        - tcp_output.c: sysctl_tcp_base_mss
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  12. 24 Mar, 2006 1 commit
  13. 03 Jan, 2006 1 commit
  14. 29 Aug, 2005 6 commits