1. 31 May, 2010 1 commit
  2. 17 May, 2010 1 commit
  3. 16 May, 2010 1 commit
  4. 27 Apr, 2010 1 commit
  5. 20 Apr, 2010 2 commits
  6. 30 Mar, 2010 2 commits
    • Steven J. Magnani's avatar
      net: Fix oops from tcp_collapse() when using splice() · baff42ab
      Steven J. Magnani authored
      tcp_read_sock() can have a eat skbs without immediately advancing copied_seq.
      This can cause a panic in tcp_collapse() if it is called as a result
      of the recv_actor dropping the socket lock.
      A userspace program that splices data from a socket to either another
      socket or to a file can trigger this bug.
      Signed-off-by: default avatarSteven J. Magnani <steve@digidescorp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      The script does the followings.
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
      The conversion was done in the following steps.
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  7. 20 Mar, 2010 1 commit
    • Steven J. Magnani's avatar
      NET_DMA: free skbs periodically · 73852e81
      Steven J. Magnani authored
      Under NET_DMA, data transfer can grind to a halt when userland issues a
      large read on a socket with a high RCVLOWAT (i.e., 512 KB for both).
      This appears to be because the NET_DMA design queues up lots of memcpy
      operations, but doesn't issue or wait for them (and thus free the
      associated skbs) until it is time for tcp_recvmesg() to return.
      The socket hangs when its TCP window goes to zero before enough data is
      available to satisfy the read.
      Periodically issue asynchronous memcpy operations, and free skbs for ones
      that have completed, to prevent sockets from going into zero-window mode.
      Signed-off-by: default avatarSteven J. Magnani <steve@digidescorp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  8. 18 Mar, 2010 1 commit
  9. 18 Feb, 2010 2 commits
    • Andreas Petlund's avatar
      net: TCP thin dupack · 7e380175
      Andreas Petlund authored
      This patch enables fast retransmissions after one dupACK for
      TCP if the stream is identified as thin. This will reduce
      latencies for thin streams that are not able to trigger fast
      retransmissions due to high packet interarrival time. This
      mechanism is only active if enabled by iocontrol or syscontrol
      and the stream is identified as thin.
      Signed-off-by: default avatarAndreas Petlund <apetlund@simula.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Andreas Petlund's avatar
      net: TCP thin linear timeouts · 36e31b0a
      Andreas Petlund authored
      This patch will make TCP use only linear timeouts if the
      stream is thin. This will help to avoid the very high latencies
      that thin stream suffer because of exponential backoff. This
      mechanism is only active if enabled by iocontrol or syscontrol
      and the stream is identified as thin. A maximum of 6 linear
      timeouts is tried before exponential backoff is resumed.
      Signed-off-by: default avatarAndreas Petlund <apetlund@simula.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  10. 17 Feb, 2010 1 commit
    • Tejun Heo's avatar
      percpu: add __percpu sparse annotations to net · 7d720c3e
      Tejun Heo authored
      Add __percpu sparse annotations to net.
      These annotations are to make sparse consider percpu variables to be
      in a different address space and warn if accessed without going
      through percpu accessors.  This patch doesn't affect normal builds.
      The macro and type tricks around snmp stats make things a bit
      interesting.  DEFINE/DECLARE_SNMP_STAT() macros mark the target field
      as __percpu and SNMP_UPD_PO_STATS() macro is updated accordingly.  All
      snmp_mib_*() users which used to cast the argument to (void **) are
      updated to cast it to (void __percpu **).
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  11. 23 Dec, 2009 2 commits
  12. 08 Dec, 2009 1 commit
  13. 02 Dec, 2009 2 commits
  14. 30 Nov, 2009 1 commit
  15. 13 Nov, 2009 1 commit
  16. 22 Oct, 2009 1 commit
  17. 20 Oct, 2009 1 commit
  18. 19 Oct, 2009 1 commit
  19. 18 Oct, 2009 1 commit
    • Eric Dumazet's avatar
      inet: rename some inet_sock fields · c720c7e8
      Eric Dumazet authored
      In order to have better cache layouts of struct sock (separate zones
      for rx/tx paths), we need this preliminary patch.
      Goal is to transfert fields used at lookup time in the first
      read-mostly cache line (inside struct sock_common) and move sk_refcnt
      to a separate cache line (only written by rx path)
      This patch adds inet_ prefix to daddr, rcv_saddr, dport, num, saddr,
      sport and id fields. This allows a future patch to define these
      fields as macros, like sk_refcnt, without name clashes.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  20. 13 Oct, 2009 1 commit
  21. 02 Oct, 2009 1 commit
  22. 01 Oct, 2009 1 commit
  23. 30 Sep, 2009 1 commit
  24. 22 Sep, 2009 1 commit
  25. 15 Sep, 2009 1 commit
  26. 03 Sep, 2009 1 commit
    • Wu Fengguang's avatar
      tcp: replace hard coded GFP_KERNEL with sk_allocation · aa133076
      Wu Fengguang authored
      This fixed a lockdep warning which appeared when doing stress
      memory tests over NFS:
      	inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
      	page reclaim => nfs_writepage => tcp_sendmsg => lock sk_lock
      	mount_root => nfs_root_data => tcp_close => lock sk_lock =>
      			tcp_send_fin => alloc_skb_fclone => page reclaim
      David raised a concern that if the allocation fails in tcp_send_fin(), and it's
      GFP_ATOMIC, we are going to yield() (which sleeps) and loop endlessly waiting
      for the allocation to succeed.
      But fact is, the original GFP_KERNEL also sleeps. GFP_ATOMIC+yield() looks
      weird, but it is no worse the implicit sleep inside GFP_KERNEL. Both could
      loop endlessly under memory pressure.
      CC: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      CC: David S. Miller <davem@davemloft.net>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  27. 29 Aug, 2009 1 commit
  28. 09 Jul, 2009 1 commit
    • Jiri Olsa's avatar
      net: adding memory barrier to the poll and receive callbacks · a57de0b4
      Jiri Olsa authored
      Adding memory barrier after the poll_wait function, paired with
      receive callbacks. Adding fuctions sock_poll_wait and sk_has_sleeper
      to wrap the memory barrier.
      Without the memory barrier, following race can happen.
      The race fires, when following code paths meet, and the tp->rcv_nxt
      and __add_wait_queue updates stay in CPU caches.
      CPU1                         CPU2
      sys_select                   receive packet
        ...                        ...
        __add_wait_queue           update tp->rcv_nxt
        ...                        ...
        tp->rcv_nxt check          sock_def_readable
        ...                        {
        schedule                      ...
                                      if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
      If there was no cache the code would work ok, since the wait_queue and
      rcv_nxt are opposit to each other.
      Meaning that once tp->rcv_nxt is updated by CPU2, the CPU1 either already
      passed the tp->rcv_nxt check and sleeps, or will get the new value for
      tp->rcv_nxt and will return with new data mask.
      In both cases the process (CPU1) is being added to the wait queue, so the
      waitqueue_active (CPU2) call cannot miss and will wake up CPU1.
      The bad case is when the __add_wait_queue changes done by CPU1 stay in its
      cache, and so does the tp->rcv_nxt update on CPU2 side.  The CPU1 will then
      endup calling schedule and sleep forever if there are no more data on the
      Calls to poll_wait in following modules were ommited:
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  29. 29 Jun, 2009 1 commit
  30. 28 May, 2009 1 commit
  31. 27 May, 2009 5 commits