[PATCH 4/4] blk-iocost: Correct comment ioc_gq::level

Michal Koutný posted 4 patches 1 month, 3 weeks ago
[PATCH 4/4] blk-iocost: Correct comment ioc_gq::level
Posted by Michal Koutný 1 month, 3 weeks ago
This comment is simpler than reworking level users for possible
ioc_gq::ancestors __counted_by annotation.

Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 block/blk-iocost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index b4eebe61dca7f..c5e09ebae5ab0 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -545,7 +545,7 @@ struct ioc_gq {
 	u64				indebt_since;
 	u64				indelay_since;
 
-	/* this iocg's depth in the hierarchy and ancestors including self */
+	/* this iocg's depth in the hierarchy and ancestors excluding self */
 	int				level;
 	struct ioc_gq			*ancestors[];
 };
-- 
2.52.0

Re: [PATCH 4/4] blk-iocost: Correct comment ioc_gq::level
Posted by Tejun Heo 1 month, 3 weeks ago
On Wed, Dec 17, 2025 at 05:27:36PM +0100, Michal Koutný wrote:
> This comment is simpler than reworking level users for possible
> ioc_gq::ancestors __counted_by annotation.

I don't understand the change here. Can you please elaborate a bit more?

Thanks.

-- 
tejun
Re: [PATCH 4/4] blk-iocost: Correct comment ioc_gq::level
Posted by Michal Koutný 1 month, 3 weeks ago
On Wed, Dec 17, 2025 at 06:57:05AM -1000, Tejun Heo <tj@kernel.org> wrote:
> On Wed, Dec 17, 2025 at 05:27:36PM +0100, Michal Koutný wrote:
> > This comment is simpler than reworking level users for possible
> > ioc_gq::ancestors __counted_by annotation.
> 
> I don't understand the change here. Can you please elaborate a bit more?

ioc_gq::ancestors includes self but ioc_gq::level doesn't count it in
(level=0 is root, that's like cgroup's level, from which it's copied in
ioc_pd_init()). Therefore ioc_gq::level cannot be used as size hint of
the ancestors array :-/ (The comment in the original form tempted to
simply use __counted_by(level). I see a comment for each member would be
the clearest.)

I'm open to more remarks or questions.

Michal