Btrfs: get better concurrency for snapshot-aware defrag work
PATCH 1/1 Btrfs: get better concurrency for snapshot-aware defrag work
Using spinning case instead of blocking will result in better concurrency overall.
--- fs/btrfs/inode.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
fs/btrfs/inode.c +3 -0
@@ -2312,6 +2312,7 @@ again: key.type =BTRFS_EXTENT_DATA_KEY ; key.offset = start; + path->leave_spinning =1 ;if (merge) {struct btrfs_file_extent_item *fi;u64 extent_len;
@@ -2368,6 +2369,7 @@ again:btrfs_mark_buffer_dirty (leaf);inode_add_bytes (inode, len); +btrfs_release_path (path); ret = btrfs_inc_extent_ref(trans, root, new->bytenr, new->disk_len, 0,
@@ -2381,6 +2383,7 @@ again: ret =1 ; out_free_path:btrfs_release_path (path); + path->leave_spinning =0 ;btrfs_end_transaction (trans, root); out_unlock: unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, lock_end,
Signature · 1 line
1.7.7.6
Quoted 2 lines · Liu Bo
Using spinning case instead of blocking will result in better concurrency overall.
Do you have numbers to support that?
david
Quoted 6 lines · David Sterba
Quoted 2 lines · Liu Bo
Using spinning case instead of blocking will result in better concurrency overall.
Do you have numbers to support that?
Sorry, I don't, just judging from what leave_spinning is desiged for and the similar usecases, like insert_reserved_file_extents(), which is also involved in endio write worker.
thanks,
liubo
Quoted 11 lines · Liu Bo
Quoted 6 lines · David Sterba
Quoted 2 lines · Liu Bo
Using spinning case instead of blocking will result in better concurrency overall.
Do you have numbers to support that?
Sorry, I don't, just judging from what
leave_spinningis desiged for and the similar usecases, likeinsert_reserved_file_extents(), which is also involved in endio write worker.
Leaving the path spinning is always faster. As long as you're sure the code inside doesn't schedule it is the right choice.
-chris
Quoted 9 lines · Chris Mason
Quoted 8 lines · Liu Bo
Quoted 6 lines · David Sterba
Quoted 2 lines · Liu Bo
Using spinning case instead of blocking will result in better concurrency overall.
Do you have numbers to support that?
Quoted 7 lines
Quoted 3 lines
Sorry, I don't, just judging from what
leave_spinningis desiged for and the similar usecases, likeinsert_reserved_file_extents(), which is also involved in endio write worker.Leaving the path spinning is always faster. As long as you're sure the code inside doesn't schedule it is the right choice.
Yeah, I've taken care of schedule thing :)
thanks,
liubo