* [PATCH v3 1/2] block: remove blk_queue_root_blkg
2020-06-29 8:26 [PATCH v3 0/2] block: drive-by cleanups for block cgroup Johannes Thumshirn
@ 2020-06-29 8:26 ` Johannes Thumshirn
2020-06-29 8:26 ` [PATCH v3 2/2] block: open-code blkg_path in it's sole caller Johannes Thumshirn
2020-06-29 13:48 ` [PATCH v3 0/2] block: drive-by cleanups for block cgroup Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2020-06-29 8:26 UTC (permalink / raw)
To: Jens Axboe
Cc: Tejun Heo, linux-block @ vger . kernel . org, paolo.valente,
Johannes Thumshirn, Christoph Hellwig
blk_queue_root_blkg() has no callers, remove it.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
include/linux/blk-cgroup.h | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index a57ebe2f00ab..6aa633cedfb0 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -364,17 +364,6 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,
return __blkg_lookup(blkcg, q, false);
}
-/**
- * blk_queue_root_blkg - return blkg for the (blkcg_root, @q) pair
- * @q: request_queue of interest
- *
- * Lookup blkg for @q at the root level. See also blkg_lookup().
- */
-static inline struct blkcg_gq *blk_queue_root_blkg(struct request_queue *q)
-{
- return q->root_blkg;
-}
-
/**
* blkg_to_pdata - get policy private data
* @blkg: blkg of interest
@@ -732,8 +721,6 @@ static inline bool blk_cgroup_congested(void) { return false; }
static inline void blkcg_schedule_throttle(struct request_queue *q, bool use_memdelay) { }
static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { return NULL; }
-static inline struct blkcg_gq *blk_queue_root_blkg(struct request_queue *q)
-{ return NULL; }
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
static inline void blkcg_exit_queue(struct request_queue *q) { }
static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] block: open-code blkg_path in it's sole caller
2020-06-29 8:26 [PATCH v3 0/2] block: drive-by cleanups for block cgroup Johannes Thumshirn
2020-06-29 8:26 ` [PATCH v3 1/2] block: remove blk_queue_root_blkg Johannes Thumshirn
@ 2020-06-29 8:26 ` Johannes Thumshirn
2020-06-29 13:48 ` [PATCH v3 0/2] block: drive-by cleanups for block cgroup Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2020-06-29 8:26 UTC (permalink / raw)
To: Jens Axboe
Cc: Tejun Heo, linux-block @ vger . kernel . org, paolo.valente,
Johannes Thumshirn, Christoph Hellwig
blkg_path() is a trivial one-line helper that only has a single caller,
bfq_bic_update_cgroup().
Remove blkg_path() and open-code it in bfq_bic_update_cgroup().
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
block/bfq-cgroup.c | 3 ++-
include/linux/blk-cgroup.h | 14 --------------
2 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index 68882b9b8f11..8fe7d47eb4dd 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -794,7 +794,8 @@ void bfq_bic_update_cgroup(struct bfq_io_cq *bic, struct bio *bio)
* refcounter for bfqg, to let it disappear only after no
* bfq_queue refers to it any longer.
*/
- blkg_path(bfqg_to_blkg(bfqg), bfqg->blkg_path, sizeof(bfqg->blkg_path));
+ cgroup_path(bfqg_to_blkg(bfqg)->blkcg->css.cgroup, bfqg->blkg_path,
+ sizeof(bfqg->blkg_path));
bic->blkcg_serial_nr = serial_nr;
out:
rcu_read_unlock();
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index 6aa633cedfb0..5f2aea4d1c43 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -433,19 +433,6 @@ static inline void blkcg_unpin_online(struct blkcg *blkcg)
} while (blkcg);
}
-/**
- * blkg_path - format cgroup path of blkg
- * @blkg: blkg of interest
- * @buf: target buffer
- * @buflen: target buffer length
- *
- * Format the path of the cgroup of @blkg into @buf.
- */
-static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen)
-{
- return cgroup_path(blkg->blkcg->css.cgroup, buf, buflen);
-}
-
/**
* blkg_get - get a blkg reference
* @blkg: blkg to get
@@ -736,7 +723,6 @@ static inline struct blkcg *bio_blkcg(struct bio *bio) { return NULL; }
static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg,
struct blkcg_policy *pol) { return NULL; }
static inline struct blkcg_gq *pd_to_blkg(struct blkg_policy_data *pd) { return NULL; }
-static inline char *blkg_path(struct blkcg_gq *blkg) { return NULL; }
static inline void blkg_get(struct blkcg_gq *blkg) { }
static inline void blkg_put(struct blkcg_gq *blkg) { }
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 0/2] block: drive-by cleanups for block cgroup
2020-06-29 8:26 [PATCH v3 0/2] block: drive-by cleanups for block cgroup Johannes Thumshirn
2020-06-29 8:26 ` [PATCH v3 1/2] block: remove blk_queue_root_blkg Johannes Thumshirn
2020-06-29 8:26 ` [PATCH v3 2/2] block: open-code blkg_path in it's sole caller Johannes Thumshirn
@ 2020-06-29 13:48 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2020-06-29 13:48 UTC (permalink / raw)
To: Johannes Thumshirn
Cc: Tejun Heo, linux-block @ vger . kernel . org, paolo.valente
On 6/29/20 2:26 AM, Johannes Thumshirn wrote:
> While reviewing Christoph's bio cleanup series, I noticed
> blkcg_bio_issue_check() is way too big for an inline function. When I moved it
> into block/blk-cgroup.c I noticed two other functions which only have one or
> no callers at all, so I cleaned them up as well.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread