Btrfs: use REQ_CGROUP_PUNT for worker thread submitted bios
Async CRCs and compression submit IO through helper threads, which means they have IO priority inversions when cgroup IO controllers are in use. This flags all of the writes submitted by btrfs helper threads as REQ_CGROUP_PUNT. submit_bio() will punt these to dedicated per-blkcg work items to avoid the priority inversion. For the compression code, we take a reference on the wbc's blkg css and pass it down to the async workers. For the async CRCs, the bio already has the correct css, we just need to tell the block layer to use REQ_CGROUP_PUNT. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Chris Mason <clm@fb.com> Modified-and-reviewed-by: Tejun Heo <tj@kernel.org> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
1d53c9e672
commit
ec39f7696c
@@ -4250,6 +4250,9 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
|
||||
.nr_to_write = nr_pages * 2,
|
||||
.range_start = start,
|
||||
.range_end = end + 1,
|
||||
/* We're called from an async helper function */
|
||||
.punt_to_cgroup = 1,
|
||||
.no_cgroup_owner = 1,
|
||||
};
|
||||
|
||||
while (start <= end) {
|
||||
|
Reference in New Issue
Block a user