1. 02 Oct, 2011 6 commits
    • Arne Jansen's avatar
      btrfs: use readahead API for scrub · 7a26285e
      Arne Jansen authored
      Scrub uses a simple tree-enumeration to bring the relevant portions
      of the extent- and csum-tree into the page cache before starting the
      scrub-I/O. This is now replaced by using the new readahead-API.
      During readahead the scrub is being accounted as paused, so it won't
      hold off transaction commits.
      
      This change raises the average disk bandwith utilisation on my test
      volume from 70% to 90%. On another volume, the time for a test run
      went down from 89s to 43s.
      
      Changes v5:
       - reada1/2 are now of type struct reada_control *
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      7a26285e
    • Arne Jansen's avatar
      btrfs: hooks for readahead · 4bb31e92
      Arne Jansen authored
      This adds the hooks needed for readahead. In the readpage_end_io_hook,
      the extent state is checked for the EXTENT_READAHEAD flag. Only in this
      case the readahead hook is called, to keep the impact on non-ra as low
      as possible.
      Additionally, a hook for a failed IO is added, otherwise readahead would
      wait indefinitely for the extent to finish.
      
      Changes for v2:
       - eliminate race condition
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      4bb31e92
    • Arne Jansen's avatar
      btrfs: initial readahead code and prototypes · 7414a03f
      Arne Jansen authored
      This is the implementation for the generic read ahead framework.
      
      To trigger a readahead, btrfs_reada_add must be called. It will start
      a read ahead for the given range [start, end) on tree root. The returned
      handle can either be used to wait on the readahead to finish
      (btrfs_reada_wait), or to send it to the background (btrfs_reada_detach).
      
      The read ahead works as follows:
      On btrfs_reada_add, the root of the tree is inserted into a radix_tree.
      reada_start_machine will then search for extents to prefetch and trigger
      some reads. When a read finishes for a node, all contained node/leaf
      pointers that lie in the given range will also be enqueued. The reads will
      be triggered in sequential order, thus giving a big win over a naive
      enumeration. It will also make use of multi-device layouts. Each disk
      will have its on read pointer and all disks will by utilized in parallel.
      Also will no two disks read both sides of a mirror simultaneously, as this
      would waste seeking capacity. Instead both disks will read different parts
      of the filesystem.
      Any number of readaheads can be started in parallel. The read order will be
      determined globally, i.e. 2 parallel readaheads will normally finish faster
      than the 2 started one after another.
      
      Changes v2:
       - protect root->node by transaction instead of node_lock
       - fix missed branches:
          The readahead had a too simple check to determine if a branch from
          a node should be checked or not. It now also records the upper bound
          of each node to see if the requested RA range lies within.
       - use KERN_CONT to debug output, to avoid line breaks
       - defer reada_start_machine to worker to avoid deadlock
      
      Changes v3:
       - protect root->node by rcu
      
      Changes v5:
       - changed EIO-semantics of reada_tree_block_flagged
       - remove spin_lock from reada_control and make elems an atomic_t
       - remove unused read_total from reada_control
       - kill reada_key_cmp, use btrfs_comp_cpu_keys instead
       - use kref-style release functions where possible
       - return struct reada_control * instead of void * from btrfs_reada_add
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      7414a03f
    • Arne Jansen's avatar
      btrfs: state information for readahead · 90519d66
      Arne Jansen authored
      Add state information for readahead to btrfs_fs_info and btrfs_device
      
      Changes v2:
       - don't wait in radix_trees
       - add own set of workers for readahead
      Reviewed-by: default avatarJosef Bacik <josef@redhat.com>
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      90519d66
    • Arne Jansen's avatar
      btrfs: add READAHEAD extent buffer flag · ab0fff03
      Arne Jansen authored
      Add a READAHEAD extent buffer flag.
      Add a function to trigger a read with this flag set.
      
      Changes v2:
       - use extent buffer flags instead of extent state flags
      
      Changes v5:
       - adapt to changed read_extent_buffer_pages interface
       - don't return eb from reada_tree_block_flagged if it has CORRUPT flag set
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      ab0fff03
    • Arne Jansen's avatar
      btrfs: add an extra wait mode to read_extent_buffer_pages · bb82ab88
      Arne Jansen authored
      read_extent_buffer_pages currently has two modes, either trigger a read
      without waiting for anything, or wait for the I/O to finish. The former
      also bails when it's unable to lock the page. This patch now adds an
      additional parameter to allow it to block on page lock, but don't wait
      for completion.
      
      Changes v5:
       - merge the 2 wait parameters into one and define WAIT_NONE, WAIT_COMPLETE and
         WAIT_PAGE_LOCK
      
      Change v6:
       - fix bug introduced in v5
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      bb82ab88
  2. 30 Sep, 2011 2 commits
  3. 20 Sep, 2011 2 commits
  4. 18 Sep, 2011 7 commits
  5. 12 Sep, 2011 9 commits
  6. 11 Sep, 2011 14 commits