]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: use REQ_CGROUP_PUNT for worker thread submitted bios
authorChris Mason <clm@fb.com>
Wed, 10 Jul 2019 19:28:17 +0000 (12:28 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 11:46:53 +0000 (12:46 +0100)
commite68892e438e681382ac610829bef9473380b6864
tree9a2da4377b0d00e0c553bbed9362cb21dc2e738f
parentf52a0bf770a344f3b52a4f1fb8a05063d7fea7c6
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>
fs/btrfs/compression.c
fs/btrfs/compression.h
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c