1. 01 May, 2015 1 commit
  2. 16 Apr, 2015 2 commits
  3. 12 Apr, 2015 5 commits
  4. 11 Apr, 2015 3 commits
  5. 08 Apr, 2015 1 commit
  6. 17 Feb, 2015 1 commit
  7. 13 Feb, 2015 1 commit
  8. 19 Jan, 2015 1 commit
  9. 02 Dec, 2014 1 commit
  10. 25 Nov, 2014 4 commits
    • Jan Kara's avatar
      ext4: limit number of scanned extents in status tree shrinker · dd475925
      Jan Kara authored
      Currently we scan extent status trees of inodes until we reclaim nr_to_scan
      extents. This can however require a lot of scanning when there are lots
      of delayed extents (as those cannot be reclaimed).
      Change shrinker to work as shrinkers are supposed to and *scan* only
      nr_to_scan extents regardless of how many extents did we actually
      reclaim. We however need to be careful and avoid scanning each status
      tree from the beginning - that could lead to a situation where we would
      not be able to reclaim anything at all when first nr_to_scan extents in
      the tree are always unreclaimable. We remember with each inode offset
      where we stopped scanning and continue from there when we next come
      across the inode.
      Note that we also need to update places calling __es_shrink() manually
      to pass reasonable nr_to_scan to have a chance of reclaiming anything and
      not just 1.
      Signed-off-by: default avatarJan Kara <[email protected]>
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
    • Zheng Liu's avatar
      ext4: change LRU to round-robin in extent status tree shrinker · edaa53ca
      Zheng Liu authored
      In this commit we discard the lru algorithm for inodes with extent
      status tree because it takes significant effort to maintain a lru list
      in extent status tree shrinker and the shrinker can take a long time to
      scan this lru list in order to reclaim some objects.
      We replace the lru ordering with a simple round-robin.  After that we
      never need to keep a lru list.  That means that the list needn't be
      sorted if the shrinker can not reclaim any objects in the first round.
      Cc: Andreas Dilger <[email protected]>
      Signed-off-by: default avatarZheng Liu <[email protected]>
      Signed-off-by: default avatarJan Kara <[email protected]>
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
    • Zheng Liu's avatar
      ext4: cache extent hole in extent status tree for ext4_da_map_blocks() · 2f8e0a7c
      Zheng Liu authored
      Currently extent status tree doesn't cache extent hole when a write
      looks up in extent tree to make sure whether a block has been allocated
      or not.  In this case, we don't put extent hole in extent cache because
      later this extent might be removed and a new delayed extent might be
      added back.  But it will cause a defect when we do a lot of writes.  If
      we don't put extent hole in extent cache, the following writes also need
      to access extent tree to look at whether or not a block has been
      allocated.  It brings a cache miss.  This commit fixes this defect.
      Also if the inode doesn't have any extent, this extent hole will be
      cached as well.
      Cc: Andreas Dilger <[email protected]>
      Signed-off-by: default avatarZheng Liu <[email protected]>
      Signed-off-by: default avatarJan Kara <[email protected]>
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
    • Jan Kara's avatar
      ext4: fix block reservation for bigalloc filesystems · cbd7584e
      Jan Kara authored
      For bigalloc filesystems we have to check whether newly requested inode
      block isn't already part of a cluster for which we already have delayed
      allocation reservation. This check happens in ext4_ext_map_blocks() and
      that function sets EXT4_MAP_FROM_CLUSTER if that's the case. However if
      ext4_da_map_blocks() finds in extent cache information about the block,
      we don't call into ext4_ext_map_blocks() and thus we always end up
      getting new reservation even if the space for cluster is already
      reserved. This results in overreservation and premature ENOSPC reports.
      Fix the problem by checking for existing cluster reservation already in
      ext4_da_map_blocks(). That simplifies the logic and actually allows us
      to get rid of the EXT4_MAP_FROM_CLUSTER flag completely.
      Signed-off-by: default avatarJan Kara <[email protected]>
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
  11. 20 Nov, 2014 1 commit
  12. 10 Nov, 2014 1 commit
  13. 14 Oct, 2014 1 commit
    • Darrick J. Wong's avatar
      ext4: check s_chksum_driver when looking for bg csum presence · 813d32f9
      Darrick J. Wong authored
      Convert the ext4_has_group_desc_csum predicate to look for a checksum
      driver instead of the metadata_csum flag and change the bg checksum
      calculation function to look for GDT_CSUM before taking the crc16
      Without this patch, if we mount with ^uninit_bg,^metadata_csum and
      later metadata_csum gets turned on by accident, the block group
      checksum functions will incorrectly assume that checksumming is
      enabled (metadata_csum) but that crc16 should be used
      (!s_chksum_driver).  This is totally wrong, so fix the predicate
      and the checksum formula selection.
      (Granted, if the metadata_csum feature bit gets enabled on a live FS
      then something underhanded is going on, but we could at least avoid
      writing garbage into the on-disk fields.)
      Signed-off-by: default avatarDarrick J. Wong <[email protected]>
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
      Reviewed-by: default avatarDmitry Monakhov <[email protected]>
      Cc: [email protected]
  14. 13 Oct, 2014 1 commit
  15. 06 Oct, 2014 1 commit
  16. 11 Sep, 2014 1 commit
  17. 04 Sep, 2014 2 commits
  18. 02 Sep, 2014 1 commit
    • Zheng Liu's avatar
      ext4: track extent status tree shrinker delay statictics · eb68d0e2
      Zheng Liu authored
      This commit adds some statictics in extent status tree shrinker.  The
      purpose to add these is that we want to collect more details when we
      encounter a stall caused by extent status tree shrinker.  Here we count
      the following statictics:
          the number of all objects on all extent status trees
          the number of reclaimable objects on lru list
          cache hits/misses
          the last sorted interval
          the number of inodes on lru list
          scan time for shrinking some objects
          the number of shrunk objects
          the inode that has max nr. of objects on lru list
          the maximum scan time for shrinking some objects
      The output looks like below:
        $ cat /proc/fs/ext4/sda1/es_shrinker_info
          28228 objects
          6341 reclaimable objects
          5281/631 cache hits/misses
          586 ms last sorted interval
          250 inodes on lru list
          153 us scan time
          128 shrunk objects
          255 inode (255 objects, 198 reclaimable)
          125723 us max scan time
      If the lru list has never been sorted, the following line will not be
          586ms last sorted interval
      If there is an empty lru list, the following lines also will not be
          250 inodes on lru list
          255 inode (255 objects, 198 reclaimable)
          0 us max scan time
      Meanwhile in this commit a new trace point is defined to print some
      details in __ext4_es_shrink().
      Cc: Andreas Dilger <[email protected]>
      Cc: Jan Kara <[email protected]>
      Reviewed-by: default avatarJan Kara <[email protected]>
      Signed-off-by: default avatarZheng Liu <[email protected]>
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
  19. 01 Sep, 2014 4 commits
    • Theodore Ts'o's avatar
      ext4: rename ext4_ext_find_extent() to ext4_find_extent() · ed8a1a76
      Theodore Ts'o authored
      Make the function name less redundant.
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
    • Theodore Ts'o's avatar
      ext4: drop EXT4_EX_NOFREE_ON_ERR from rest of extents handling code · dfe50809
      Theodore Ts'o authored
      Drop EXT4_EX_NOFREE_ON_ERR from ext4_ext_create_new_leaf(),
      ext4_split_extent(), ext4_convert_unwritten_extents_endio().
      This requires fixing all of their callers to potentially
      ext4_ext_find_extent() to free the struct ext4_ext_path object in case
      of an error, and there are interlocking dependencies all the way up to
      ext4_ext_map_blocks(), ext4_swap_extents(), and
      Once this is done, we can drop the EXT4_EX_NOFREE_ON_ERR flag since it
      is no longer necessary.
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
    • Theodore Ts'o's avatar
      ext4: teach ext4_ext_find_extent() to free path on error · 705912ca
      Theodore Ts'o authored
      Right now, there are a places where it is all to easy to leak memory
      on an error path, via a usage like this:
      	struct ext4_ext_path *path = NULL
      	while (...) {
      		path = ext4_ext_find_extent(inode, block, path, 0);
      		if (IS_ERR(path)) {
      			/* oops, if path was non-NULL before the call to
      			   ext4_ext_find_extent, we've leaked it!  :-(  */
      			return PTR_ERR(path);
      Unfortunately, there some code paths where we are doing the following
      	path = ext4_ext_find_extent(inode, block, orig_path, 0);
      and where it's important that we _not_ free orig_path in the case
      where ext4_ext_find_extent() returns an error.
      So change the function signature of ext4_ext_find_extent() so that it
      takes a struct ext4_ext_path ** for its third argument, and by
      default, on an error, it will free the struct ext4_ext_path, and then
      zero out the struct ext4_ext_path * pointer.  In order to avoid
      causing problems, we add a flag EXT4_EX_NOFREE_ON_ERR which causes
      ext4_ext_find_extent() to use the original behavior of forcing the
      caller to deal with freeing the original path pointer on the error
      The goal is to get rid of EXT4_EX_NOFREE_ON_ERR entirely, but this
      allows for a gentle transition and makes the patches easier to verify.
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
    • Theodore Ts'o's avatar
      ext4: fix accidental flag aliasing in ext4_map_blocks flags · bd30d702
      Theodore Ts'o authored
      Commit b8a86845 introduced an accidental flag aliasing between
      Fortunately, this didn't introduce any untorward side effects --- we
      got lucky.  Nevertheless, fix this and leave a warning to hopefully
      avoid this from happening in the future.
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <[email protected]>
  20. 31 Aug, 2014 2 commits
  21. 30 Aug, 2014 2 commits
  22. 23 Aug, 2014 2 commits
  23. 28 Jul, 2014 1 commit