1. 14 7月, 2011 1 次提交
    • S
      GFS2: Resolve inode eviction and ail list interaction bug · 380f7c65
      Steven Whitehouse 提交于
      This patch contains a few misc fixes which resolve a recently
      reported issue. This patch has been a real team effort and has
      received a lot of testing.
      
      The first issue is that the ail lock needs to be held over a few
      more operations. The lock thats added into gfs2_releasepage() may
      possibly be a candidate for replacing with RCU at some future
      point, but at this stage we've gone for the obvious fix.
      
      The second issue is that gfs2_write_inode() can end up calling
      a glock recursively when called from gfs2_evict_inode() via the
      syncing code, so it needs a guard added.
      
      The third issue is that we either need to not truncate the metadata
      pages of inodes which have zero link count, but which we cannot
      deallocate due to them still being in use by other nodes, or we need
      to ensure that those pages have all made it through the journal and
      ail lists first. This patch takes the former approach, but the
      latter has also been tested and there is nothing to choose between
      them performance-wise. So again, we could revise that decision
      in the future.
      
      Also, the inode eviction process is now better documented.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Tested-by: NBob Peterson <rpeterso@redhat.com>
      Tested-by: NAbhijith Das <adas@redhat.com>
      Reported-by: NBarry J. Marson <bmarson@redhat.com>
      Reported-by: NDavid Teigland <teigland@redhat.com>
      380f7c65
  2. 09 5月, 2011 2 次提交
  3. 20 4月, 2011 4 次提交
    • S
      GFS2: Make writeback more responsive to system conditions · 4667a0ec
      Steven Whitehouse 提交于
      This patch adds writeback_control to writing back the AIL
      list. This means that we can then take advantage of the
      information we get in ->write_inode() in order to set off
      some pre-emptive writeback.
      
      In addition, the AIL code is cleaned up a bit to make it
      a bit simpler to understand.
      
      There is still more which can usefully be done in this area,
      but this is a good start at least.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      4667a0ec
    • S
      GFS2: Optimise glock lru and end of life inodes · f42ab085
      Steven Whitehouse 提交于
      The GLF_LRU flag introduced in the previous patch can be
      used to check if a glock is on the lru list when a new
      holder is queued and if so remove it, without having first
      to get the lru_lock.
      
      The main purpose of this patch however is to optimise the
      glocks left over when an inode at end of life is being
      evicted. Previously such glocks were left with the GLF_LFLUSH
      flag set, so that when reclaimed, each one required a log flush.
      This patch resets the GLF_LFLUSH flag when there is nothing
      left to flush thus preventing later log flushes as glocks are
      reused or demoted.
      
      In order to do this, we need to keep track of the number of
      revokes which are outstanding, and also to clear the GLF_LFLUSH
      bit after a log commit when only revokes have been processed.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      f42ab085
    • S
      GFS2: Alter point of entry to glock lru list for glocks with an address_space · 29687a2a
      Steven Whitehouse 提交于
      Rather than allowing the glocks to be scheduled for possible
      reclaim as soon as they have exited the journal, this patch
      delays their entry to the list until the glocks in question
      are no longer in use.
      
      This means that we will rely on the vm for writeback of all
      dirty data and metadata from now on. When glocks are added
      to the lru list they should be freeable much faster since all
      the I/O required to free them should have already been completed.
      
      This should lead to much better I/O patterns under low memory
      conditions.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      29687a2a
    • S
      GFS2: Make ->write_inode() really write · 1027efaa
      Steven Whitehouse 提交于
      The GFS2 ->write_inode function should be more aggressive at writing
      back to the filesystem. This adopts the XFS system of returning
      -EAGAIN when the writeback has not been completely done. Also, we
      now kick off in-place writeback when called with WB_SYNC_NONE,
      but we only wait for it and flush the log when WB_SYNC_ALL is
      requested.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1027efaa
  4. 18 4月, 2011 2 次提交
  5. 31 3月, 2011 1 次提交
  6. 18 1月, 2011 1 次提交
    • B
      GFS2: remove iopen glocks from cache on failed deletes · 23c30108
      Benjamin Marzinski 提交于
      When a file gets deleted on GFS2, if a node can't get an exclusive lock on the
      file's iopen glock, it punts on actually freeing up the space, because another
      node is using the file.  When it does this, it needs to drop the iopen glock
      from its cache so that the other node can get an exclusive lock on it. Now,
      gfs2_delete_inode() sets GL_NOCACHE before dropping the shared lock on the
      iopen glock in preparation for grabbing it in the exclusive state.  Since the
      node needs the glock in the exclusive state, dropping the shared lock from the
      cache doesn't slow down the case where no other nodes are using the file.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      23c30108
  7. 07 1月, 2011 1 次提交
    • N
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin 提交于
      RCU free the struct inode. This will allow:
      
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fa0d7e3d
  8. 26 10月, 2010 1 次提交
    • A
      gfs2: invalidate_inodes() is no-op there · 9dcefee5
      Al Viro 提交于
      In fill_super() we hadn't MS_ACTIVE set yet, so there won't
      be any inodes with zero i_count sitting around.
      
      In put_super() we already have MS_ACTIVE removed *and* we
      had called invalidate_inodes() since then.  So again there
      won't be any inodes with zero i_count...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9dcefee5
  9. 29 9月, 2010 1 次提交
  10. 24 9月, 2010 1 次提交
  11. 23 9月, 2010 2 次提交
    • S
      GFS2: Remove localcaching mount option · c2048b00
      Steven Whitehouse 提交于
      This option defaulted to on for lock_nolock mounts and off
      otherwise. The only function was to avoid the revalidation of
      dentries. In the cluster case, that is entirely pointless and
      liable to cause coherency problems.
      
      The patch changes the revalidation to depend upon whether the
      fs is a local or cluster fs (i.e. it follows the existing default
      behaviour). I very much doubt anybody ever used this option as
      there is no reason to. Even so we will continue to accept it
      on the mount command line, but ignore it.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c2048b00
    • S
      GFS2: Remove ignore_local_fs mount argument · f57a024e
      Steven Whitehouse 提交于
      This is been a no-op for a very long time now. I'm pretty sure
      nobody uses it, but just in case we'll still accept it on the
      command line, but ignore it.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      f57a024e
  12. 20 9月, 2010 1 次提交
  13. 10 8月, 2010 2 次提交
  14. 29 7月, 2010 1 次提交
  15. 06 5月, 2010 1 次提交
    • S
      GFS2: Add some useful messages · 913a71d2
      Steven Whitehouse 提交于
      The following patch adds a message to indicate when barriers have been
      disabled due to a block device which doesn't support them. You could
      already tell this via the mount options in /proc/mounts, but all the
      other filesystems also log a message at the same time.
      
      Also, the same mechanisms are used to indicate when the lock
      demote interface has been used (only ever used for debugging)
      which is a request from our support team.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      913a71d2
  16. 05 5月, 2010 1 次提交
    • B
      GFS2: Various gfs2_logd improvements · 5e687eac
      Benjamin Marzinski 提交于
      This patch contains various tweaks to how log flushes and active item writeback
      work. gfs2_logd is now managed by a waitqueue, and gfs2_log_reseve now waits
      for gfs2_logd to do the log flushing.  Multiple functions were rewritten to
      remove the need to call gfs2_log_lock(). Instead of using one test to see if
      gfs2_logd had work to do, there are now seperate tests to check if there
      are two many buffers in the incore log or if there are two many items on the
      active items list.
      
      This patch is a port of a patch Steve Whitehouse wrote about a year ago, with
      some minor changes.  Since gfs2_ail1_start always submits all the active items,
      it no longer needs to keep track of the first ai submitted, so this has been
      removed. In gfs2_log_reserve(), the order of the calls to
      prepare_to_wait_exclusive() and wake_up() when firing off the logd thread has
      been switched.  If it called wake_up first there was a small window for a race,
      where logd could run and return before gfs2_log_reserve was ready to get woken
      up. If gfs2_logd ran, but did not free up enough blocks, gfs2_log_reserve()
      would be left waiting for gfs2_logd to eventualy run because it timed out.
      Finally, gt_logd_secs, which controls how long to wait before gfs2_logd times
      out, and flushes the log, can now be set on mount with ar_commit.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      5e687eac
  17. 06 3月, 2010 1 次提交
  18. 05 3月, 2010 1 次提交
    • C
      quota: move code from sync_quota_sb into vfs_quota_sync · 5fb324ad
      Christoph Hellwig 提交于
      Currenly sync_quota_sb does a lot of sync and truncate action that only
      applies to "VFS" style quotas and is actively harmful for the sync
      performance in XFS.  Move it into vfs_quota_sync and add a wait parameter
      to ->quota_sync to tell if we need it or not.
      
      My audit of the GFS2 code says it's also not needed given the way GFS2
      implements quotas, but I'd be happy if this can get a detailed review.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5fb324ad
  19. 01 3月, 2010 2 次提交
    • S
      GFS2: Remove loopy umount code · c1184f8a
      Steven Whitehouse 提交于
      As a consequence of the previous patch, we can now remove the
      loop which used to be required due to the circular dependency
      between the inodes and glocks. Instead we can just invalidate
      the inodes, and then clear up any glocks which are left.
      
      Also we no longer need the rwsem since there is no longer any
      danger of the inode invalidation calling back into the glock
      code (and from there back into the inode code).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c1184f8a
    • S
      GFS2: Metadata address space clean up · 009d8518
      Steven Whitehouse 提交于
      Since the start of GFS2, an "extra" inode has been used to store
      the metadata belonging to each inode. The only reason for using
      this inode was to have an extra address space, the other fields
      were unused. This means that the memory usage was rather inefficient.
      
      The reason for keeping each inode's metadata in a separate address
      space is that when glocks are requested on remote nodes, we need to
      be able to efficiently locate the data and metadata which relating
      to that glock (inode) in order to sync or sync and invalidate it
      (depending on the remotely requested lock mode).
      
      This patch adds a new type of glock, which has in addition to
      its normal fields, has an address space. This applies to all
      inode and rgrp glocks (but to no other glock types which remain
      as before). As a result, we no longer need to have the second
      inode.
      
      This results in three major improvements:
       1. A saving of approx 25% of memory used in caching inodes
       2. A removal of the circular dependency between inodes and glocks
       3. No confusion between "normal" and "metadata" inodes in super.c
      
      Although the first of these is the more immediately apparent, the
      second is just as important as it now enables a number of clean
      ups at umount time. Those will be the subject of future patches.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      009d8518
  20. 03 2月, 2010 2 次提交
  21. 03 12月, 2009 6 次提交
  22. 09 9月, 2009 1 次提交
    • S
      GFS2: Be extra careful about deallocating inodes · acf7e244
      Steven Whitehouse 提交于
      There is a potential race in the inode deallocation code if two
      nodes try to deallocate the same inode at the same time. Most of
      the issue is solved by the iopen locking. There is still a small
      window which is not covered by the iopen lock. This patches fixes
      that and also makes the deallocation code more robust in the face of
      any errors in the rgrp bitmaps, or erroneous iopen callbacks from
      other nodes.
      
      This does introduce one extra disk read, but that is generally not
      an issue since its the same block that must be written to later
      in the deallocation process. The total disk accesses therefore stay
      the same,
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      acf7e244
  23. 27 8月, 2009 2 次提交
    • S
      GFS2: Remove no_formal_ino generating code · 8d8291ae
      Steven Whitehouse 提交于
      The inum structure used throughout GFS2 has two fields. One
      no_addr is the disk block number of the inode in question and
      is used everywhere as the inode number. The other, no_formal_ino,
      is used only as the generation number for NFS.
      
      Historically the no_formal_ino field was set using a complicated
      system of one global and one per-node file containing inode numbers
      in order to ensure that each no_formal_ino was unique. Also this
      code made no provision for what would happen when eventually the
      (64 bit) numbers ran out. Now I know that is pretty unlikely to
      happen given the large space of numbers, but it is possible
      nevertheless.
      
      The only guarantee required for no_formal_ino is that, for any
      single inode, the same number doesn't get reused too quickly.
      
      We already have a generation number which is kept in the inode
      and initialised from a counter in the resource group (almost
      no overhead, since we have to touch the resource group anyway
      in order to allocate an inode in the first place). Aside from
      ensuring that we never use the value 0 in the no_formal_ino
      field, we can use that counter directly.
      
      As a result of that change, we lose about 200 lines of code and
      also gain about 10 creates/sec on the postmark benchmark (on
      my test machine).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8d8291ae
    • S
      GFS2: Rename eattr.[ch] as xattr.[ch] · 307cf6e6
      Steven Whitehouse 提交于
      Use the more conventional name for the extended attribute
      support code. Update all the places which care.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      307cf6e6
  24. 24 8月, 2009 1 次提交
    • B
      GFS2: Add "-o errors=panic|withdraw" mount options · d34843d0
      Bob Peterson 提交于
      This patch adds "-o errors=panic" and "-o errors=withdraw" to the
      gfs2 mount options.  The "errors=withdraw" option is today's
      current behaviour, meaning to withdraw from the file system if a
      non-serious gfs2 error occurs.  The new "errors=panic" option
      tells gfs2 to force a kernel panic if a non-serious gfs2 file
      system error occurs.  This may be useful, for example, where
      fabric-level fencing is used that has no way to reboot (such as
      fence_scsi).
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d34843d0
  25. 17 8月, 2009 1 次提交
    • S
      GFS2: Add online uevent to GFS2 · 8633ecfa
      Steven Whitehouse 提交于
      We already have an offline uevent (used when a withdraw occurs)
      but no online uevent. This adds an online uevent so that userspace
      will be able to detect a successful mount by means other than
      not receiving a remove event after the add & recovery (change)
      uevents.
      
      It has also been added to the remount path as well - we can't use
      a change uevent there as older GFS2 userspace acts on change uevents
      according to the state that it thinks the fs is in, so we can't
      easily add any new ones.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8633ecfa