Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1887263pxb; Fri, 5 Feb 2021 04:06:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9019uLOTehoWUiNfQpb9mu5Oz66Sz6UjrOgLSLzBI725UWdikeNgmAe6akZB8NyiBOKJr X-Received: by 2002:a50:da8b:: with SMTP id q11mr3290377edj.352.1612526760833; Fri, 05 Feb 2021 04:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612526760; cv=none; d=google.com; s=arc-20160816; b=YxJrtp7WXynSlgIKKcBMfaPn7l4llbEfGKSZhI2KJqiFnVtLDAN8PptBGz5R5a9k00 dFNrFMhXpoBlOnMvFIMTUz5RriS1hwtQ99HY00QTNzP8/Y5A4aJMDogYPVILn5jTIaaG KHWLUbDSnzMf/pG8zmnmzOiBFS7DCrzAUUlhDEHqtxEoVzkvMaWdgNFHOdUGPqFb1I5c +kQshZGTYxUL3676HHv0dvWFyRzbjEB2hq8gyVoDyIGgQahwrQ0JZXJnDkyuD3zQqvbM oK3A8Vlte/PpPO/1FrD8jvy9ZAwA3cFdB1hcU2zIMkTGCwetSWz+cB3kE/XVsu0auS2t g09Q== 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=N+gr+woLTLTNRWLX/vD2ETBGIX1Ifu4DYG7FuQNse1k=; b=W1HIYbiXDBNZtGRkEZhJfAvwiV88tsOV+9FqmhhZ0wDK4ZfOnwj6q196VzGPCCi3yE FSp8EBwXa1K7635CEpodMFdi/Fk0WcgSjEuZKFysjMDTQ++bJft0LuJp+fCzo0HTUcfi 83dZcVbediaG+sub4yBcDlmj7a+BNrYK5vVVh1PBxsctUuoZpF5nDaYg3ETnlaWUqoF2 S22IU9yoCE9ITSAXZKoffLcGRYrCL0JhddBhDMf2iWrhW2xvGw6LnX3RmW7SiwgaNsZv i59lyD2Et/zGOIiQtH+PWDvmYVISmpsK5GItykjtlFoDo1GonyIjxr2VFhTrB+NATAd9 IZVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=hCxamAsH; 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 o19si5623455edz.565.2021.02.05.04.05.21; Fri, 05 Feb 2021 04:06:00 -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=hCxamAsH; 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 S231210AbhBEMED (ORCPT + 99 others); Fri, 5 Feb 2021 07:04:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbhBEMBo (ORCPT ); Fri, 5 Feb 2021 07:01:44 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3F4C06178C for ; Fri, 5 Feb 2021 04:01:04 -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=N+gr+woLTLTNRWLX/vD2ETBGIX1Ifu4DYG7FuQNse1k=; b=hCxamAsHHyDAuVzWIFep9r9AiT gQ9TBgt87Ye3nGZDVRVVHs2yT2VHkhxvjJi++AfGfu+HdEAI/heLBOEozSGXvkzlK4eWGtB6pOTrj nT8va00Ofe+D7enlu2iUJZ3MF+ph5G5w+4R9zGwmR7EyvDleOsfu7mJHptff1MXheQugPPZcJ8nfy auWm0iyq7WPDQbD+8LcDUnlnHmjBJS7M+ZGqqdaJZh3W9LjXHvY7s/XMrloWpQX7h0873VzRqKc5N PiDz41u5tfGEWWNuQvpkwhRl3f3dz4aCyhtWo/zWBKi7NdjXfukya0piKU2iYCVp8BNVt8zmh7NI7 qd0au5MA==; 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 1l7zmY-0002BK-0t; Fri, 05 Feb 2021 12:00:14 +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 4C85C305C1C; Fri, 5 Feb 2021 13:00:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 31D1E236804AF; Fri, 5 Feb 2021 13:00:11 +0100 (CET) Date: Fri, 5 Feb 2021 13:00:11 +0100 From: Peter Zijlstra To: "Joel Fernandes (Google)" 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 Subject: Re: [PATCH v10 2/5] sched: CGroup tagging interface for core scheduling Message-ID: References: <20210123011704.1901835-1-joel@joelfernandes.org> <20210123011704.1901835-3-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210123011704.1901835-3-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 08:17:01PM -0500, Joel Fernandes (Google) wrote: > +int sched_core_share_tasks(struct task_struct *t1, struct task_struct *t2) > +{ > + static DEFINE_MUTEX(sched_core_tasks_mutex); > + unsigned long cookie; > + int ret = -ENOMEM; > + > + mutex_lock(&sched_core_tasks_mutex); > + > + if (!t2) { > + if (t1->core_task_cookie) { > + sched_core_put_task_cookie(t1->core_task_cookie); > + sched_core_update_task_cookie(t1, 0); > + sched_core_put(); > + } So this seems to be the bit that implements _CLEAR. ISTR there were security implications / considerations here. When the machine is vulnerable to L1TF/MDS and the like, clearing the cookie would gain privilege and should thus be subject to some checks, but I can'd find anything. At the very least that deserves a comment I'm thinking.