Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp638597pxu; Tue, 1 Dec 2020 22:38:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2IGTie0jQzcw7scqlfJRpjgYAzwqf9sLRxKpq+uIvDCTGTASppd34ebinmXbhB7e2yWMo X-Received: by 2002:aa7:d40f:: with SMTP id z15mr1186446edq.172.1606891133423; Tue, 01 Dec 2020 22:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606891133; cv=none; d=google.com; s=arc-20160816; b=RNE02WsK/IyrMXa9/cJ98OaD8CRAF0XoYM0D8Ry3KNso4C6MVv2ViG0uy3Oowjpk+V /iZ6IcJEqa0UDGPPEHQdx45aNW0hLA29X2vCSeaTOVAjEeNxiJwht5axQGBj5KS8+pF0 7vhJjPTIEdF5YxypNEt2SHYp7O2A6jT/HxYRugcsG1KUz+GNgCyrxnQFqoUp/6uNQhhs w1oThXmAiNSjkJUC+mK/Dfi1J5pGTcX8Ad5YodvuHWqiR8RNv8Dov1NRjFx1gsGa1tKH 8Z4lP6433ZW7/dWJQZh9Z65fKwnNXAUTnPXPbocqGEOWWsZZSPIAa7wZzh4iZ/nzOlty RyxA== 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=j14UEcKmJgy4lNmxfpEAdBtZK/nOSuRQd1wQuM4Od1E=; b=xHaoEzgN30UZH148QzHh631BWIdsGY1IcSzmmFpHmZ19FF/itrZbFuDGgkOmcso34I e7SvTnhdvO/ePY/vTn4wavGHsbpDyoq3tinpKp4tqzu/pu/vG8H+t8PNj/sjK3qJ/Atl uaGwn50WF3WzGbdRuR8z7v15fh0d1DfAsomutVys+bB26KaOusPlS3FYVyyPCbZnH5Mg HxEWn99t0RsNVgsNOdByePAtUx1FxW/ysVAiNrrkHs9kZTqvw8TtBVyQk9xKSYjyFyiK Uh6Zfh4A6k8Y5SDA3FyfWYpiTs+L5LBVhGtVMeQVt8l+o0HCaU/fKmVE9LOZ6Fit0U/Y l/ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RTD0vff3; 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 o31si493076edd.172.2020.12.01.22.38.30; Tue, 01 Dec 2020 22:38:53 -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=RTD0vff3; 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 S1727529AbgLBGhM (ORCPT + 99 others); Wed, 2 Dec 2020 01:37:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727069AbgLBGhL (ORCPT ); Wed, 2 Dec 2020 01:37:11 -0500 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443EAC0613CF for ; Tue, 1 Dec 2020 22:36:31 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id z3so334292qtw.9 for ; Tue, 01 Dec 2020 22:36:31 -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=j14UEcKmJgy4lNmxfpEAdBtZK/nOSuRQd1wQuM4Od1E=; b=RTD0vff3lrnnpN6BMiGm5i+HzyAIgWqLaUkwzRpoxkxqdNqpAKL9yXe7H3uG/tFSPX Qe6xvPqvTAYKBy5t3STMzHOrpMsPIpVNWDyuSpMCQnWMK6rRwHoS1jwsJpA78NXye3KD 5gKiqcDtkWDZt5coGI/T3Cj5o2pvO++q6tbw02ozfOD2+M5ZcGHF2VwVLzfGJmmkQ4K+ ESm+aYByF1KmN77hvFSOHgrgtUieyZo7otkH6jaTrbHT0NJYlmIFfewmszqvEWY6ytgM lCPDseK9C+FnZx3AVtPLiK1CGpYPm6VKaPrQnuiIgFPjVaxuO/9pUnXkhnrDO48/aN9J iI4w== 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=j14UEcKmJgy4lNmxfpEAdBtZK/nOSuRQd1wQuM4Od1E=; b=RHjs8kGOTP7sXHDyIpp9AfXwbE3xZPdMwUS/l32dcGa4ykN+G4QUWDjticHrTMsOCZ RqIxufODfCHnkduCiooCNTtBltF+pMpoqsdzRBYD3PMH8PJFV1SzHdvIz10n44yLnQCp vwOA9ZSXDI6FvmW/EBJiKQiVFospMcIgMHuc4Yc15U2q9TAhPf5uzJHa3JlvOc2whZAo NnjuBtNlelEjJZNgYMw0wXPJhwL2w9yILyohjcFnDZEJGmoMUIwbqU7k/azStCMYmIWp h8lZewg3cIa1FxIqDIHm98Sexx9m1jqJcxclH9ULZpCC+ZBUrUqBBhUrGJ56e5m9e8Ls GH2g== X-Gm-Message-State: AOAM532ZXnIDmZmbKppiP6CPvWOiJHE3XDOXjzWE4VyXliwvgXIrp4G7 4qB+COMSyOtSpJVxQyWjpUC3Kura/gJdphmR6fvovw== X-Received: by 2002:a05:622a:c8:: with SMTP id p8mr1154850qtw.293.1606890990020; Tue, 01 Dec 2020 22:36:30 -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> In-Reply-To: <20201201193451.GY3040@hirez.programming.kicks-ass.net> From: Josh Don Date: Tue, 1 Dec 2020 22:36:18 -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: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. I followed up on the 'color' portion in the other thread. Thanks, Josh