On Wed, Jan 5, 2022 at 3:33 AM cruzzhao <cruzzhao@xxxxxxxxxxxxxxxxx> wrote: > > Firstly, attributing forced idle time to the specific cpus it happens on > can help us measure the effect of steal_cookie_task(). We found out that > steal_cookie_task() conflicts with load balance sometimes, for example, > a cookie'd task is stolen by steal_cookie_task(), but it'll be migrated > to another core by load balance soon. I don't see how this is very helpful for steal_cookie_task(), since it isn't a targeted metric for that specific case. If you were interested in that specifically, I'd think you'd want to look at more direct metrics, such as task migration counts, or adding some accounting/histogram for the time between steal and load balance away. > Secondly, a more convenient way of > summing forced idle instead of iterating cookie'd task is indeed what we > need. In the multi-rent scenario, it'll be complex to maintain the list > of cookie'd task and it'll cost a lot to iterate it. That motivation makes more sense to me. Have you considered accumulating this at the cgroup level (ie. attributing it as another type of usage)?