1. 27 6月, 2008 3 次提交
    • S
      [GFS2] Remove remote lock dropping code · 1bdad606
      Steven Whitehouse 提交于
      There are several reasons why this is undesirable:
      
       1. It never happens during normal operation anyway
       2. If it does happen it causes performance to be very, very poor
       3. It isn't likely to solve the original problem (memory shortage
          on remote DLM node) it was supposed to solve
       4. It uses a bunch of arbitrary constants which are unlikely to be
          correct for any particular situation and for which the tuning seems
          to be a black art.
       5. In an N node cluster, only 1/N of the dropped locked will actually
          contribute to solving the problem on average.
      
      So all in all we are better off without it. This also makes merging
      the lock_dlm module into GFS2 a bit easier.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1bdad606
    • S
      [GFS2] No lock_nolock · 048bca22
      Steven Whitehouse 提交于
      This patch merges the lock_nolock module into GFS2 itself. As well as removing
      some of the overhead of the module, it also means that its now impossible to
      build GFS2 without a lock module (which would be a pointless thing to do
      anyway).
      
      We also plan to merge lock_dlm into GFS2 in the future, but that is a more
      tricky task, and will therefore be a separate patch.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: David Teigland <teigland@redhat.com>
      048bca22
    • S
      [GFS2] Clean up the glock core · 6802e340
      Steven Whitehouse 提交于
      This patch implements a number of cleanups to the core of the
      GFS2 glock code. As a result a lot of code is removed. It looks
      like a really big change, but actually a large part of this patch
      is either removing or moving existing code.
      
      There are some new bits too though, such as the new run_queue()
      function which is considerably streamlined. Highlights of this
      patch include:
      
       o Fixes a cluster coherency bug during SH -> EX lock conversions
       o Removes the "glmutex" code in favour of a single bit lock
       o Removes the ->go_xmote_bh() for inodes since it was duplicating
         ->go_lock()
       o We now only use the ->lm_lock() function for both locks and
         unlocks (i.e. unlock is a lock with target mode LM_ST_UNLOCKED)
       o The fast path is considerably shortly, giving performance gains
         especially with lock_nolock
       o The glock_workqueue is now used for all the callbacks from the DLM
         which allows us to simplify the lock_dlm module (see following patch)
       o The way is now open to make further changes such as eliminating the two
         threads (gfs2_glockd and gfs2_scand) in favour of a more efficient
         scheme.
      
      This patch has undergone extensive testing with various test suites
      so it should be pretty stable by now.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Bob Peterson <rpeterso@redhat.com>
      6802e340
  2. 31 3月, 2008 8 次提交
  3. 08 2月, 2008 2 次提交
  4. 25 1月, 2008 7 次提交
    • B
      [GFS2] Reorganize function gfs2_glmutex_lock · 398bbe68
      Bob Peterson 提交于
      This patch optimizes the function gfs2_glmutex_lock.
      The basic theory is: Why bother initializing a holder, setting up
      wait bits and then waiting on them, if you know the glock can be
      yours.  So the holder stuff is placed inside the if checking if the
      glock is locked.  This one needs careful scrutiny because changing
      anything to do with locking should strike terror into one's heart.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      398bbe68
    • F
      [GFS2] Fix runtime issue with UP kernels · 1a2781cf
      Fabio Massimo Di Nitto 提交于
      The issue is indeed UP vs SMP and it is totally random.
      
      spin_is_locked() is a bad assertion because there is no correct answer on UP.
      on UP spin_is_locked() has to return either one value or another, always.
      
      This means that in my setup I am lucky enough to trigger the issue and your you
      are lucky enough not to.
      
      the patch in attachment removes the bogus calls to BUG_ON and according to David
      (in CC and thanks for the long explanation on the problem) we can rely upon
      things like lockdep to find problem that might be trying to catch.
      Signed-off-by: NFabio M. Di Nitto <fabbione@ubuntu.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1a2781cf
    • S
      [GFS2] Don't add glocks to the journal · 2bcd610d
      Steven Whitehouse 提交于
      The only reason for adding glocks to the journal was to keep track
      of which locks required a log flush prior to release. We add a
      flag to the glock to allow this check to be made in a simpler way.
      
      This reduces the size of a glock (by 12 bytes on i386, 24 on x86_64)
      and means that we can avoid extra work during the journal flush.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      2bcd610d
    • S
      [GFS2] Remove flags no longer required · e589665e
      Steven Whitehouse 提交于
      The HIF_MUTEX and HIF_PROMOTE flags were set on the glock holders
      depending upon which of the two waiters lists they were going to
      be queued upon. They were then tested when the holders were taken
      off the lists to ensure that the right type of holder was being
      dequeued.
      
      Since we are already using separate lists, there doesn't seem a
      lot of point having these flags as well, and since setting them
      and testing them is in the fast path for locking and unlocking
      glock, this patch removes them.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      e589665e
    • S
      [GFS2] Reorder writeback for glock sync · 3042a2cc
      Steven Whitehouse 提交于
      Previously we were doing (write data, wait for data, write metadata, wait
      for metadata). After this patch we so (write metadata, write data, wait for
      data, wait for metadata) which should be more efficient.
      
      Also I noticed that the drop_bh and xmote_bh functions were almost
      identical. In fact the only difference was a single test, and that
      test is such that in the drop_bh case, it would always evaluate to
      the correct result. As such we can use the xmote_bh functions in
      all the places where we were using the drop_bh function and remove
      the drop_bh functions.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3042a2cc
    • S
      [GFS2] Remove "reclaim limit" · c2932e03
      Steven Whitehouse 提交于
      This call to reclaim glocks is not needed, and in particular we don't want it
      in the fast path for locking glocks. The limit was entirely arbitrary anyway
      and we can't expect users to adjust things like this, the remaining code will
      do the right thing on its own.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c2932e03
    • W
      [GFS2] Handle multiple glock demote requests · cc7e79b1
      Wendy Cheng 提交于
      Fix a race condition where multiple glock demote requests are sent to
      a node back-to-back. This patch does a check inside handle_callback()
      to see whether a demote request is in progress. If true, it sets a flag
      to make sure run_queue() will loop again to handle the new request,
      instead of erronously setting gl_demote_state to a different state.
      Signed-off-by: NS. Wendy Cheng <wcheng@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      cc7e79b1
  5. 10 10月, 2007 10 次提交
  6. 09 7月, 2007 4 次提交
    • S
      [GFS2] Simplify multiple glock aquisition · eaf5bd3c
      Steven Whitehouse 提交于
      There is a bug in the code which acquires multiple glocks where if the
      initial out-of-order attempt fails part way though we can land up trying
      to acquire the wrong number of glocks. This is part of the fix for red
      hat bz #239737. The other part of the bz doesn't apply to upstream
      kernels since it was fixed by:
      
      http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=d3717bdf8f08a0e1039158c8bab2c24d20f492b6
      
      Since the out-of-order code doesn't appear to add anything to the
      performance of GFS2, this patch just removed it rather than trying to
      fix it. It should be much easier to see whats going on here now. In
      addition, we don't allocate any memory unless we are using a lot of
      glocks (which is a relatively uncommon case).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      eaf5bd3c
    • A
      [GFS2] Fix deallocation issues · d93cfa98
      Abhijith Das 提交于
      There were two issues during deallocation of unlinked inodes. The
      first was relating to the use of a "try" lock which in the case of
      the inode lock wasn't trying hard enough to deallocate in all
      circumstances (now changed to a normal glock) and in the case of
      the iopen lock didn't wait for the demotion of the shared lock before
      attempting to get the exclusive lock, and thereby sometimes (timing dependent)
      not completing the deallocation when it should have done.
      
      The second issue related to the lack of a way to invalidate dcache entries
      on remote nodes (now fixed by this patch) which meant that unlinks were
      taking a long time to return disk space to the fs. By adding some code to
      invalidate the dcache entries across the cluster for unlinked inodes, that
      is now fixed.
      
      This patch was written jointly by Abhijith Das and Steven Whitehouse.
      Signed-off-by: NAbhijith Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d93cfa98
    • S
      [GFS2] Clean up inode number handling · dbb7cae2
      Steven Whitehouse 提交于
      This patch cleans up the inode number handling code. The main difference
      is that instead of looking up the inodes using a struct gfs2_inum_host
      we now use just the no_addr member of this structure. The tests relating
      to no_formal_ino can then be done by the calling code. This has
      advantages in that we want to do different things in different code
      paths if the no_formal_ino doesn't match. In the NFS patch we want to
      return -ESTALE, but in the ->lookup() path, its a bug in the fs if the
      no_formal_ino doesn't match and thus we can withdraw in this case.
      
      In order to later fix bz #201012, we need to be able to look up an inode
      without knowing no_formal_ino, as the only information that is known to
      us is the on-disk location of the inode in question.
      
      This patch will also help us to fix bz #236099 at a later date by
      cleaning up a lot of the code in that area.
      
      There are no user visible changes as a result of this patch and there
      are no changes to the on-disk format either.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      dbb7cae2
    • R
      [GFS2] Addendum patch 2 for gfs2_grow · cd81a4ba
      Robert Peterson 提交于
      This addendum patch 2 corrects three things:
      
      1. It fixes a stupid mistake in the previous addendum that broke gfs2.
         Ref: https://www.redhat.com/archives/cluster-devel/2007-May/msg00162.html
      2. It fixes a problem that Dave Teigland pointed out regarding the
         external declarations in ops_address.h being in the wrong place.
      3. It recasts a couple more %llu printks to (unsigned long long)
         as requested by Steve Whitehouse.
      
      I would have loved to put this all in one revised patch, but there was
      a rush to get some patches for RHEL5.	Therefore, the previous patches
      were applied to the git tree "as is" and therefore, I'm posting another
      addendum.  Sorry.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      cd81a4ba
  7. 01 5月, 2007 6 次提交
    • S
      [GFS2] Uncomment sprintf_symbol calling code · 37fde8ca
      Steven Whitehouse 提交于
      Now that the patch from -mm has gone upstream, we can uncomment the code
      in GFS2 which uses sprintf_symbol.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Robert Peterson <rpeterso@redhat.com>
      37fde8ca
    • R
      [GFS2] lockdump improvements · 5f882096
      Robert Peterson 提交于
      The patch below consists of the following changes (in code order):
      
      1. I fixed a minor compiler warning regarding the printing of
         a kernel symbol address.
      2. I implemented a suggestion from Dave Teigland that moves
         the debugfs information for gfs2 into a subdirectory so
         we can easily expand our use of debugfs in the future.
         The current code keeps the glock information in:
         /debug/gfs2/<fs>
         With the patch, the new code keeps the glock information in:
         /debug/gfs2/<fs>/glock
         That will allow us to create more debugfs files in the future.
      3. This fixes a bug whereby a failed mount attempt causes the
         debugfs file to not be deleted.  Failed mount attempts should
         always clean up after themselves, including deleting the
         debugfs file and/or directory.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      5f882096
    • R
      [GFS2] bz 236008: Kernel gpf doing cat /debugfs/gfs2/xxx (lock dump) · 7a0079d9
      Robert Peterson 提交于
      This is for Bugzilla Bug 236008: Kernel gpf doing cat /debugfs/gfs2/xxx
      (lock dump) seen at the "gfs2 summit".  This also fixes the bug that caused
      garbage to be printed by the "initialized at" field.  I apologize for the
      kludge, but that code will all be ripped out anyway when the official
      sprint_symbol function becomes available in the Linux kernel.  I also
      changed some formatting so that spaces are replaced by proper tabs.
      Signed-off-by: NRobert Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      7a0079d9
    • R
      [GFS2] Red Hat bz 228540: owner references · 04b933f2
      Robert Peterson 提交于
      In Testing the previously posted and accepted patch for
      https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228540
      I uncovered some gfs2 badness.  It turns out that the current
      gfs2 code saves off a process pointer when glocks is taken
      in both the glock and glock holder structures.  Those
      structures will persist in memory long after the process has
      ended; pointers to poisoned memory.
      
      This problem isn't caused by the 228540 fix; the new capability
      introduced by the fix just uncovered the problem.
      
      I wrote this patch that avoids saving process pointers
      and instead saves off the process pid.  Rather than
      referencing the bad pointers, it now does process lookups.
      There is special code that makes the output nicer for
      printing holder information for processes that have ended.
      
      This patch also adds a stub for the new "sprint_symbol"
      function that exists in Andrew Morton's -mm patch set, but
      won't go into the base kernel until 2.6.22, since it adds
      functionality but doesn't fix a bug.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      04b933f2
    • S
      [GFS2] Fix a bug on i386 due to evaluation order · 420d2a10
      Steven Whitehouse 提交于
      Since gcc didn't evaluate the last two terms of the expression in
      glock.c:1881 as a constant expression, it resulted in an error on
      i386 due to the lack of a 64bit divide instruction. This adds some
      brackets to fix the problem.
      
      This was reported by Andrew Morton.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      420d2a10
    • S
      [GFS2] Fix bz 224480 and cleanup glock demotion code · 3b8249f6
      Steven Whitehouse 提交于
      This patch prevents the printing of a warning message in cases where
      the fs is functioning normally by handing off responsibility for
      unlinked, but still open inodes, to another node for eventual deallocation.
      Also, there is now an improved system for ensuring that such requests
      to other nodes do not get lost. The callback on the iopen lock is
      only ever called when i_nlink == 0 and when a node is unable to deallocate
      it due to it still being in use on another node. When a node receives
      the callback therefore, it knows that i_nlink must be zero, so we mark
      it as such (in gfs2_drop_inode) in order that it will then attempt
      deallocation of the inode itself.
      
      As an additional benefit, queuing a demote request no longer requires
      a memory allocation. This simplifies the code for dealing with gfs2_holders
      as it removes one special case.
      
      There are two new fields in struct gfs2_glock. gl_demote_state is the
      state which the remote node has requested and gl_demote_time is the
      time when the request came in. Both fields are only valid when the
      GLF_DEMOTE flag is set in gl_flags.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3b8249f6