Re: [PATCH block-5.17] block: don't merge across cgroup boundaries if iocost or iolatency is active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/14/22 1:57 AM, Tejun Heo wrote:
> blk-iocost and iolatency are cgroup aware rq-qos policies but, unlike
> elevators, they didn't have a way to disable merges across different
> cgroups. This obviously can lead to accounting and control errors but more
> importantly to priority inversions - e.g. an IO which belongs to a higher
> priority cgroup or IO class may end up getting throttled incorrectly because
> it gets merged to an IO issued from a low priority cgroup.
> 
> Fix it by adding blk_cgroup_mergeable() which is called from merge paths to
> test whether merges are acceptable from cgroup POV. When iocost or iolatency
> is active, this rejects cross-cgroup and cross-issue_as_root merges.
> 
> While at it,
> 
> * Add WARN_ON_ONCE() on blkg mismatch in ioc_rqos_merge() so that we can
>   easily notice similar failures in the future.
> 
> * Make sure iocost enable/disable transitions only happen when iocost is
>   actually enabled / disabled.

Is there really no better way to do this than add a lot of expensive
checks to the fast path?

Even just inverting the checks so that

if (req->bio->bi_blkg != bio->bi_blkg)
	...

is checked first would seem a lot saner.

In any case, since this isn't a new regression, I'd feel a lot better
deferring it to 5.18.

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux