diff options
author | Christoph Hellwig <hch@lst.de> | 2022-09-21 20:05:00 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-09-26 19:17:28 -0600 |
commit | de185b56e8a62822d4e1cdb3e068b38ca709aa47 (patch) | |
tree | 1968673ce080f6be094d1110bc38f325e5934da1 /block/blk-cgroup.c | |
parent | 00ad6991bbae116b7c83f68754edd6f4d5e65e01 (diff) | |
download | lwn-de185b56e8a62822d4e1cdb3e068b38ca709aa47.tar.gz lwn-de185b56e8a62822d4e1cdb3e068b38ca709aa47.zip |
blk-cgroup: pass a gendisk to blkcg_schedule_throttle
Pass the gendisk to blkcg_schedule_throttle as part of moving the
blk-cgroup infrastructure to be gendisk based. Remove the unused
!BLK_CGROUP stub while we're at it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andreas Herrmann <aherrmann@suse.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220921180501.1539876-17-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index c2d5ca2eb92e..fc82057db962 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1792,13 +1792,13 @@ out: /** * blkcg_schedule_throttle - this task needs to check for throttling - * @q: the request queue IO was submitted on + * @gendisk: disk to throttle * @use_memdelay: do we charge this to memory delay for PSI * * This is called by the IO controller when we know there's delay accumulated * for the blkg for this task. We do not pass the blkg because there are places * we call this that may not have that information, the swapping code for - * instance will only have a request_queue at that point. This set's the + * instance will only have a block_device at that point. This set's the * notify_resume for the task to check and see if it requires throttling before * returning to user space. * @@ -1807,8 +1807,10 @@ out: * throttle once. If the task needs to be throttled again it'll need to be * re-set at the next time we see the task. */ -void blkcg_schedule_throttle(struct request_queue *q, bool use_memdelay) +void blkcg_schedule_throttle(struct gendisk *disk, bool use_memdelay) { + struct request_queue *q = disk->queue; + if (unlikely(current->flags & PF_KTHREAD)) return; |