From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751568AbdGRRfz convert rfc822-to-8bit (ORCPT ); Tue, 18 Jul 2017 13:35:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41994 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbdGRRfy (ORCPT ); Tue, 18 Jul 2017 13:35:54 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5D2E6C04D2A4 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=longman@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5D2E6C04D2A4 Subject: Re: [PATCH 5/6] cgroup: implement cgroup v2 thread support To: Peter Zijlstra , Tejun Heo Cc: lizefan@huawei.com, hannes@cmpxchg.org, mingo@redhat.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, pjt@google.com, luto@amacapital.net, efault@gmx.de, torvalds@linux-foundation.org, guro@fb.com References: <20170717020721.3612468-1-tj@kernel.org> <20170717020721.3612468-6-tj@kernel.org> <20170717141409.sqafufjupsiffnri@hirez.programming.kicks-ass.net> <20170717142609.GC3519177@devbig577.frc2.facebook.com> <20170718172801.f56273tzgzn3xkne@hirez.programming.kicks-ass.net> From: Waiman Long Organization: Red Hat Message-ID: Date: Tue, 18 Jul 2017 13:35:51 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170718172801.f56273tzgzn3xkne@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 18 Jul 2017 17:35:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/18/2017 01:28 PM, Peter Zijlstra wrote: > On Mon, Jul 17, 2017 at 10:26:09AM -0400, Tejun Heo wrote: >> Hello, Peter. >> >> On Mon, Jul 17, 2017 at 04:14:09PM +0200, Peter Zijlstra wrote: >>> AFAICT this is not in fact what I suggested... :/ >> Heh, sorry about misattributing that. I was mostly referring to the >> overall idea of marking each cgroup domain or threaded rather than >> subtree. >> >>> My proposal did not have that invalid state. It would simply refuse to >>> change the type from thread to domain in the case where the parent is >>> not a domain. >>> >>> Also, my proposal maintained the normal property inheritance rules. A >>> child cgroup's creation 'type' would be that of its parent and not >>> always be 'domain'. >> But aren't both of the above get weird when the parent can host both >> domain and threaded children? >> >> R >> / >> A(D) >> >> If you create another child B under R, it's naturally gonna be a >> domain. Let's say you turn that to threaded. >> >> R >> / \ >> A(D) B(T) >> >> And now try to create another child C, should that be a domain or >> threaded? > Domain of course, as R must be a domain, and hence all its children > start out as such. > >> If we only inherit from the second level on, which is in itself >> already confusing, that still leads to invalid configs for non-root >> thread roots. > I don't see how. I don't get the example Waiman gave, what is wrong > with: > > R (D) > | > A (D) > / \ > C(D) B(T) > > ? Afaict that's a perfectly valid configuration. >>From what I understand, C is considered to be in an invalid state because of the no internal process rule. A in this case is the thread root, so it can have internal process. If C is a domain and a child of A, we will have the case that internal processes in A is competing against cgroup C. I have been advocating (in one of my RFC patches) that we should relax the rules to allow internal processes when only threaded controllers are enabled as they are supposed to be able to handle internal processes. Cheers, Longman