Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbdIOPvZ (ORCPT ); Fri, 15 Sep 2017 11:51:25 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:38469 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbdIOPvY (ORCPT ); Fri, 15 Sep 2017 11:51:24 -0400 X-Google-Smtp-Source: AOwi7QBNfYZ50yD32KKweMCXkRWX0pGDROLzp1HUDkxpRt/cBZjQ1XIQAuMHGZQlgIc8gjvL0tt3dA== Date: Fri, 15 Sep 2017 08:51:15 -0700 From: Tejun Heo To: Shaohua Li Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, lizefan@huawei.com, tglx@linutronix.de, kernel-team@fb.com, axboe@kernel.dk, Shaohua Li Subject: Re: [PATCH V3 1/4] kthread: add a mechanism to store cgroup info Message-ID: <20170915155115.GG378890@devbig577.frc2.facebook.com> References: <9649525546c2a69f22c7ec5a87858affece87160.1505422351.git.shli@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9649525546c2a69f22c7ec5a87858affece87160.1505422351.git.shli@fb.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 698 Lines: 20 On Thu, Sep 14, 2017 at 02:02:04PM -0700, Shaohua Li wrote: > From: Shaohua Li > > kthread usually runs jobs on behalf of other threads. The jobs should be > charged to cgroup of original threads. But the jobs run in a kthread, > where we lose the cgroup context of original threads. The patch adds a > machanism to record cgroup info of original threads in kthread context. > Later we can retrieve the cgroup info and attach the cgroup info to jobs. > > Since this mechanism is only required by kthread, we store the cgroup > info in kthread data instead of generic task_struct. > > Signed-off-by: Shaohua Li Acked-by: Tejun Heo Thanks. -- tejun