1. 24 Mar, 2009 19 commits
    • Steven Whitehouse's avatar
      Fix a minor bug in the previous patch · 9c538837
      Steven Whitehouse authored
      The logic requires that we mark the glock dirty in page_mkwrite
      otherwise we might not flush correctly in the case that no
      allocation was required in the process of dirying the page.
      Also we need to set the shared write flag early for the same
      reason.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      9c538837
    • Steven Whitehouse's avatar
      GFS2: Clean up of glops.c · 6bac243f
      Steven Whitehouse authored
      This cleans up a number of bits of code mostly based in glops.c.
      A couple of simple functions have been merged into the callers
      to make it more obvious what is going on, the mysterious raising
      of i_writecount around the truncate_inode_pages() call has been
      removed. The meta_go_* operations have been renamed rgrp_go_*
      since that is the only lock type that they are used with.
      
      The unused argument of gfs2_read_sb has been removed. Also
      a bug has been fixed where a check for the rindex inode was
      in the wrong callback. More comments are added, and the
      debugging code is improved too.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      6bac243f
    • Benjamin Marzinski's avatar
      GFS2: Fix locking bug in failed shared to exclusive conversion · 02ffad08
      Benjamin Marzinski authored
      After calling out to the dlm, GFS2 sets the new state of a glock to
      gl_target in gdlm_ast().  However, gl_target is not always the lock
      state that was requested. If a conversion from shared to exclusive
      fails, finish_xmote() will call do_xmote() with LM_ST_UNLOCKED, instead
      of gl->gl_target, so that it can reacquire the lock in exlusive the next
      time around.  In this case, setting the lock to gl_target in gdlm_ast()
      will make GFS2 think that it has the glock in exclusive mode, when
      really, it doesn't have the glock locked at all.  This patch adds a new
      field to the gfs2_glock structure, gl_req, to track the mode that was
      requested.
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      02ffad08
    • Hisashi Hifumi's avatar
      GFS2: Pagecache usage optimization on GFS2 · 229615de
      Hisashi Hifumi authored
      I introduced "is_partially_uptodate" aops for GFS2.
      
      A page can have multiple buffers and even if a page is not uptodate, some buffers
      can be uptodate on pagesize != blocksize environment.
      This aops checks that all buffers which correspond to a part of a file
      that we want to read are uptodate. If so, we do not have to issue actual
      read IO to HDD even if a page is not uptodate because the portion we
      want to read are uptodate.
      "block_is_partially_uptodate" function is already used by ext2/3/4.
      With the following patch random read/write mixed workloads or random read after
      random write workloads can be optimized and we can get performance improvement.
      
      I did a performance test using the sysbench.
      
      #sysbench --num-threads=16 --max-requests=200000 --test=fileio --file-num=1
      --file-block-size=8K --file-total-size=2G --file-test-mode=rndrw --file-fsync-freq=0
      --file-rw-ratio=1 run
      
      -2.6.29-rc6
      Test execution summary:
          total time:                          202.6389s
          total number of events:              200000
          total time taken by event execution: 2580.0480
          per-request statistics:
               min:                            0.0000s
               avg:                            0.0129s
               max:                            49.5852s
               approx.  95 percentile:         0.0462s
      
      -2.6.29-rc6-patched
      Test execution summary:
          total time:                          177.8639s
          total number of events:              200000
          total time taken by event execution: 2419.0199
          per-request statistics:
               min:                            0.0000s
               avg:                            0.0121s
               max:                            52.4306s
               approx.  95 percentile:         0.0444s
      
      arch: ia64
      pagesize: 16k
      blocksize: 4k
      Signed-off-by: default avatarHisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      229615de
    • Hannes Eder's avatar
      GFS2: fix sparse warning: Should it be static? · 02ab1721
      Hannes Eder authored
      Impact: Make symbol static.
      
      Fix this sparse warning:
        fs/gfs2/rgrp.c:188:5: warning: symbol 'gfs2_bitfit' was not declared. Should it be static?
      Signed-off-by: default avatarHannes Eder <hannes@hanneseder.net>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      02ab1721
    • Hannes Eder's avatar
      GFS2: fix sparse warnings: constant is so big it is ... · 075ac448
      Hannes Eder authored
      Fix this sparse warnings:
        fs/gfs2/rgrp.c:156:23: warning: constant 0xffffffffffffffff is so big it is unsigned long long
        fs/gfs2/rgrp.c:157:23: warning: constant 0xaaaaaaaaaaaaaaaa is so big it is unsigned long long
        fs/gfs2/rgrp.c:158:23: warning: constant 0x5555555555555555 is so big it is long long
        fs/gfs2/rgrp.c:194:20: warning: constant 0x5555555555555555 is so big it is long long
        fs/gfs2/rgrp.c:204:44: warning: constant 0x5555555555555555 is so big it is long long
      Signed-off-by: default avatarHannes Eder <hannes@hanneseder.net>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      075ac448
    • Steven Whitehouse's avatar
      GFS2: Support quota/noquota mount arguments · b9a96945
      Steven Whitehouse authored
      This adds support for "quota" and "noquota" mount options in addition to the
      existing "quota=on/off/account" so that we are compatible with the names by
      which these options are more generally known.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      b9a96945
    • Steven Whitehouse's avatar
      GFS2: Fix alignment issue and tidy gfs2_bitfit · 223b2b88
      Steven Whitehouse authored
      An alignment issue with the existing bitfit algorithm was reported
      on IA64. This patch attempts to fix that, and also to tidy up the
      code a bit. There is now more documentation about how this works
      and it has survived a number of different tests.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      223b2b88
    • Steven Whitehouse's avatar
      GFS2: Add a "demote a glock" interface to sysfs · 64d576ba
      Steven Whitehouse authored
      This adds a sysfs file called demote_rq to GFS2's
      per filesystem directory. Its possible to use this
      file to demote arbitrary glocks in exactly the same
      way as if a request had come in from a remote node.
      
      This is intended for testing issues relating to caching
      of data under glocks. Despite that, the interface is
      generic enough to send requests to any type of glock,
      but be careful as its not always safe to send an
      arbitrary message to an arbitrary glock. For that reason
      and to prevent DoS, this interface is restricted to root
      only.
      
      The messages look like this:
      
      <type>:<glocknumber> <mode>
      
      Example:
      
      echo -n "2:13324 EX" >/sys/fs/gfs2/unity:myfs/demote_rq
      
      Which means "please demote inode glock (type 2) number 13324 so that
      I can get an EX (exclusive) lock". The lock modes are those which
      would normally be sent by a remote node in its callback so if you
      want to unlock a glock, you use EX, to demote to shared, use SH or PR
      (depending on whether you like GFS2 or DLM lock modes better!).
      
      If the glock doesn't exist, you'll get -ENOENT returned. If the
      arguments don't make sense, you'll get -EINVAL returned.
      
      The plan is that this interface will be used in combination with
      the blktrace patch which I recently posted for comments although
      it is, of course, still useful in its own right.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      64d576ba
    • Steven Whitehouse's avatar
      GFS2: Expose UUID via sysfs/uevent · 02e3cc70
      Steven Whitehouse authored
      Since we have a UUID, we ought to expose it to the user via sysfs
      and uevents. We already have the fs name in both of these places
      (a combination of the lock proto and lock table name) so if we add
      the UUID as well, we have a full set.
      
      For older filesystems (i.e. those created before mkfs.gfs2 was writing
      UUIDs by default) the sysfs file will appear zero length, and no UUID
      env var will be added to the uevents.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      02e3cc70
    • Steven Whitehouse's avatar
      GFS2: Support generation of discard requests · f15ab561
      Steven Whitehouse authored
      This patch allows GFS2 to generate discard requests for blocks which are
      no longer useful to the filesystem (i.e. those which have been freed as
      the result of an unlink operation). The requests are generated at the
      time which those blocks become available for reuse in the filesystem.
      
      In order to use this new feature, you have to specify the "discard"
      mount option. The code coalesces adjacent blocks into a single extent
      when generating the discard requests, thus generating the minimum
      number.
      
      If an error occurs when the request has been sent to the block device,
      then it will print a message and turn off the requests for that
      filesystem. If the problem is temporary, then you can use remount to
      turn the option back on again. There is also a nodiscard mount option
      so that you can use remount to turn discard requests off, if required.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      f15ab561
    • Steven Whitehouse's avatar
      GFS2: Fix deadlock on journal flush · d8348de0
      Steven Whitehouse authored
      This patch fixes a deadlock when the journal is flushed and there
      are dirty inodes other than the one which caused the journal flush.
      Originally the journal flushing code was trying to obtain the
      transaction glock while running the flush code for an inode glock.
      We no longer require the transaction glock at this point in time
      since we know that any attempt to get the transaction glock from
      another node will result in a journal flush. So if we are flushing
      the journal, we can be sure that the transaction lock is still
      cached from when the transaction was started.
      
      By inlining a version of gfs2_trans_begin() (minus the bit which
      gets the transaction glock) we can avoid the deadlock problems
      caused if there is a demote request queued up on the transaction
      glock.
      
      In addition I've also moved the umount rwsem so that it covers
      the glock workqueue, since it all demotions are done by this
      workqueue now. That fixes a bug on umount which I came across
      while fixing the original problem.
      Reported-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      d8348de0
    • Steven Whitehouse's avatar
      GFS2: Fix error path ref counting for root inode · e7c8707e
      Steven Whitehouse authored
      We were keeping hold of an extra ref to the root inode in one
      of the error paths, that resulted in a hang.
      Reported-by: default avatarNate Straz <nstraz@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Tested-by: default avatarRobert Peterson <rpeterso@redhat.com>
      e7c8707e
    • Steven Whitehouse's avatar
      GFS2: Remove unused field from glock · ac2425e7
      Steven Whitehouse authored
      The time stamp field is unused in the glock now that we are
      using a shrinker, so that we can remove it and save sizeof(unsigned long)
      bytes in each glock.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      ac2425e7
    • Steven Whitehouse's avatar
      GFS2: Merge lock_dlm module into GFS2 · f057f6cd
      Steven Whitehouse authored
      This is the big patch that I've been working on for some time
      now. There are many reasons for wanting to make this change
      such as:
       o Reducing overhead by eliminating duplicated fields between structures
       o Simplifcation of the code (reduces the code size by a fair bit)
       o The locking interface is now the DLM interface itself as proposed
         some time ago.
       o Fewer lookups of glocks when processing replies from the DLM
       o Fewer memory allocations/deallocations for each glock
       o Scope to do further optimisations in the future (but this patch is
         more than big enough for now!)
      
      Please note that (a) this patch relates to the lock_dlm module and
      not the DLM itself, that is still a separate module; and (b) that
      we retain the ability to build GFS2 as a standalone single node
      filesystem with out requiring the DLM.
      
      This patch needs a lot of testing, hence my keeping it I restarted
      my -git tree after the last merge window. That way, this has the maximum
      exposure before its merged. This is (modulo a few minor bug fixes) the
      same patch that I've been posting on and off the the last three months
      and its passed a number of different tests so far.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      f057f6cd
    • Steven Whitehouse's avatar
      GFS2: Remove "double" locking in quota · 22077f57
      Steven Whitehouse authored
      We only really need a single spin lock for the quota data, so
      lets just use the lru lock for now.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Cc: Abhijith Das <adas@redhat.com>
      22077f57
    • Abhijith Das's avatar
      GFS2: change gfs2_quota_scan into a shrinker · 0a7ab79c
      Abhijith Das authored
      Deallocation of gfs2_quota_data objects now happens on-demand through a
      shrinker instead of routinely deallocating through the quotad daemon.
      Signed-off-by: default avatarAbhijith Das <adas@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      0a7ab79c
    • Abhijith Das's avatar
      GFS2: Bring back lvb-related stuff to lock_nolock to support quotas · 2db2aac2
      Abhijith Das authored
      The quota code uses lvbs and this is currently not implemented in
      lock_nolock, thereby causing panics when quota is enabled with
      lock_nolock. This patch adds the relevant bits.
      Signed-off-by: default avatarAbhijith Das <adas@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      2db2aac2
    • Steven Whitehouse's avatar
      GFS2: Fix remount argument parsing · 6f04c1c7
      Steven Whitehouse authored
      The following patch fixes an issue relating to remount and argument
      parsing. After this fix is applied, remount becomes atomic in that
      it either succeeds changing the mount to the new state, or it fails
      and leaves it in the old state. Previously it was possible for the
      parsing of options to fail part way though and for the fs to be left
      in a state where some of the new arguments had been applied, but some
      had not.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      6f04c1c7
  2. 23 Mar, 2009 11 commits
  3. 22 Mar, 2009 6 commits
  4. 21 Mar, 2009 2 commits
  5. 20 Mar, 2009 2 commits