1. 01 5月, 2007 1 次提交
  2. 08 3月, 2007 2 次提交
  3. 06 2月, 2007 10 次提交
    • S
      [GFS2] Put back semaphore to avoid umount problem · 61be084e
      Steven Whitehouse 提交于
      Dave Teigland fixed this bug a while back, but I managed to mistakenly
      remove the semaphore during later development. It is required to avoid
      the list of inodes changing during an invalidate_inodes call. I have
      made it an rwsem since the read side will be taken frequently during
      normal filesystem operation. The write site will only happen during
      umount of the file system.
      
      Also the bug only triggers when using the DLM lock manager and only then
      under certain conditions as its timing related.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: David Teigland <teigland@redhat.com>
      61be084e
    • S
      [GFS2] Fix typo in glock.c · d043e190
      Steven Whitehouse 提交于
      This is a one letter typo fix in glock.c, spotted by Rob Kenna.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d043e190
    • S
      [GFS2] Compile fix for glock.c · 90101c31
      Steven Whitehouse 提交于
      This one liner got missed from the previous patch.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      90101c31
    • S
      [GFS2] Remove queue_empty() function · 12132933
      Steven Whitehouse 提交于
      This function is not longer required since we do not do recursive
      locking in the glock layer. As a result all its callers can be
      replaceed with list_empty() calls.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      12132933
    • S
      [GFS2] Tidy up glops calls · b5d32bea
      Steven Whitehouse 提交于
      This patch doesn't make any changes to the ordering of the various
      operations related to glocking, but it does tidy up the calls to the
      glops.c functions to make the structure more obvious.
      
      The two functions: gfs2_glock_xmote_th() and gfs2_glock_drop_th() can be
      made static within glock.c since they are called by every set of glock
      operations. The xmote_th and drop_th glock operations are then made
      conditional upon those two routines existing and called from the
      previously mentioned functions in glock.c respectively.
      
      Also it can be seen that the go_sync operation isn't needed since it can
      easily be replaced by calls to xmote_bh and drop_bh respectively. This
      results in no longer (confusingly) calling back into routines in glock.c
      from glops.c and also reducing the glock operations by one member.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b5d32bea
    • S
      [GFS2] Remove local exclusive glock mode · 1c0f4872
      Steven Whitehouse 提交于
      Here is a patch for GFS2 to remove the local exclusive flag. In
      the places it was used, mutex's are always held earlier in the
      call path, so it appears redundant in the LM_ST_SHARED case.
      
      Also, the GFS2 holders were setting local exclusive in any case where
      the requested lock was LM_ST_EXCLUSIVE. So the other places in the glock
      code where the flag was tested have been replaced with tests for the
      lock state being LM_ST_EXCLUSIVE in order to ensure the logic is the
      same as before (i.e. LM_ST_EXCLUSIVE is always locally exclusive as well
      as globally exclusive).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1c0f4872
    • S
      [GFS2] Remove unused go_callback operation · 6bd9c8c2
      Steven Whitehouse 提交于
      This is never used, so we might as well remove it.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      6bd9c8c2
    • S
      [GFS2] Remove the "greedy" function from glock.[ch] · e5dab552
      Steven Whitehouse 提交于
      The "greedy" code was an attempt to retain glocks for a minimum length
      of time when they relate to mmap()ed files. The current implementation
      of this feature is not, however, ideal in that it required allocating
      memory in order to do this and its overly complicated.
      
      It also misses the mark by ignoring the other I/O operations which are
      just as likely to suffer from the same problem. So the plan is to remove
      this now and then add the functionality back as part of the glock state
      machine at a later date (and thus take into account all the possible
      users of this feature)
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      e5dab552
    • S
      [GFS2] Shrink gfs2_inode memory by half · fee852e3
      Steven Whitehouse 提交于
      Here is something I spotted (while looking for something entirely
      different) the other day.
      
      Rather than using a completion in each and every struct gfs2_holder,
      this removes it in favour of hashed wait queues, thus saving a
      considerable amount of memory both on the stack (where a number of
      gfs2_holder structures are allocated) and in particular in the
      gfs2_inode which has 8 gfs2_holder structures embedded within it.
      
      As a result on x86_64 the gfs2_inode shrinks from 2488 bytes to
      1912 bytes, a saving of 576 bytes per inode (no thats not a typo!).
      In actual practice we get a much better result than that since
      now that a gfs2_inode is under the 2048 byte barrier, we get two
      per 4k slab page effectively halving the amount of memory required
      to store gfs2_inodes.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      fee852e3
    • S
      [GFS2] Clean up/speed up readdir · 3699e3a4
      Steven Whitehouse 提交于
      This removes the extra filldir callback which gfs2 was using to
      enclose an attempt at readahead for inodes during readdir. The
      code was too complicated and also hurts performance badly in the
      case that the getdents64/readdir call isn't being followed by
      stat() and it wasn't even getting it right all the time when it
      was.
      
      As a result, on my test box an "ls" of a directory containing 250000
      files fell from about 7mins (freshly mounted, so nothing cached) to
      between about 15 to 25 seconds. When the directory content was cached,
      the time taken fell from about 3mins to about 4 or 5 seconds.
      
      Interestingly in the cached case, running "ls -l" once reduced the time
      taken for subsequent runs of "ls" to about 6 secs even without this
      patch. Now it turns out that there was a special case of glocks being
      used for prefetching the metadata, but because of the timeouts for these
      locks (set to 10 secs) the metadata was being timed out before it was
      being used and this the prefetch code was constantly trying to prefetch
      the same data over and over.
      
      Calling "ls -l" meant that the inodes were brought into memory and once
      the inodes are cached, the glocks are not disposed of until the inodes
      are pushed out of the cache, thus extending the lifetime of the glocks,
      and thus bringing down the time for subsequent runs of "ls"
      considerably.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3699e3a4
  4. 30 11月, 2006 6 次提交
  5. 22 11月, 2006 1 次提交
  6. 25 9月, 2006 1 次提交
  7. 19 9月, 2006 1 次提交
  8. 15 9月, 2006 1 次提交
  9. 13 9月, 2006 1 次提交
  10. 12 9月, 2006 2 次提交
    • S
      [GFS2] Use hlist for glock hash chains · b6397893
      Steven Whitehouse 提交于
      This results in smaller list heads, so that we can have more chains
      in the same amount of memory (twice as many). I've multiplied the
      size of the table by four though - this is because we are saving
      memory by not having one lock per chain any more. So we land up
      using about the same amount of memory for the hash table as we
      did before I started these changes, the difference being that we
      now have four times as many hash chains.
      
      The reason that I say "about the same amount of memory" is that the
      actual amount now depends upon the NR_CPUS and some of the config
      variables, so that its not exact and in some cases we do use more
      memory. Eventually we might want to scale the hash table size
      according to the size of physical ram as measured on module load.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b6397893
    • S
      [GFS2] Rewrite of examine_bucket() · 24264434
      Steven Whitehouse 提交于
      The existing implementation of this function in glock.c was not
      very efficient as it relied upon keeping a cursor element upon the
      hash chain in question and moving it along. This new version improves
      upon this by using the current element as a cursor. This is possible
      since we only look at the "next" element in the list after we've
      taken the read_lock() subsequent to calling the examiner function.
      Obviously we have to eventually drop the ref count that we are then
      left with and we cannot do that while holding the read_lock, so we
      do that next time we drop the lock. That means either just before
      we examine another glock, or when the loop has terminated.
      
      The new implementation has several advantages: it uses only a
      read_lock() rather than a write_lock(), so it can run simnultaneously
      with other code, it doesn't need a "plug" element, so that it removes
      a test not only from this list iterator, but from all the other glock
      list iterators too. So it makes things faster and smaller.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      24264434
  11. 10 9月, 2006 3 次提交
  12. 09 9月, 2006 1 次提交
    • S
      [GFS2] Move rwlocks in glock.c into their own array · 37b2fa6a
      Steven Whitehouse 提交于
      This splits the rwlocks guarding the hash chains of the glock hash
      table into their own array. This will reduce memory usage in some
      cases due to better alignment, although the real reason for doing it
      is to allow the two tables to be different sizes in future (i.e.
      the locks will be sized proportionally with the max number of CPUs
      and the hash chains sized proportinally with the size of physical memory)
      
      In order to allow this, the gl_bucket member of struct gfs2_glock has
      now become gl_hash, so we record the hash rather than a pointer to the
      bucket itself.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      37b2fa6a
  13. 08 9月, 2006 4 次提交
  14. 05 9月, 2006 2 次提交
  15. 04 9月, 2006 1 次提交
  16. 01 9月, 2006 1 次提交
    • S
      [GFS2] Update copyright, tidy up incore.h · e9fc2aa0
      Steven Whitehouse 提交于
      As per comments from Jan Engelhardt <jengelh@linux01.gwdg.de> this
      updates the copyright message to say "version" in full rather than
      "v.2". Also incore.h has been updated to remove forward structure
      declarations which are not required.
      
      The gfs2_quota_lvb structure has now had endianess annotations added
      to it. Also quota.c has been updated so that we now store the
      lvb data locally in endian independant format to avoid needing
      a structure in host endianess too. As a result the endianess
      conversions are done as required at various points and thus the
      conversion routines in lvb.[ch] are no longer required. I've
      moved the one remaining constant in lvb.h thats used into lm.h
      and removed the unused lvb.[ch].
      
      I have not changed the HIF_ constants. That is left to a later patch
      which I hope will unify the gh_flags and gh_iflags fields of the
      struct gfs2_holder.
      
      Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      e9fc2aa0
  17. 31 8月, 2006 1 次提交
  18. 30 8月, 2006 1 次提交