1. 14 2月, 2017 6 次提交
  2. 03 1月, 2017 3 次提交
  3. 06 12月, 2016 14 次提交
  4. 30 11月, 2016 7 次提交
    • W
      btrfs: improve delayed refs iterations · 1d57ee94
      Wang Xiaoguang 提交于
      This issue was found when I tried to delete a heavily reflinked file,
      when deleting such files, other transaction operation will not have a
      chance to make progress, for example, start_transaction() will blocked
      in wait_current_trans(root) for long time, sometimes it even triggers
      soft lockups, and the time taken to delete such heavily reflinked file
      is also very large, often hundreds of seconds. Using perf top, it reports
      that:
      
      PerfTop:    7416 irqs/sec  kernel:99.8%  exact:  0.0% [4000Hz cpu-clock],  (all, 4 CPUs)
      ---------------------------------------------------------------------------------------
          84.37%  [btrfs]             [k] __btrfs_run_delayed_refs.constprop.80
          11.02%  [kernel]            [k] delay_tsc
           0.79%  [kernel]            [k] _raw_spin_unlock_irq
           0.78%  [kernel]            [k] _raw_spin_unlock_irqrestore
           0.45%  [kernel]            [k] do_raw_spin_lock
           0.18%  [kernel]            [k] __slab_alloc
      It seems __btrfs_run_delayed_refs() took most cpu time, after some debug
      work, I found it's select_delayed_ref() causing this issue, for a delayed
      head, in our case, it'll be full of BTRFS_DROP_DELAYED_REF nodes, but
      select_delayed_ref() will firstly try to iterate node list to find
      BTRFS_ADD_DELAYED_REF nodes, obviously it's a disaster in this case, and
      waste much time.
      
      To fix this issue, we introduce a new ref_add_list in struct btrfs_delayed_ref_head,
      then in select_delayed_ref(), if this list is not empty, we can directly use
      nodes in this list. With this patch, it just took about 10~15 seconds to
      delte the same file. Now using perf top, it reports that:
      
      PerfTop:    2734 irqs/sec  kernel:99.5%  exact:  0.0% [4000Hz cpu-clock],  (all, 4 CPUs)
      ----------------------------------------------------------------------------------------
      
          20.74%  [kernel]          [k] _raw_spin_unlock_irqrestore
          16.33%  [kernel]          [k] __slab_alloc
           5.41%  [kernel]          [k] lock_acquired
           4.42%  [kernel]          [k] lock_acquire
           4.05%  [kernel]          [k] lock_release
           3.37%  [kernel]          [k] _raw_spin_unlock_irq
      
      For normal files, this patch also gives help, at least we do not need to
      iterate whole list to found BTRFS_ADD_DELAYED_REF nodes.
      Signed-off-by: NWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
      Reviewed-by: NLiu Bo <bo.li.liu@oracle.com>
      Tested-by: NHolger Hoffstätte <holger@applied-asynchrony.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      1d57ee94
    • Q
      btrfs: Export and move leaf/subtree qgroup helpers to qgroup.c · 33d1f05c
      Qu Wenruo 提交于
      Move account_shared_subtree() to qgroup.c and rename it to
      btrfs_qgroup_trace_subtree().
      
      Do the same thing for account_leaf_items() and rename it to
      btrfs_qgroup_trace_leaf_items().
      
      Since all these functions are only for qgroup, move them to qgroup.c and
      export them is more appropriate.
      Signed-off-by: NQu Wenruo <quwenruo@cn.fujitsu.com>
      Reviewed-and-Tested-by: NGoldwyn Rodrigues <rgoldwyn@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      33d1f05c
    • Q
      btrfs: qgroup: Rename functions to make it follow reserve,trace,account steps · 50b3e040
      Qu Wenruo 提交于
      Rename btrfs_qgroup_insert_dirty_extent(_nolock) to
      btrfs_qgroup_trace_extent(_nolock), according to the new
      reserve/trace/account naming schema.
      Signed-off-by: NQu Wenruo <quwenruo@cn.fujitsu.com>
      Reviewed-and-Tested-by: NGoldwyn Rodrigues <rgoldwyn@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      50b3e040
    • J
      btrfs: Ensure proper sector alignment for btrfs_free_reserved_data_space · 0c476a5d
      Jeff Mahoney 提交于
      This fixes the WARN_ON on BTRFS_I(inode)->reserved_extents in
      btrfs_destroy_inode and the WARN_ON on nonzero delalloc bytes on umount
      with qgroups enabled.
      
      I was able to reproduce this by setting up a small (~500kb) quota limit
      and writing a file one byte at a time until I hit the limit.  The warnings
      would all hit on umount.
      
      The root cause is that we would reserve a block-sized range in both
      the reservation and the quota in btrfs_check_data_free_space, but if we
      encountered a problem (like e.g. EDQUOT), we would only release the single
      byte in the qgroup reservation.  That caused an iotree state split, which
      increased the number of outstanding extents, in turn disallowing releasing
      the metadata reservation.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      Reviewed-by: NQu Wenruo <quwenruo@cn.fujitsu.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      0c476a5d
    • D
      btrfs: remove constant parameter to memset_extent_buffer and rename it · b159fa28
      David Sterba 提交于
      The only memset we do is to 0, so sink the parameter to the function and
      simplify all calls. Rename the function to reflect the behaviour.
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      b159fa28
    • D
      btrfs: remove trivial helper btrfs_find_tree_block · 62d1f9fe
      David Sterba 提交于
      During the time, the function has been shrunk to the point that it just
      calls find_extent_buffer, just passing the parameters.
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      62d1f9fe
    • X
      btrfs: remove useless comments · 745699ef
      Xiaoguang Wang 提交于
      Fixes: ("btrfs: update btrfs_space_info's bytes_may_use timely")
      Signed-off-by: NWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      745699ef
  5. 29 11月, 2016 2 次提交
  6. 25 10月, 2016 1 次提交
  7. 11 10月, 2016 1 次提交
  8. 27 9月, 2016 6 次提交