1. 09 9月, 2010 14 次提交
    • Z
      RDS: remove __init and __exit annotation · ef87b7ea
      Zach Brown 提交于
      The trivial amount of memory saved isn't worth the cost of dealing with section
      mismatches.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      ef87b7ea
    • Z
      RDS/IB: create a work queue for FMR flushing · 515e079d
      Zach Brown 提交于
      This patch moves the FMR flushing work in to its own mult-threaded work queue.
      This is to maintain performance in preparation for returning the main krdsd
      work queue back to a single threaded work queue to avoid deep-rooted
      concurrency bugs.
      
      This is also good because it further separates FMRs, which might be removed
      some day, from the rest of the code base.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      515e079d
    • Z
      RDS/IB: destroy connections on rmmod · 8aeb1ba6
      Zach Brown 提交于
      IB connections were not being destroyed during rmmod.
      
      First, recently IB device removal callback was changed to disconnect
      connections that used the removing device rather than destroying them.  So
      connections with devices during rmmod were not being destroyed.
      
      Second, rds_ib_destroy_nodev_conns() was being called before connections are
      disassociated with devices.  It would almost never find connections in the
      nodev list.
      
      We first get rid of rds_ib_destroy_conns(), which is no longer called, and
      refactor the existing caller into the main body of the function and get rid of
      the list and lock wrappers.
      
      Then we call rds_ib_destroy_nodev_conns() *after* ib_unregister_client() has
      removed the IB device from all the conns and put the conns on the nodev list.
      
      The result is that IB connections are destroyed by rmmod.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      8aeb1ba6
    • A
      RDS: whitespace · c9455d99
      Andy Grover 提交于
      c9455d99
    • C
      RDS: use delayed work for the FMR flushes · 7a0ff5db
      Chris Mason 提交于
      Using a delayed work queue helps us make sure a healthy number of FMRs
      have queued up over the limit.  It makes for a large improvement in RDMA
      iops.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      7a0ff5db
    • C
      rds: recycle FMRs through lockless lists · 6fa70da6
      Chris Mason 提交于
      FRM allocation and recycling is performance critical and fairly lock
      intensive.  The current code has a per connection lock that all
      processes bang on and it becomes a major bottleneck on large systems.
      
      This changes things to use a number of cmpxchg based lists instead,
      allowing us to go through the whole FMR lifecycle without locking inside
      RDS.
      
      Zach Brown pointed out that our usage of cmpxchg for xlist removal is
      racey if someone manages to remove and add back an FMR struct into the list
      while another CPU can see the FMR's address at the head of the list.
      
      The second CPU might assume the list hasn't changed when in fact any
      number of operations might have happened in between the deletion and
      reinsertion.
      
      This commit maintains a per cpu count of CPUs that are currently
      in xlist removal, and establishes a grace period to make sure that
      nobody can see an entry we have just removed from the list.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      6fa70da6
    • Z
      RDS/IB: add refcount tracking to struct rds_ib_device · 3e0249f9
      Zach Brown 提交于
      The RDS IB client .remove callback used to free the rds_ibdev for the given
      device unconditionally.  This could race other users of the struct.  This patch
      adds refcounting so that we only free the rds_ibdev once all of its users are
      done.
      
      Many rds_ibdev users are tied to connections.  We give the connection a
      reference and change these users to reference the device in the connection
      instead of looking it up in the IB client data.  The only user of the IB client
      data remaining is the first lookup of the device as connections are built up.
      
      Incrementing the reference count of a device found in the IB client data could
      race with final freeing so we use an RCU grace period to make sure that freeing
      won't happen until those lookups are done.
      
      MRs need the rds_ibdev to get at the pool that they're freed in to.  They exist
      outside a connection and many MRs can reference different devices from one
      socket, so it was natural to have each MR hold a reference.  MR refs can be
      dropped from interrupt handlers and final device teardown can block so we push
      it off to a work struct.  Pool teardown had to be fixed to cancel its pending
      work instead of deadlocking waiting for all queued work, including itself, to
      finish.
      
      MRs get their reference from the global device list, which gets a reference.
      It is left unprotected by locks and remains racy.  A simple global lock would
      be a significant bottleneck.  More scalable (complicated) locking should be
      done carefully in a later patch.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      3e0249f9
    • C
      rds: Use RCU for the bind lookup searches · 38a4e5e6
      Chris Mason 提交于
      The RDS bind lookups are somewhat expensive in terms of CPU
      time and locking overhead.  This commit changes them into a
      faster RCU based hash tree instead of the rbtrees they were using
      before.
      
      On large NUMA systems it is a significant improvement.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      38a4e5e6
    • A
      RDS/IB: add _to_node() macros for numa and use {k,v}malloc_node() · e4c52c98
      Andy Grover 提交于
      Allocate send/recv rings in memory that is node-local to the HCA.
      This significantly helps performance.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      e4c52c98
    • A
      4a81802b
    • C
      rds: rcu-ize rds_ib_get_device() · 764f2dd9
      Chris Mason 提交于
      rds_ib_get_device is called very often as we turn an
      ip address into a corresponding device structure.  It currently
      take a global spinlock as it walks different lists to find active
      devices.
      
      This commit changes the lists over to RCU, which isn't very complex
      because they are not updated very often at all.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      764f2dd9
    • A
      RDS: Implement atomic operations · 15133f6e
      Andy Grover 提交于
      Implement a CMSG-based interface to do FADD and CSWP ops.
      
      Alter send routines to handle atomic ops.
      
      Add atomic counters to stats.
      
      Add xmit_atomic() to struct rds_transport
      
      Inline rds_ib_send_unmap_rdma into unmap_rm
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      15133f6e
    • A
      RDS: fold rdma.h into rds.h · 21f79afa
      Andy Grover 提交于
      RDMA is now an intrinsic part of RDS, so it's easier to just have
      a single header.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      21f79afa
    • A
      RDS: Fix BUG_ONs to not fire when in a tasklet · 9e2effba
      Andy Grover 提交于
      in_interrupt() is true in softirqs. The BUG_ONs are supposed
      to check for if irqs are disabled, so we should use
      BUG_ON(irqs_disabled()) instead, duh.
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      9e2effba
  2. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      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.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      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
        file.
      
      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
         files.
      
      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
         necessary.
      
      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: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  3. 17 3月, 2010 2 次提交
  4. 30 11月, 2009 1 次提交
  5. 31 10月, 2009 1 次提交
  6. 20 7月, 2009 1 次提交
  7. 02 4月, 2009 1 次提交
    • A
      RDS: Rewrite connection cleanup, fixing oops on rmmod · 745cbcca
      Andy Grover 提交于
      This fixes a bug where a connection was unexpectedly
      not on *any* list while being destroyed. It also
      cleans up some code duplication and regularizes some
      function names.
      
      * Grab appropriate lock in conn_free() and explain in comment
      * Ensure via locking that a conn is never not on either
        a dev's list or the nodev list
      * Add rds_xx_remove_conn() to match rds_xx_add_conn()
      * Make rds_xx_add_conn() return void
      * Rename remove_{,nodev_}conns() to
        destroy_{,nodev_}conns() and unify their implementation
        in a helper function
      * Document lock ordering as nodev conn_lock before
        dev_conn_lock
      Reported-by: NYosef Etigin <yosefe@voltaire.com>
      Signed-off-by: NAndy Grover <andy.grover@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      745cbcca
  8. 27 2月, 2009 1 次提交