From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbdCPRl7 (ORCPT ); Thu, 16 Mar 2017 13:41:59 -0400 Received: from mail-yw0-f181.google.com ([209.85.161.181]:35788 "EHLO mail-yw0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbdCPRlx (ORCPT ); Thu, 16 Mar 2017 13:41:53 -0400 Date: Thu, 16 Mar 2017 13:41:14 -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: <20170316174114.GG15810@htj.duckdns.org> References: <20170315231827.GA13656@htj.duckdns.org> <20170315231920.GB13656@htj.duckdns.org> <20170316150233.GB24478@redhat.com> <20170316153925.GA26391@redhat.com> <20170316160734.GD15810@htj.duckdns.org> <20170316163158.GB27613@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170316163158.GB27613@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:31:59PM +0100, Oleg Nesterov wrote: > Or we can add another "unsigned no_cgroups:1" bit into task_struct, > not sure. To synchronize around initialization, a PF flag would be easier as we can use wait_on_bit(). > Anyway, I do not understand the PF_NO_SETAFFINITY check in > __cgroup_procs_write(). task_can_attach() checks it too, so cgroups > can't change the affinity. Imo something explicit like no_cgroups > makes more sense. task_can_attach() predates the __cgroup_procs_write() and currently doesn't do anything. We can split the flag or rename it so that it's more generic. The reasons for disallowing cgroup migration have a lot of crosssection with affinity, so it's not a complete misnomer. Either way is fine by me. Thanks. -- tejun