Re: [PATCH] cgroup: minor optimization around the usage of cur_tasks_head

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 26, 2022 at 02:17:05PM +0000, Yafang Shao wrote:
> Recently there was an issue occurred on our production envrionment with a
> very old kernel version 4.19. That issue can be fixed by upstream
> commit 9c974c772464 ("cgroup: Iterate tasks that did not finish do_exit()")
> 
> When I was trying to fix that issue on our production environment, I found
> we can create a hotfix with a simplified version of the commit -
> 
> As the usage of cur_tasks_head is within the function
> css_task_iter_advance(), we can make it as a local variable. That could
> make it more clear and easier to understand. Another benefit is we don't
> need to carry it in css_task_iter.
> 
> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
> Cc: Michal Koutný <mkoutny@xxxxxxxx>

I can't tell whether this is better or not. Sure, it loses one pointer from
the struct but that doesn't really gain anything practical. On the other
hand, before, we could understand where the iteration was by just dumping
the struct. After, we can't. At best, maybe this change is a wash.

Thanks.

-- 
tejun



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux