1. 06 2月, 2007 1 次提交
    • 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
  2. 30 11月, 2006 6 次提交
  3. 22 11月, 2006 1 次提交
  4. 25 9月, 2006 1 次提交
  5. 19 9月, 2006 1 次提交
  6. 15 9月, 2006 1 次提交
  7. 13 9月, 2006 1 次提交
  8. 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
  9. 10 9月, 2006 3 次提交
  10. 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
  11. 08 9月, 2006 4 次提交
  12. 05 9月, 2006 2 次提交
  13. 04 9月, 2006 1 次提交
  14. 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
  15. 31 8月, 2006 1 次提交
  16. 30 8月, 2006 4 次提交
  17. 26 8月, 2006 1 次提交
  18. 25 8月, 2006 1 次提交
    • S
      [GFS2] Speed up scanning of glocks · a2242db0
      Steven Whitehouse 提交于
      I noticed the gfs2_scand seemed to be taking a lot of CPU,
      so in order to cut that down a bit, here is a patch. Firstly
      the type of a glock is a constant during its lifetime, so that
      its possible to check this without needing locking. I've moved
      the (common) case of testing for an inode glock outside of
      the glmutex lock.
      
      Also there was a mutex left over from when the glock cache was
      master of the inode cache. That isn't required any more so I've
      removed that too.
      
      There is probably scope for further speed ups in the future
      in this area.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      a2242db0
  19. 11 8月, 2006 1 次提交
  20. 29 7月, 2006 1 次提交
  21. 28 7月, 2006 1 次提交
    • S
      [GFS2] Use a bio to read the superblock · f45b7ddd
      Steven Whitehouse 提交于
      This means that we don't need to create a special inode just to contain
      a struct address_space in order to read a single disk block. Instead
      we read the disk block directly. Its slightly faster, and uses slightly
      less memory, but the real reason for doing this is that it removes a
      special case from the glock code.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      f45b7ddd
  22. 07 7月, 2006 1 次提交
  23. 06 7月, 2006 1 次提交
  24. 25 6月, 2006 1 次提交
  25. 15 6月, 2006 1 次提交
    • S
      [GFS2] Fix unlinked file handling · feaa7bba
      Steven Whitehouse 提交于
      This patch fixes the way we have been dealing with unlinked,
      but still open files. It removes all limits (other than memory
      for inodes, as per every other filesystem) on numbers of these
      which we can support on GFS2. It also means that (like other
      fs) its the responsibility of the last process to close the file
      to deallocate the storage, rather than the person who did the
      unlinking. Note that with GFS2, those two events might take place
      on different nodes.
      
      Also there are a number of other changes:
      
       o We use the Linux inode subsystem as it was intended to be
      used, wrt allocating GFS2 inodes
       o The Linux inode cache is now the point which we use for
      local enforcement of only holding one copy of the inode in
      core at once (previous to this we used the glock layer).
       o We no longer use the unlinked "special" file. We just ignore it
      completely. This makes unlinking more efficient.
       o We now use the 4th block allocation state. The previously unused
      state is used to track unlinked but still open inodes.
       o gfs2_inoded is no longer needed
       o Several fields are now no longer needed (and removed) from the in
      core struct gfs2_inode
       o Several fields are no longer needed (and removed) from the in core
      superblock
      
      There are a number of future possible optimisations and clean ups
      which have been made possible by this patch.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      feaa7bba