Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp918064pxu; Thu, 3 Dec 2020 16:25:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzy3P6hVt2aflWutN7wejoCFw8yIaOnMR0BXPRTn7E8KWLU4B6VVnTrcevgu8+i+ROeqEPG X-Received: by 2002:a17:906:3102:: with SMTP id 2mr4875088ejx.135.1607041544282; Thu, 03 Dec 2020 16:25:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607041544; cv=none; d=google.com; s=arc-20160816; b=0Ig/oDgjb1m/TSKjh6LvcgilepeGDO+FZUtOlTz1asi2Dy+m5dZQQZ/ZXymw7+/z0F 1k4shBLmMjNlGW03dgQSooQFqWDNybelIq0G6dvnK7ucUxn82vZJHY0mfvHAPgR+zB2I bv2N1+TtpUlPEgdymbB0lmjNCUvtfpkp31YtPw422+drypk77l9OjJhHkJ3Kw49Fp2u0 5EPls58xHrPwNmoMtuy8CN0+c0He5AVsfGOHUmXHt4XiRbxEx+MKXoHtM7BaOEw1NVz2 d8j2tjqQVHweggJ91XUZVwk2aFyRafVdpQ+izko0Pl9Jwm6988ECHb7EdxnDYurJZf8k 7csA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s6cHrD+hDcDbuThecWmZmMZN5skYLKJ6DKcVcZzyV+Y=; b=yYP0cVhiRLwMktSjRdvhkH6mnFL36gDdpjZP31YS9OqX8qw/u9StwAxPmji4gCo/hT HgrieQSFyE3z0RlE3sv5Y6aupP703+ZsRLrmny3eJVvKUVOa8U6Wok3pd1Zs1B5QOC7v P4g6g9bnMmVwDHMm4y5807aNInil1Ccgciz+ArBwVcP3tk+xfHoWMLIkBxlWLf1Q35xl 5K7EE5tWQqXaVtQT9UsPJdfPexRp5QEgHksgVdpgSl3lqUh7DEwtbLuVzsaEZmRmvEpJ KhuHNe2mJN13GSdYdTKwzg7i3GjYPY6k3gb9RukhJ/oN76WbkodKP8pdnwNKP9d4u3LC UJpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aXVHLdNX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si410426ejt.452.2020.12.03.16.25.20; Thu, 03 Dec 2020 16:25:44 -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=@google.com header.s=20161025 header.b=aXVHLdNX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727193AbgLDAVP (ORCPT + 99 others); Thu, 3 Dec 2020 19:21:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726356AbgLDAVP (ORCPT ); Thu, 3 Dec 2020 19:21:15 -0500 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6EB3C061A4F for ; Thu, 3 Dec 2020 16:20:34 -0800 (PST) Received: by mail-qv1-xf30.google.com with SMTP id 62so1962557qva.11 for ; Thu, 03 Dec 2020 16:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s6cHrD+hDcDbuThecWmZmMZN5skYLKJ6DKcVcZzyV+Y=; b=aXVHLdNXp+dDWXUJIior7k8202+QFoR3nFZHHXuVH4ygxjquHKbOO3nqqAnPpwSdoO wx2Upp7S4R542wkAR4SQDVHNtLDwNWWdb7zr0Ror0X0mUMhBKqypSgLOVBWZ9ztrH4v6 Jl/4W0dCv5KDFcT66pU8/gd5XhdiBu9uU+BQvHFNj14/2p1zpFhP55u+iePzk2i0J38k j5jOmCXCK3uQ3gAlGnouWTnC4ZE/CkvL1c3nBUMfjh1tVR0ttuAqA1K05dTJK2cDqT1V gMzyu16hQs2C5IYUaa3kdWaUYS0yB8R1waunQXcxgfDM+mwVxt9ZGfPj0oCMrEIcSgrh geEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s6cHrD+hDcDbuThecWmZmMZN5skYLKJ6DKcVcZzyV+Y=; b=Xa/Ndd+HT6zDgz+NambvYytylYE8SubZWxr90DqhxmOST04M7OodCRqS3kV7NdLXYW acOLlxoPxJB1o28At9rrQxC38droTAJZVxI5DVDuyjhyBbZdPOb6EnUlElmWv6WmDPX+ 9Fs/365DKeMe/Gbi5Qc9Lh1uqBeNi9UtKWr69f0ZkSNjy3+gC8x5ykGDhU4s6Vqd4WJp dyYzDvoad7p7+eVoklgL1y4mDvy+Cce/Vw1+qkWM2u5+ZP+l4ObcbKY8K9QHgRo7bzmx bYbH+GMVhyajVB+pAvtA7DKntWoYMpaHaJQ9SbJooBy1I1k+g8LwbLG2jXipjPDfo4iO g0Vw== X-Gm-Message-State: AOAM530jIUDd2vgZI2SaNsCFJoTzZVsr5mmic/umcfT1zLX6FS7SRN6v mLZ/GTtoYeSIgIjmre6/ByCoed+P15imNbwZ/whTBw== X-Received: by 2002:ad4:4745:: with SMTP id c5mr2007040qvx.2.1607041233599; Thu, 03 Dec 2020 16:20:33 -0800 (PST) MIME-Version: 1.0 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> <20201202075447.GC3021@hirez.programming.kicks-ass.net> In-Reply-To: <20201202075447.GC3021@hirez.programming.kicks-ass.net> From: Josh Don Date: Thu, 3 Dec 2020 16:20:22 -0800 Message-ID: Subject: Re: [PATCH -tip 22/32] sched: Split the cookie and setup per-task cookie on fork To: Peter Zijlstra 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 11:55 PM Peter Zijlstra wrote: > > Then disallow sharing a task cookie when the tasks are in different > cgroups or disallow cgroup movement when they share a cookie. Yes, we could restrict task cookie sharing to tasks that are in the same cgroup. Then the cookie easily just becomes a single value; either the task cookie or group cookie. The advantage of the approach with the cookie struct is that it is easily extensible, and allows for trust models that don't conform exactly to the cgroup hierarchy (ie. our discussion on cookie color). The overhead of the approach seems tolerable, given that updates to a task's cookie are not in fast paths (ie. prctl, setting cgroup cookie, sched_move_task). Are you more concerned with the added complexity of maintaining the RB tree, refcounts, etc?