1. 05 3月, 2011 3 次提交
    • S
      libceph: fix msgr standby handling · e00de341
      Sage Weil 提交于
      The standby logic used to be pretty dependent on the work requeueing
      behavior that changed when we switched to WQ_NON_REENTRANT.  It was also
      very fragile.
      
      Restructure things so that:
       - We clear WRITE_PENDING when we set STANDBY.  This ensures we will
         requeue work when we wake up later.
       - con_work backs off if STANDBY is set.  There is nothing to do if we are
         in standby.
       - clear_standby() helper is called by both con_send() and con_keepalive(),
         the two actions that can wake us up again.  Move the connect_seq++
         logic here.
      Signed-off-by: NSage Weil <sage@newdream.net>
      e00de341
    • S
      libceph: fix msgr keepalive flag · e76661d0
      Sage Weil 提交于
      There was some broken keepalive code using a dead variable.  Shift to using
      the proper bit flag.
      Signed-off-by: NSage Weil <sage@newdream.net>
      e76661d0
    • S
      libceph: fix msgr backoff · 60bf8bf8
      Sage Weil 提交于
      With commit f363e45f we replaced a bunch of hacky workqueue mutual
      exclusion logic with the WQ_NON_REENTRANT flag.  One pieces of fallout is
      that the exponential backoff breaks in certain cases:
      
       * con_work attempts to connect.
       * we get an immediate failure, and the socket state change handler queues
         immediate work.
       * con_work calls con_fault, we decide to back off, but can't queue delayed
         work.
      
      In this case, we add a BACKOFF bit to make con_work reschedule delayed work
      next time it runs (which should be immediately).
      Signed-off-by: NSage Weil <sage@newdream.net>
      60bf8bf8
  2. 04 3月, 2011 1 次提交
    • S
      libceph: retry after authorization failure · 692d20f5
      Sage Weil 提交于
      If we mark the connection CLOSED we will give up trying to reconnect to
      this server instance.  That is appropriate for things like a protocol
      version mismatch that won't change until the server is restarted, at which
      point we'll get a new addr and reconnect.  An authorization failure like
      this is probably due to the server not properly rotating it's secret keys,
      however, and should be treated as transient so that the normal backoff and
      retry behavior kicks in.
      Signed-off-by: NSage Weil <sage@newdream.net>
      692d20f5
  3. 26 1月, 2011 2 次提交
    • S
      libceph: fix socket write error handling · 42961d23
      Sage Weil 提交于
      Pass errors from writing to the socket up the stack.  If we get -EAGAIN,
      return 0 from the helper to simplify the callers' checks.
      Signed-off-by: NSage Weil <sage@newdream.net>
      42961d23
    • S
      libceph: fix socket read error handling · 98bdb0aa
      Sage Weil 提交于
      If we get EAGAIN when trying to read from the socket, it is not an error.
      Return 0 from the helper in this case to simplify the error handling cases
      in the caller (indirectly, try_read).
      
      Fix try_read to pass any error to it's caller (con_work) instead of almost
      always returning 0.  This let's us respond to things like socket
      disconnects.
      Signed-off-by: NSage Weil <sage@newdream.net>
      98bdb0aa
  4. 13 1月, 2011 1 次提交
    • T
      net/ceph: make ceph_msgr_wq non-reentrant · f363e45f
      Tejun Heo 提交于
      ceph messenger code does a rather complex dancing around multithread
      workqueue to make sure the same work item isn't executed concurrently
      on different CPUs.  This restriction can be provided by workqueue with
      WQ_NON_REENTRANT.
      
      Make ceph_msgr_wq non-reentrant workqueue with the default concurrency
      level and remove the QUEUED/BUSY logic.
      
      * This removes backoff handling in con_work() but it couldn't reliably
        block execution of con_work() to begin with - queue_con() can be
        called after the work started but before BUSY is set.  It seems that
        it was an optimization for a rather cold path and can be safely
        removed.
      
      * The number of concurrent work items is bound by the number of
        connections and connetions are independent from each other.  With
        the default concurrency level, different connections will be
        executed independently.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Sage Weil <sage@newdream.net>
      Cc: ceph-devel@vger.kernel.org
      Signed-off-by: NSage Weil <sage@newdream.net>
      f363e45f
  5. 14 12月, 2010 1 次提交
  6. 10 11月, 2010 1 次提交
    • S
      ceph: explicitly specify page alignment in network messages · c5c6b19d
      Sage Weil 提交于
      The alignment used for reading data into or out of pages used to be taken
      from the data_off field in the message header.  This only worked as long
      as the page alignment matched the object offset, breaking direct io to
      non-page aligned offsets.
      
      Instead, explicitly specify the page alignment next to the page vector
      in the ceph_msg struct, and use that instead of the message header (which
      probably shouldn't be trusted).  The alloc_msg callback is responsible for
      filling in this field properly when it sets up the page vector.
      Signed-off-by: NSage Weil <sage@newdream.net>
      c5c6b19d
  7. 02 11月, 2010 1 次提交
    • S
      ceph: fix small seq message skipping · df9f86fa
      Sage Weil 提交于
      If the client gets out of sync with the server message sequence number, we
      normally skip low seq messages (ones we already received).  The skip code
      was also incrementing the expected seq, such that all subsequent messages
      also appeared old and got skipped, and an eventual timeout on the osd
      connection.  This resulted in some lagging requests and console messages
      like
      
      [233480.882885] ceph: skipping osd22 10.138.138.13:6804 seq 2016, expected 2017
      [233480.882919] ceph: skipping osd22 10.138.138.13:6804 seq 2017, expected 2018
      [233480.882963] ceph: skipping osd22 10.138.138.13:6804 seq 2018, expected 2019
      [233480.883488] ceph: skipping osd22 10.138.138.13:6804 seq 2019, expected 2020
      [233485.219558] ceph: skipping osd22 10.138.138.13:6804 seq 2020, expected 2021
      [233485.906595] ceph: skipping osd22 10.138.138.13:6804 seq 2021, expected 2022
      [233490.379536] ceph: skipping osd22 10.138.138.13:6804 seq 2022, expected 2023
      [233495.523260] ceph: skipping osd22 10.138.138.13:6804 seq 2023, expected 2024
      [233495.923194] ceph: skipping osd22 10.138.138.13:6804 seq 2024, expected 2025
      [233500.534614] ceph:  tid 6023602 timed out on osd22, will reset osd
      Reported-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NSage Weil <sage@newdream.net>
      df9f86fa
  8. 21 10月, 2010 2 次提交
    • Y
      ceph: factor out libceph from Ceph file system · 3d14c5d2
      Yehuda Sadeh 提交于
      This factors out protocol and low-level storage parts of ceph into a
      separate libceph module living in net/ceph and include/linux/ceph.  This
      is mostly a matter of moving files around.  However, a few key pieces
      of the interface change as well:
      
       - ceph_client becomes ceph_fs_client and ceph_client, where the latter
         captures the mon and osd clients, and the fs_client gets the mds client
         and file system specific pieces.
       - Mount option parsing and debugfs setup is correspondingly broken into
         two pieces.
       - The mon client gets a generic handler callback for otherwise unknown
         messages (mds map, in this case).
       - The basic supported/required feature bits can be expanded (and are by
         ceph_fs_client).
      
      No functional change, aside from some subtle error handling cases that got
      cleaned up in the refactoring process.
      Signed-off-by: NSage Weil <sage@newdream.net>
      3d14c5d2
    • Y
      ceph: messenger and osdc changes for rbd · 68b4476b
      Yehuda Sadeh 提交于
      Allow the messenger to send/receive data in a bio.  This is added
      so that we wouldn't need to copy the data into pages or some other buffer
      when doing IO for an rbd block device.
      
      We can now have trailing variable sized data for osd
      ops.  Also osd ops encoding is more modular.
      Signed-off-by: NYehuda Sadeh <yehuda@hq.newdream.net>
      Signed-off-by: NSage Weil <sage@newdream.net>
      68b4476b
  9. 04 8月, 2010 1 次提交
  10. 02 8月, 2010 2 次提交
  11. 10 7月, 2010 2 次提交
  12. 09 7月, 2010 1 次提交
  13. 06 7月, 2010 1 次提交
    • S
      ceph: fix message revocation · ed98adad
      Sage Weil 提交于
      A message can be on a queue (pending or sent), or out_msg (sending), or
      both.  We were assuming that if it's not on a queue it couldn't be out_msg,
      but that was false in the case of lossy connections like the OSD.  Fix
      ceph_con_revoke() to treat these cases independently.  Also, fix the
      out_kvec_is_message check to only trigger if we are currently sending
      _this_ message.
      
      This fixes a GPF in tcp_sendpage, triggered by OSD restarts.
      Signed-off-by: NSage Weil <sage@newdream.net>
      ed98adad
  14. 14 6月, 2010 2 次提交
  15. 30 5月, 2010 1 次提交
  16. 18 5月, 2010 9 次提交
  17. 12 5月, 2010 2 次提交
  18. 04 5月, 2010 2 次提交
  19. 14 4月, 2010 1 次提交
    • S
      ceph: use separate class for ceph sockets' sk_lock · a6a5349d
      Sage Weil 提交于
      Use a separate class for ceph sockets to prevent lockdep confusion.
      Because ceph sockets only get passed kernel pointers, there is no
      dependency from sk_lock -> mmap_sem.  If we share the same class as other
      sockets, lockdep detects a circular dependency from
      
      	mmap_sem (page fault) -> fs mutex -> sk_lock -> mmap_sem
      
      because dependencies are noted from both ceph and user contexts.  Using
      a separate class prevents the sk_lock(ceph) -> mmap_sem dependency and
      makes lockdep happy.
      Signed-off-by: NSage Weil <sage@newdream.net>
      a6a5349d
  20. 03 4月, 2010 1 次提交
  21. 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
  22. 23 3月, 2010 2 次提交
    • S
      ceph: avoid reopening osd connections when address hasn't changed · 87b315a5
      Sage Weil 提交于
      We get a fault callback on _every_ tcp connection fault.  Normally, we
      want to reopen the connection when that happens.  If the address we have
      is bad, however, and connection attempts always result in a connection
      refused or similar error, explicitly closing and reopening the msgr
      connection just prevents the messenger's backoff logic from kicking in.
      The result can be a console full of
      
      [ 3974.417106] ceph: osd11 10.3.14.138:6800 connection failed
      [ 3974.423295] ceph: osd11 10.3.14.138:6800 connection failed
      [ 3974.429709] ceph: osd11 10.3.14.138:6800 connection failed
      
      Instead, if we get a fault, and have outstanding requests, but the osd
      address hasn't changed and the connection never successfully connected in
      the first place, do nothing to the osd connection.  The messenger layer
      will back off and retry periodically, because we never connected and thus
      the lossy bit is not set.
      
      Instead, touch each request's r_stamp so that handle_timeout can tell the
      request is still alive and kicking.
      Signed-off-by: NSage Weil <sage@newdream.net>
      87b315a5
    • S
      ceph: fix connection fault con_work reentrancy problem · 3c3f2e32
      Sage Weil 提交于
      The messenger fault was clearing the BUSY bit, for reasons unclear.  This
      made it possible for the con->ops->fault function to reopen the connection,
      and requeue work in the workqueue--even though the current thread was
      already in con_work.
      
      This avoids a problem where the client busy loops with connection failures
      on an unreachable OSD, but doesn't address the root cause of that problem.
      Signed-off-by: NSage Weil <sage@newdream.net>
      3c3f2e32