From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753040AbdCPRKn (ORCPT ); Thu, 16 Mar 2017 13:10:43 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:36657 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692AbdCPRKk (ORCPT ); Thu, 16 Mar 2017 13:10:40 -0400 Date: Thu, 16 Mar 2017 13:03:21 -0400 From: Tejun Heo To: Oleg Nesterov Cc: Linus Torvalds , Andrew Morton , Peter Zijlstra , Thomas Gleixner , Chris Mason , linux-kernel@vger.kernel.org, kernel-team@fb.com, Li Zefan , Johannes Weiner , cgroups@vger.kernel.org Subject: Re: [PATCH 2/2] kthread, cgroup: close race window where new kthreads can be migrated to non-root cgroups Message-ID: <20170316170321.GF15810@htj.duckdns.org> References: <20170315231827.GA13656@htj.duckdns.org> <20170315231920.GB13656@htj.duckdns.org> <20170316150233.GB24478@redhat.com> <20170316160544.GC15810@htj.duckdns.org> <20170316161756.GA27613@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170316161756.GA27613@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Mar 16, 2017 at 05:17:57PM +0100, Oleg Nesterov wrote: > But this also means that __cgroup_procs_write() will always fail if > this task is a kernel thread which was not created by kthread_create(). > > Currently you can use kernel_thread() (although you shouldn't) and it > can be migrated, this won't work after your patch. I see what you mean now. The only users seem to be init/main.c and kernel/kmod.c. I'll see if there's a way we can do this only for kthread_create() users. Thanks. -- tejun