Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librbd: correct issues discovered via lockdep / helgrind #5296

Merged
30 commits merged into from Aug 30, 2015
Merged

Commits on Jul 28, 2015

  1. WorkQueue: ContextWQ can now accept a return code

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit e5ffae5)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    64425e8 View commit details
    Browse the repository at this point in the history
  2. librbd: add work queue for op completions

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 21f990e)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    6d3db5f View commit details
    Browse the repository at this point in the history
  3. common: add valgrind.h convenience wrapper

    Conditionally support helgrind annotations if valgrind support is
    enabled during the build.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 650ad32)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    7b85c7b View commit details
    Browse the repository at this point in the history
  4. common: lockdep now support unregistering once destructed

    librbd use of an image hierarchy resulted in lock names being
    re-used and incorrectly analyzed.  librbd now uses unique lock
    names per instance, but to prevent an unbounded growth of
    tracked locks, we now remove lock tracking once a lock is
    destructed.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 7c7df2c)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    2fa35b1 View commit details
    Browse the repository at this point in the history
  5. librados_test_stub: add support for flushing watches

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 6e400b9)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    b73e87e View commit details
    Browse the repository at this point in the history
  6. librados_test_stub: fix helgrind warnings

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit b65ae4b)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    a5203d3 View commit details
    Browse the repository at this point in the history
  7. log: fix helgrind warnings regarding possible data race

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit c1e1445)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    58b8faf View commit details
    Browse the repository at this point in the history
  8. librbd: require callers to ObjectMap::aio_update to acquire lock

    This is needed to allow an atomic compare and update operation
    from the rebuild object map utility.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 2db758c)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    65ef695 View commit details
    Browse the repository at this point in the history
  9. librbd: complete cache read in a new thread context

    The ObjectCacher complete the read callback while still holding
    the cache lock.  This introduces lock ordering issues which are
    resolved by queuing the completion to execute in a clean (unlocked)
    context.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 0024677)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    7004149 View commit details
    Browse the repository at this point in the history
  10. librbd: give locks unique names to prevent false lockdep failures

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit c474ee4)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    6fdd3f1 View commit details
    Browse the repository at this point in the history
  11. librbd: AioCompletion shouldn't hold its lock during callback

    The callback routine most likely will attempt to retrieve the result
    code, which will result in a recursive lock attempt.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 3ad19ae)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    b38da48 View commit details
    Browse the repository at this point in the history
  12. librbd: disable lockdep on AioCompletion

    It is only used by clients and it causes a large slowdown
    in performance due to the rate at which the lock is constructed/
    destructed for each IO request.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 66e7464)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    8e280f4 View commit details
    Browse the repository at this point in the history
  13. librbd: add AsyncRequest task enqueue helper method

    In order to support the invariant that all state machine
    callbacks occur without holding locks, transitions that
    don't always involve a librados call should queue their
    callback.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 218bc2d)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    571220d View commit details
    Browse the repository at this point in the history
  14. librbd: execute flush completion outside of cache_lock

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 5f157f2)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    26902b9 View commit details
    Browse the repository at this point in the history
  15. librbd: AsyncObjectThrottle should always hold owner_lock

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit c352bcd)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    9249ab7 View commit details
    Browse the repository at this point in the history
  16. librbd: add object state accessor to ObjectMap

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    cb57fe5 View commit details
    Browse the repository at this point in the history
  17. librbd/AioRequest.h: fix UNINIT_CTOR

    Fix for:
    
    CID 1274319: Uninitialized scalar field (UNINIT_CTOR)
     uninit_member: Non-static class member m_object_state is not
     initialized in this constructor nor in any functions that it calls.
    
    Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
    (cherry picked from commit 48f18ea)
    dalgaaf authored and Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    3e71a75 View commit details
    Browse the repository at this point in the history
  18. librbd: simplify AioRequest constructor parameters

    Moved all parent overlap computation to within AioRequest so that
    callers don't need to independently compute the overlap.  Also
    removed the need to pass the snap_id for write operations since
    it can only be CEPH_NOSNAP.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 4651597)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    2ee64a8 View commit details
    Browse the repository at this point in the history
  19. librbd: move copyup class method call to CopyupRequest

    Move AbstractWrite's invocation of copyup to the CopyupRequest
    class.  The AioRequest write path will now always create a
    CopyupRequest, which will now append the actual write ops to the
    copyup.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 7be3df6)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    3e0358e View commit details
    Browse the repository at this point in the history
  20. librbd: ObjectMap::aio_update can acquire snap_lock out-of-order

    Detected during an fsx run where a refresh and CoR were occurring
    concurrently.  The refresh held the snap_lock and was waiting on
    the object_map_lock, while the CoR held object_map_lock and was
    waiting for snap_lock.
    
    Fixes: #11577
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 8cbd92b)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    9454f04 View commit details
    Browse the repository at this point in the history
  21. librbd: simplify state machine handling of exclusive lock

    It is expected that all IO is flushed and all async ops are cancelled
    prior to releasing the exclusive lock.  Therefore, replace handling of
    lost exclusive locks in state machines with an assertion.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit d6b733d)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    acf5125 View commit details
    Browse the repository at this point in the history
  22. librbd: fix recursive locking issues

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 1b57cc1)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    506a45a View commit details
    Browse the repository at this point in the history
  23. osdc: ObjectCacher flusher might needs additional locks

    librbd requires the ObjectCacher flusher thread to acquire
    an additional lock in order to maintain lock ordering
    constraints.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit a38f9e5)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    1e84fb0 View commit details
    Browse the repository at this point in the history
  24. librbd: owner_lock should be held during flush request

    Flush might result in the cache writing out dirty objects, which
    would require that the owner_lock be held.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit c9142fe)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    bfe5b90 View commit details
    Browse the repository at this point in the history
  25. tests: enable lockdep for librbd unit tests

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 45cb9cb)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    321eb8d View commit details
    Browse the repository at this point in the history
  26. tests: fix possible deadlock in librbd ImageWatcher tests

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 742a85d)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    a88b180 View commit details
    Browse the repository at this point in the history
  27. librbd: flush pending ops while not holding lock

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 3d5cef3)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    88b583b View commit details
    Browse the repository at this point in the history
  28. librbd: avoid infinite loop if copyup fails

    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 43e0e3c)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    5b39983 View commit details
    Browse the repository at this point in the history
  29. librbd: flush operations need to acquire owner lock

    Cache writeback operations will expect the owner lock to be held.
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit adfa2e0)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    27f7042 View commit details
    Browse the repository at this point in the history
  30. lockdep: do not automatically collect all backtraces

    It is expensive to collect backtraces every time a lock is
    checked in order to provide cycle backtraces.  The backtraces
    can be forced on for specific locks or globally via the new
    config option "lockdep_force_backtrace".
    
    Signed-off-by: Jason Dillaman <dillaman@redhat.com>
    (cherry picked from commit 7354d25)
    Jason Dillaman committed Jul 28, 2015
    Copy the full SHA
    e971820 View commit details
    Browse the repository at this point in the history