Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1544323pxb; Thu, 4 Feb 2021 16:18:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMdtywRBrm2C0wxZqwGvzr6z8tz+8XiBuJBgJ3u+2Aovo3B5hUBJBlNCMUICUZ7XmbVvzf X-Received: by 2002:a17:906:6b91:: with SMTP id l17mr1461374ejr.171.1612484288044; Thu, 04 Feb 2021 16:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612484288; cv=none; d=google.com; s=arc-20160816; b=DfXsKqstGGS8g9nu7fX6UFSM334+Am4fUsMy3oRN6OP53fFXoioZ7LPjui/CrIxgIg GXlFHfyw5hjYv60aTWTjm+2K2C1v/cXV7poZcnZneMSHAwh2Hnu3skAkOsQ6l/bZTBZa lrGNp5F3i6CU15lifw79N7FpyjbZBt8nmtu2Tt9w2iSu/6TGK8ZVKoApUMGR5MGz33vn Nt1TSU0HkBK4cNMTi8TICv6I1ptu1d/uoOx4wBOC5q0gI0kP40uYL2aCRIMcNgJY3k6E oJsv8xj4gEOvyWA5hjAy+QyEmyQfJT7dHjZiIeYiukOwvXMD816Mhtjzofyu9SRXkG1I L3vA== 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=DiD2UYQ2vcS4PPPHWLsjWMJjVSogeh5wJNa3h5rO1CY=; b=JRolLFzjQSwbRoTNYX7fGdbsZpEn+US5DH/uVPl+iNAQxnKrjmuETWbeU6wn0XfLDD 6lrIxvtXt/XRZhp3wJh5Cv8JC+zx19/SVhtuYwvGqGi1PwmKu6uakJgr08I1dgXz0Oco 8PaFGyQXIaN6jEs+7R1bP3tq2C8IvORKg3BWtygpdfcG1YOkgm6RTbIXxOzkRy83apiJ XxSergptVcFhX/KknFi/Or+3J5h3ES1MAFQTchJc0Q8kYnvJeJCWYg4g8KEha7rZHlbN d4b5ce5myDXbF97XRILgSShIE/QeYbnuf9fGjS8QFPiPABd8NeyHve/oduRNdAkrtAIM juWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NnzATUNp; 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 g24si4077259edh.82.2021.02.04.16.17.44; Thu, 04 Feb 2021 16:18:08 -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=casper.20170209 header.b=NnzATUNp; 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 S236526AbhBDN5L (ORCPT + 99 others); Thu, 4 Feb 2021 08:57:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236485AbhBDN40 (ORCPT ); Thu, 4 Feb 2021 08:56:26 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50EC2C06178B for ; Thu, 4 Feb 2021 05:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=DiD2UYQ2vcS4PPPHWLsjWMJjVSogeh5wJNa3h5rO1CY=; b=NnzATUNpRVNSOsY8FrBXNrcu54 MswekwphsKgfAfqRV9+X/gjwlt4eltuOy9xD/TB0CfKh7KuSukcxagOLcr7hVEXGoep5NU+E5qhXF XTuLZV/b21gkaPQlKvRMd9WDwUfuTjuzdqJhUNetw0xlNcd6ZMpXrIpCWLK222kWwA/g4DA0/j6LU VSS1CC2tYqdZqqyJwCZAsck0PeWs52bNmYGDeyKH9JFHAZYsdgCVn7iBXW/ngUtAset/y9uhFJ++r Pazjk1UdeRTvMdMLTVZqzidWL2a5iIh3opCTkuH2DttXurkHTtfEpc0L9pw0IXS+bWONBqvXua75P 4tKw09qw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l7f5I-000wig-Gx; Thu, 04 Feb 2021 13:54:13 +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 6931F3003D8; Thu, 4 Feb 2021 14:54:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 452182C12E917; Thu, 4 Feb 2021 14:54:08 +0100 (CET) Date: Thu, 4 Feb 2021 14:54:08 +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: > From: Peter Zijlstra I'm thinking this is too much credit, I didn't write much of this. > Marks all tasks in a cgroup as matching for core-scheduling. > > A task will need to be moved into the core scheduler queue when the cgroup > it belongs to is tagged to run with core scheduling. Similarly the task > will need to be moved out of the core scheduler queue when the cgroup > is untagged. > > Also after we forked a task, its core scheduler queue's presence will > need to be updated according to its new cgroup's status. > > Use stop machine mechanism to update all tasks in a cgroup to prevent a > new task from sneaking into the cgroup, and missed out from the update > while we iterates through all the tasks in the cgroup. A more complicated > scheme could probably avoid the stop machine. Such scheme will also > need to resovle inconsistency between a task's cgroup core scheduling > tag and residency in core scheduler queue. > > We are opting for the simple stop machine mechanism for now that avoids > such complications. > > Core scheduler has extra overhead. Enable it only for core with > more than one SMT hardware threads. Very little actual words on the desired and implemented semantics of the interface, while the patch contains much non-obvious complication.