Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp722046pxu; Fri, 23 Oct 2020 11:36:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/R18GFT66PHTM9LvAgB6zmVaNVeSI75NX+sOmh/GK7Dzv2SU0y5Me/lM87WwyA7URDJ7S X-Received: by 2002:a05:6402:176c:: with SMTP id da12mr3592837edb.28.1603478173030; Fri, 23 Oct 2020 11:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603478173; cv=none; d=google.com; s=arc-20160816; b=s3CNAC+4x/0/PTdr2Zq+smoxnqTyxGzILz/X05oK7O+bIUhvaY5+BBJmxPwFaJixnk 6v6uMmQ9E5rI6ZMITt1ICUJRBFjKfd5WlrUwHcTkVS9V/OG5EzluCyCx/nUsGRsaaGgB T69af9zBxsyU/2gnHePrcKe+ev2E7kBjmHNJsVBK+OQicywmM/vBS4l3K08xropLNmso FHv6SN785qSMnsySCQqr+xdxSybAi1/C/2arEbPFMFhWzw7OFu2MAKZg34R0fbr4IOWU GdO+YgNPSzBEY3IX0X5ZqQX4XmXzsCm3A0+TpzOk71M3a+OTdL6QHel2Ylq1ygGAP0FO HIow== 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=jJbaIamCunM2YR6pi/jwK4vqVn7wvntNquR8J2fhoRw=; b=D9MXI7MggJNCaBGN5ucKd2kSa++LHxT/+YN0p3Z2zutKE8E6+TO+16URXC0sA+TkTe wV9cCDEg5a+PE5ha1Y3bb8Ms69oURG6teVqXc3A8OKwUy1clJU7f27X91G3o0/VYCFKX AdJ0qjONu1G5546XNLtQYi4vDeCBZ6rEbvIYuKWC7yigpj2bu81reTnKZ9VWhrfquarj JZL0PKA911W5mYe1zmGAhLG3IKrWDXq1WMX0Jfq4brXNcCq0CZqHjuo3Li/oRBWG8V2b ZnR8KwKQuACoVttH7AOPDtj0wRellz3V/a/eDWZFbinBcvtl5nd1siGct0m5quSa7fnH 5bcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=xAgU5gxi; 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 d5si1409482ejj.231.2020.10.23.11.35.50; Fri, 23 Oct 2020 11:36:13 -0700 (PDT) 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=xAgU5gxi; 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 S1750142AbgJWNw7 (ORCPT + 99 others); Fri, 23 Oct 2020 09:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750135AbgJWNw7 (ORCPT ); Fri, 23 Oct 2020 09:52:59 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B3E1C0613CE for ; Fri, 23 Oct 2020 06:52:59 -0700 (PDT) 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=jJbaIamCunM2YR6pi/jwK4vqVn7wvntNquR8J2fhoRw=; b=xAgU5gxiG1w2JguniPaQ1uBvrl cYJm6XRNkVwG+Bm8E6XDoPXtib/XO/NAMDuEwG7xSukh+Uvd0NM21UMWKkc9yAFJlARUsWg39p0Mz lkqM22mY5nF9Adx0lRABDbNkY/HLxPKvnSF2G0lF2XPnQSedE8MxhlGkshUW7DkO5pR3Xh/qDWXvC 1NA8EzQghgw9hYwS+GEbaHqHRh3YJbrVC1LLsPmnzvsVEfXFSh8SMBQxZZHHxT73q9edeEJfsR1Gj 6Z2bw0lLPmRkqfHu2+nugM2zI1FVWtV84YlknrJAS/IFMLfsZtd6kVrrii7RjJEfBm4UIXMTeAlz8 PG3x20jg==; 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 1kVxTh-0000E7-3k; Fri, 23 Oct 2020 13:51:33 +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 98747300B22; Fri, 23 Oct 2020 15:51:29 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 51B2D2B82561E; Fri, 23 Oct 2020 15:51:29 +0200 (CEST) Date: Fri, 23 Oct 2020 15:51:29 +0200 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, Vineeth Remanan Pillai , Aaron Lu , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH v8 -tip 06/26] sched: Add core wide task selection and scheduling. Message-ID: <20201023135129.GS2611@hirez.programming.kicks-ass.net> References: <20201020014336.2076526-1-joel@joelfernandes.org> <20201020014336.2076526-7-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201020014336.2076526-7-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2020 at 09:43:16PM -0400, Joel Fernandes (Google) wrote: > + /* > + * If this sibling doesn't yet have a suitable task to > + * run; ask for the most elegible task, given the > + * highest priority task already selected for this > + * core. > + */ > + p = pick_task(rq_i, class, max); > + if (!p) { > + /* > + * If there weren't no cookies; we don't need to > + * bother with the other siblings. > + * If the rest of the core is not running a tagged > + * task, i.e. need_sync == 0, and the current CPU > + * which called into the schedule() loop does not > + * have any tasks for this class, skip selecting for > + * other siblings since there's no point. We don't skip > + * for RT/DL because that could make CFS force-idle RT. > + */ > + if (i == cpu && !need_sync && class == &fair_sched_class) > + goto next_class; > + > + continue; > + } I'm failing to understand the class == &fair_sched_class bit. IIRC the condition is such that the core doesn't have a cookie (we don't need to sync the threads) so we'll only do a pick for our local CPU. That should be invariant of class.