]> git.baikalelectronics.ru Git - kernel.git/commit
bfq: Get rid of __bio_blkcg() usage
authorJan Kara <jack@suse.cz>
Fri, 1 Apr 2022 10:27:49 +0000 (12:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 01:34:29 +0000 (19:34 -0600)
commita650ebd53aca84d664381d5d4b99daf75572d0e1
treeeb83d33e016c6e55c9871aae1ba01e8b82b0f0fc
parentd8c12522478ae93cb14071e8933658d2c05e29eb
bfq: Get rid of __bio_blkcg() usage

BFQ usage of __bio_blkcg() is a relict from the past. Furthermore if bio
would not be associated with any blkcg, the usage of __bio_blkcg() in
BFQ is prone to races with the task being migrated between cgroups as
__bio_blkcg() calls at different places could return different blkcgs.

Convert BFQ to the new situation where bio->bi_blkg is initialized in
bio_set_dev() and thus practically always valid. This allows us to save
blkcg_gq lookup and noticeably simplify the code.

CC: stable@vger.kernel.org
Fixes: 7826f4929c97 ("blkcg: fix ref count issue with bio_blkcg() using task_css")
Tested-by: "yukuai (C)" <yukuai3@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220401102752.8599-8-jack@suse.cz
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-cgroup.c
block/bfq-iosched.c
block/bfq-iosched.h