Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp677121pxu; Tue, 1 Dec 2020 23:58:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6bQtKqBAEjGQvtl7K7bYO01EeNuU+4X1W6XbJMrVRSpziQW8X0kLxWkh6XdezOjHCW1k4 X-Received: by 2002:a17:906:3b4d:: with SMTP id h13mr1127959ejf.289.1606895932637; Tue, 01 Dec 2020 23:58:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606895932; cv=none; d=google.com; s=arc-20160816; b=FqWulCz7fyAn9p3veHKEbFSNdOuuA1ZcGkLdtvdGI6ULjfSwFoIKlsz+yPZMbUnW0p jIkQIiyxNb7aVaQVQLF06xAw4QSYq8rspbcSFkY4OBqhJg64QEdi9LEPgdc/nZ9moWhD BpfVvK8hCysOpxXsIm02Hzr3eSI9FWeB9T8hRt4u+QVXqZKiXxTTWUe3+IjFpMVZwx9l ZSOAuf2F0IoXSd7n2Amnbw9pPpMH1kxI5UqyUXYeHalOTTZGbw1BUiO8MPN+JI2tV1L6 XXKQE8qaB4tC6fxDNe4dTii813Uk3CfletsfeREyxTbT33B7hpi1xUupUaghHnutXQP9 XmuA== 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=H2WKhUPCiAxV/zU7tZhzPn1+a6z3ubuLC4c5dn/7IRU=; b=oQGcSnzD32lODZQBjTF6ys6AZv4Ev6HSa5cEOIfOpqd81tlBjravUaLlq50NT089M9 Vr2hkXdunLy2Yl3kXmganb3xg2UJswRmoPFXrL+2cS9VDjsTfe9vjxPPG9Re0aWJHX+a AD8PLk86lOvioqdWHsmxZ/LxYUnFEIxuMBi+PhCBYHpUUoNVNrG0g0xRPND3I5Iv1tRT PgpcJjrFLk4YqVXoM3YmIGtCHzUKA81fIJUEtD3zmmfGg8c7ZNwEJzvsMcgFp2GVnMnO 3qWaAXp6IMqEfxZ1/z7D9elY/e3DIlduvWkbc9pE4ypYIF9iFZRrvgxRLNfsUtKznTpN pmrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=vs1BP9UT; 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 v25si547059edy.23.2020.12.01.23.58.29; Tue, 01 Dec 2020 23:58:52 -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=@infradead.org header.s=merlin.20170209 header.b=vs1BP9UT; 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 S1728808AbgLBH4j (ORCPT + 99 others); Wed, 2 Dec 2020 02:56:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgLBH4i (ORCPT ); Wed, 2 Dec 2020 02:56:38 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815EAC0613CF for ; Tue, 1 Dec 2020 23:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=H2WKhUPCiAxV/zU7tZhzPn1+a6z3ubuLC4c5dn/7IRU=; b=vs1BP9UTQMUUZlKTDWcpx5f2bM pduXMgG84yVwYMuR441VDta3T/GqywmDq0DamKT1KzE4+9L/BBjk6L2XyxcpOhPoqnGiiiMM6OoHJ 7sYo3gjx4QfrojS1v5bnqjmtmoNc52HMkm3utbb/UPP//WKeZlfdq0Wm5liHJyEJvkWac2MYnOZoE bAvFH0dwW6lq1viGg1fR76SjZ/1vh8xgo+cy9PjlM4A60eyULasexKz18F/DPX4btWHKW5fYHitsN Fbt3bqq2g9YuXL+gzs2XtxzY03V6sTTSowkdhFNM6w/cBmBoumbwyOoHF7q8/Uojz45JCfNyr0J2y 7Dti8I3A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkMyX-0001eI-2S; Wed, 02 Dec 2020 07:54:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BED23305C10; Wed, 2 Dec 2020 08:54:47 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 956A02C83017B; Wed, 2 Dec 2020 08:54:47 +0100 (CET) Date: Wed, 2 Dec 2020 08:54:47 +0100 From: Peter Zijlstra To: Josh Don Cc: Joel Fernandes , Nishanth Aravamudan , Julien Desfossez , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , Thomas Gleixner , linux-kernel , mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, Kees Cook , Greg Kerr , 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, Paul Turner , Steven Rostedt , Patrick Bellasi , benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , Jesse Barnes , chris.hyser@oracle.com, Ben Segall , Hao Luo , Tom Lendacky , Aubrey Li , "Paul E. McKenney" , Tim Chen , Oleg Rombakh Subject: Re: [PATCH -tip 22/32] sched: Split the cookie and setup per-task cookie on fork Message-ID: <20201202075447.GC3021@hirez.programming.kicks-ass.net> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-23-joel@joelfernandes.org> <20201125111014.GS2414@hirez.programming.kicks-ass.net> <20201201192028.GA222419@google.com> <20201201193451.GY3040@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 01, 2020 at 10:36:18PM -0800, Josh Don wrote: > On Tue, Dec 1, 2020 at 11:35 AM Peter Zijlstra wrote: > > > > So I don't think that later patch is right... That is, it works, but > > afaict it's massive overkill. > > > > COOKIE_CMP_RETURN(task_cookie); > > COOKIE_CMP_RETURN(group_cookie); > > COOKIE_CMP_RETURN(color); > > > > So if task_cookie matches, we consider group_cookie, if that matches we > > consider color. > > > > Now, afaict that's semantically exactly the same as just using the > > narrowest cookie. That is, use the task cookie if there is, and then, > > walking the cgroup hierarchy (up) pick the first cgroup cookie. > > > > (I don't understand the color thing, but lets have that discussion in > > that subthread) > > > > Which means you only need a single active cookie field. > > > > IOW, you're just making things complicated and expensive. > > > > For the per-task interface, I believe we still want to prevent two > tasks that share a task cookie from sharing an overall cookie if they > are in two separately tagged groups (Joel please correct me if I'm > mistaken there). That's why in Joel's older patch, the overall cookie > was a combination of the task and group cookies. My concern about > that was the potential cookie collision. Then disallow sharing a task cookie when the tasks are in different cgroups or disallow cgroup movement when they share a cookie.