Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp324461pxu; Tue, 1 Dec 2020 12:11:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTZkrkHFxiN6eSvtQhvtRoNspqkER/n4z60JNmx5NtO3U+leW3tlz1fjzeAniMqn2/1uOF X-Received: by 2002:a17:906:38d6:: with SMTP id r22mr4675822ejd.149.1606853469740; Tue, 01 Dec 2020 12:11:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606853469; cv=none; d=google.com; s=arc-20160816; b=CgmBsgzGtNuC4bGGvv0xKMGIkRaF4Ivt652+I1w03R9cuWmN0DUyqgvQIEnOetruIP OhnVUTSCDMZkgCm0eKES+UHrxO66h2hrsTX0AW3Sz3vCFme1Me5keqbhMgwgfL8WQy2j S8CEdYqZVkylyi0DFVcHMcpqvyCeaQa+kpaew93c9ITlGzcJyk66YzQbkfIUQ2y6jwlH eWh3UKl0NkrygdFM5exzyVparltVJGdwR4rlDo7Q3chCLABlp9NGEA3AeSkrxvmlmv2Q l1t0TDqhyg4wFH9IqkhPzAJFmwBlN3lTEgQ3OogP5ujm/qZy+vAbW9f7J4YM+O3uBQcr 7STg== 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=Rzel40zSudejgIjeov/IizCnVcxFKEcYDOuHATdDn1Y=; b=riVq8nI60tTJc1GPCeXWOrMGkU1SYAhc3kt0Cnym+ZkNY2LqEDRRm4TLnZT7CXisqC 4tgV/S4LR9BWKH5mhVPj+RlXkNgc0OO2wzVMbQzpm1cgSKt+1mtsWnE07XAp4RmoTOq2 Ux1r0TYrC9+zeIIIk1IUe7/kIA8OGHuYe7gpdxDkec9NJSdaIJyQpbLaj/hjxOEg0/io ZfroSFg0IFEWC2KLuLmfvy6foT+aiyAYtywGi4L4zjaOdHDKcQeNVzFCoJFEbBj+5iz7 Ls9F/DDFGKiUA+tqIMOHWbccW8n7VbY+TRZf+P9xTHSc5ugmntFcQ45yHOvjWIYkK3uW QlnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=m+O9c0ZJ; 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 w27si582369ejc.555.2020.12.01.12.10.46; Tue, 01 Dec 2020 12:11:09 -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=m+O9c0ZJ; 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 S2404398AbgLAUJU (ORCPT + 99 others); Tue, 1 Dec 2020 15:09:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392341AbgLAUJT (ORCPT ); Tue, 1 Dec 2020 15:09:19 -0500 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B2FC0613CF for ; Tue, 1 Dec 2020 12:08:39 -0800 (PST) Received: by mail-qk1-x72c.google.com with SMTP id q5so2584305qkc.12 for ; Tue, 01 Dec 2020 12:08:39 -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=Rzel40zSudejgIjeov/IizCnVcxFKEcYDOuHATdDn1Y=; b=m+O9c0ZJGiiiIEpOnhSk1nsDkDSieTY5j5gdo2mPNGjjLo153Eh3W0I3+7bwRghcsp N8FH1aj7QaMrVltKRMylAHSLyKz7SQb6zxgAj26zYH9Q6aJwkBsJz+eQpwKNzRdF+rKb gEP7OfIhjwYpB1iZ91PMyRsgqSxDfFiVExkqo= 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=Rzel40zSudejgIjeov/IizCnVcxFKEcYDOuHATdDn1Y=; b=oJZQt28T3dFNXMDy3X/IrSQPQUYeaPTLOMlMRU2+4P1juP5JKqE4ElvxhGC/rWsqwS 5XSI//JwvRuWrrAWhN+R7AkqLR7NJP+679v69Oq5B27eJ2PWtsIwgwbo1nwy668LZB/S uEmxLzBwhwIe3PZPUYhXsCx8QHopTisMJrAWLjK0M/2fXyg1EIDthJeRbOfn2uMebEqx bKZxujkblNXDRMOxVBu8V9bXriseX4CNE1aebGL2jEkq321Gx08c43y3DWoeMGjVJ5j/ Cjh3/cJhHYFOhiE6k+kNygo9JcOEcDwnAivjkkiCjjTpDFwYJUEeUI/oy1Z618WXflq2 bu3g== X-Gm-Message-State: AOAM530Up/E1szJmJ9DiMzYM6kRe5Ihj2e1+HInnXmZZxspQjjqGIW/O kLwsx08qCDKkzTFhrjjccyXswg== X-Received: by 2002:a05:620a:632:: with SMTP id 18mr4682664qkv.173.1606853318835; Tue, 01 Dec 2020 12:08:38 -0800 (PST) Received: from localhost ([2620:15c:6:411:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id r89sm768703qtd.16.2020.12.01.12.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 12:08:38 -0800 (PST) Date: Tue, 1 Dec 2020 15:08:37 -0500 From: Joel Fernandes To: Peter Zijlstra Cc: Nishanth Aravamudan , Julien Desfossez , 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, Ben Segall , Josh Don , Hao Luo , Tom Lendacky , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH -tip 26/32] sched: Add a second-level tag for nested CGroup usecase Message-ID: <20201201200837.GA226869@google.com> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-27-joel@joelfernandes.org> <20201125134237.GZ2414@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201125134237.GZ2414@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Wed, Nov 25, 2020 at 02:42:37PM +0100, Peter Zijlstra wrote: > On Tue, Nov 17, 2020 at 06:19:56PM -0500, Joel Fernandes (Google) wrote: > > From: Josh Don > > > > 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. > > Why can't the above work by setting 'tag' (that's a terrible name, why > does that still live) in CDE? Have the most specific tag live. Same with > that thread stuff. There's 2 parts that Google's usecase has. The first part is set by a privileged process, and the second part (color) is set within the container. Maybe we can just put the "color" feature behind a CONFIG option for Google to enable? > All this API stuff here is a complete and utter trainwreck. Please just > delete the patches and start over. Hint: if you use stop_machine(), > you're doing it wrong. Ok, the idea was to use stop_machine() as in your initial patch. It works quite well in testing. However I agree with its horrible we ought to do better (or at least try). Maybe we can do a synchronize_rcu() after changing cookie, to ensure we are no longer using the old cookie value in the scheduler. > At best you now have the requirements sorted. Yes. thanks, - Joel