Re: [RFC 01/16] blkcg:Introduce blkio.app_identifier knob to blkio controller

Tejun Heo
2020-08-05T19:23:32Z

Hello,

On Wed, Aug 05, 2020 at 10:44:56PM +0530, Muneendra Kumar M wrote:
> Our main requirement is to track the bio requests coming from different VM
> /container applications at the blk device layer(fc,scsi,nvme).
> By the time IO request comes to the blk device layer, the context of the
> application is lost and we can't track whose IO this belongs.

I see.

> In our approach we used the block cgroup to achieve this requirement.
> Since Requests also have access to the block cgroup via
> bio->bi_blkg->blkcg, and from there we can get the VM UUID.
> Therefore we added the VM UUID(app_identifier) to struct blkcg and define
> the accessors in blkcg_files and blkcg_legacy_files.
>
> Could you please let me know is there any another way where we can get the
> VM UUID info with the help of blkcg.

Using blkcg for identification does make sense given that that's the finest
granularity which also covers buffered writes. However, the proposed is akin
to adding per-thread application ID to procfs if it were per-thread instead
of per-cgroup, which wouldn't fly well either given the specialized and (at
least for now) niche nature of the feature.

So, my vague suggestion is putting the interface so that it fits the usage
scope and is close to whatever ultimate feature you wanna expose. I don't
think I'm the right person to make concrete recommendations here given the
lack of detailed context.

Thanks.

--
tejun