Re: [RFC PATCH] proc: add support detach proccess's autogroup
From: Weiping Zhang
Date: Thu Jul 02 2020 - 06:22:07 EST
On Thu, Jul 2, 2020 at 4:18 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Thu, Jul 02, 2020 at 01:20:43PM +0800, Weiping Zhang wrote:
> > Since setid will create a autogroup for that process, there is no
> > way to detach a process from that autogroup, this patch add a new interface
> > to detach a process from its autogroup. You can write anything to
> > /proc/<pid>/autogroup_detach to do that.
>
> This is indeed what the patch does; but it fails to tell me why. Why do
> we want this? Why should I care about your patch :-)
>
> Please, always explain why you want things done, that can also help us
> consider if the proposed solution is the right one.
The reason is that, there are lots of autogroup created in our system, because
I forgot to disable CONFIG_SCHED_AUTOGROUP, and it leads to a hotspot
in tg_load_down (kenrel-3.10.0-514.16.1.el7.x86_64).
When user login system by ssh and launch a background job, it will create a
new autogroup even user logout ssh.
I cannot find a way do clear these unused autogroup by current kernel,
so I write a separate module to clear those unused autogroup for my system.
I think we should provide a interface to detach a process's autogroup.
Thanks