Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp587396pxb; Thu, 5 Nov 2020 07:54:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEziSRUITUPBRIUHxX58iXSuSGHAVwyG9cgAR/DWlyjHbXFlNh4YWF8xcYyeEQ/vqgO+fA X-Received: by 2002:a17:906:314d:: with SMTP id e13mr3030274eje.412.1604591674174; Thu, 05 Nov 2020 07:54:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604591674; cv=none; d=google.com; s=arc-20160816; b=HVPRAuowryP+fLVtc6lIwZ25c59Abt9YV/SG4Usm6TFwn+1XakFN2P9PojX5w74hva 8QboTgRO+DKQ9KmUEcoGUo18VxtqNq4zmz+Kf/aJPFc13B8Pqwr/TpWHhf8FN+o0ftIT 86H3xeGEVfkKqVYpWWOWJi2EaREd6PvJ2YfROSP2Py7CYqhvV0oOhUkf4/HORp8OkRt7 OY2dlzC95f6q12dlmL4OnWEV/esF0dpBm5qw7SK4mh3QJtC6Mrp7nChEYCZD6T12GbgD KzMRlI69RaUSXq8JItdy/ZGiggygRWt/OYuN0V/zfZJwdqbhd5v+CiBdJ5HaGuyVmea+ dXOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K9PC5HZiLJNVyfvlScE/CP6VZlOUSE6C4WbZdtaM3eQ=; b=Jpo5TWn93VH7tvR/7YxU0Be+f253BpaYQotw7YT07AzrhDB0fXW1gWhzUFBWLuLJIL 6W9ST3zvQdKeeuJpz3RtQ0z/Yn88S/u5mc3TG0S5PhVwd8HpnL+f2J6MsoMczNsjh+wK 5JJ1bBEC4XoL0c1vWu3WeWuOqcEXEBtFMZ5mp6P4xurO2O+zoWI35GgWSujs1U5i4W8J W5WnYa+WZrLzzJYfURzSjgDVeDE68HnYrhrbDzNfBHwkkxvW1Jb/a+/yQDdINuyJcioo /ENhRr4AMSHaF2wIa8GLmY+3XB0wf0D+0/QTYETOLNy8lPhxm/bwBnrJiLvOL6nNFYmK 1r/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=AreWm3OX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si1453534edj.42.2020.11.05.07.54.11; Thu, 05 Nov 2020 07:54:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=AreWm3OX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731560AbgKEPwI (ORCPT + 99 others); Thu, 5 Nov 2020 10:52:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730862AbgKEPwH (ORCPT ); Thu, 5 Nov 2020 10:52:07 -0500 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC923C0613D2 for ; Thu, 5 Nov 2020 07:52:07 -0800 (PST) Received: by mail-qv1-xf41.google.com with SMTP id dj6so894217qvb.3 for ; Thu, 05 Nov 2020 07:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=K9PC5HZiLJNVyfvlScE/CP6VZlOUSE6C4WbZdtaM3eQ=; b=AreWm3OXjMQZ4P/O9iPHoIatJ6wQwEAZXRXXE6hXpbj8+1RRoGDd0eZd2SiElGcewp IZyBL71lNL43ipq179DWqAs9kpWXT4hTBbZzY02nBm/8n5tpUGyKlYpbex4jZUcrbMAO B3UA+DoMCQlO87cQtUsr562LZDYfL6RI7RJ0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=K9PC5HZiLJNVyfvlScE/CP6VZlOUSE6C4WbZdtaM3eQ=; b=VglQLy9BzkuxRkS7ESwwnuEn8lRFIsBX8B9/id46i2WInDgIrbnajgfDyw3XasNpvt JEoz7ISJgYxJR8MbnIidoAloRtd/fQvUJZtU6X/qtoIUTmXOFRrByItevWiyvXsOHPQU pPV0NpKFqe+/gP0eupAySP052wfw6ez1rZkUdlpXsg+eI7CHMFoCjFZnMutFHCF/Lcid AL58jMUXNQREYw0jDOrEZYGkKgyN2j1T+bF4uczSjZAglN3alUoxCTOZtnWVh9g98YJx oyr7T8ai0ON2cBvaT0ASmzyp71CtVQVMl7BqOemXZEN/lhL1tJVWfSNMAS6mzOIPhu14 Vc9A== X-Gm-Message-State: AOAM530cGCXTV2nS/MNXDTr7toztA7JlJgDgLxLWymEICUPuuFsG4vs7 e1XnohEPIsNaLcEuMipsMozxxA== X-Received: by 2002:a05:6214:10c4:: with SMTP id r4mr2801058qvs.62.1604591526877; Thu, 05 Nov 2020 07:52:06 -0800 (PST) Received: from localhost ([2620:15c:6:411:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id h82sm1227161qke.109.2020.11.05.07.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 07:52:06 -0800 (PST) Date: Thu, 5 Nov 2020 10:52:05 -0500 From: Joel Fernandes To: "Li, Aubrey" Cc: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, pjt@google.com, rostedt@goodmis.org, derkling@google.com, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , jsbarnes@google.com, chris.hyser@oracle.com, "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH v8 -tip 19/26] sched: Add a second-level tag for nested CGroup usecase Message-ID: <20201105155205.GC2656962@google.com> References: <20201020014336.2076526-1-joel@joelfernandes.org> <20201020014336.2076526-20-joel@joelfernandes.org> <6c07e70d-52f2-69ff-e1fa-690cd2c97f3d@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c07e70d-52f2-69ff-e1fa-690cd2c97f3d@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2020 at 02:23:02PM +0800, Li, Aubrey wrote: > On 2020/10/20 9:43, Joel Fernandes (Google) wrote: > > Google has a usecase where the first level tag to tag a CGroup is not > > sufficient. So, a patch is carried for years where a second tag is added which > > is writeable by unprivileged users. > > > > Google uses DAC controls to make the 'tag' possible to set only by root while > > the second-level 'color' can be changed by anyone. The actual names that > > Google uses is different, but the concept is the same. > > > > The hierarchy looks like: > > > > Root group > > / \ > > A B (These are created by the root daemon - borglet). > > / \ \ > > C D E (These are created by AppEngine within the container). > > > > The reason why Google has two parts is that AppEngine wants to allow a subset of > > subcgroups within a parent tagged cgroup sharing execution. Think of these > > subcgroups belong to the same customer or project. Because these subcgroups are > > created by AppEngine, they are not tracked by borglet (the root daemon), > > therefore borglet won't have a chance to set a color for them. That's where > > 'color' file comes from. Color could be set by AppEngine, and once set, the > > normal tasks within the subcgroup would not be able to overwrite it. This is > > enforced by promoting the permission of the color file in cgroupfs. > > > > The 'color' is a 8-bit value allowing for upto 256 unique colors. IMHO, having > > more than these many CGroups sounds like a scalability issue so this suffices. > > We steal the lower 8-bits of the cookie to set the color. > > > > So when color = 0, tasks in group A C D can run together on the HTs in same core, > And if I set the color of taskC in group C = 1, then taskC has a different cookie > from taskA and taskD, so in terms of taskA, what's the difference between taskC > and [taskB or taskE]? The color breaks the relationship that C belongs to A. C does belong to A in the sense, A cannot share with B, this implies C can never share with B. Setting C's color does not change that fact. So coloring is irrelevant in your question. Sure, A cannot share with C either after coloring, but that's irrelevant and not the point of doing the coloring. thanks, - Joel