Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp722056pxu; Fri, 23 Oct 2020 11:36:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVdi+KBAmELiRHYth1zLQwY4CpSllqRIcEMcA6qkOkn8/2mEQmZsRHuqVZ1tW1VuWN+CSu X-Received: by 2002:a17:906:5593:: with SMTP id y19mr3282361ejp.369.1603478174542; Fri, 23 Oct 2020 11:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603478174; cv=none; d=google.com; s=arc-20160816; b=pQKWNH793Jj2YzrxToaREzOGdpz77Wdio51i9qjrTvIrMoUnHaD1Mxp3BgJn2tdWuF 7CoTy8VB60mOoD12EB0UTopJWAJ1kb59/4SiWLfLn4PwTPnmpJBdeECzvB+pMgW8MjTx HGmYpUt6t9n7nZ1jEKgK1o3LGZwxRSb1kU6LHuJRjvO5xNZdISo5hhAOdSv2o/lQlf7u bfqLCIuRbf6Nnpk4xRFJs2e5nhdK6rvc9+ZIc1SMHjIYpnpLTnTKVnNMgvqUkQoAjwKN jcx8Tsttk1es0rrDJUkBoOOuiUYZR74C90uLzsqghU1WTdEliFvr65w0X7d2213L/0yn 5Q7Q== 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=DUM2mNQ4emo0v/3jqiFibKilR7KsDiF+au+361QHlpM=; b=wem0MFD0rqOYIH+7oXTnkAhd/HWTXeMe8jIj1cnS1EFwGVe56BmtcFT2qNxIl50A/Z j7oTOze8/gacJj/0DJVXLkUgUSGJfH6vDkwhWHYhM+hfOO1mEhlKVFR8I9HuFhOTvhM3 RmEOEqav4gZmfs3ob4cuRf3RWLiLllKIsxlxn33BeYnIgCBFgok1nZ9o2bX9wvz/VZL/ 9n+p/eC8AXnFnspnhr1BOYdRjBJNWnb7fkYzToXlnJ12ASURPCGR4K3c3IweHpzi5o/g T5gMIwvVSZoCbAS/yoQacAdvpSfCQ/tkS4qKr3/wXawQp70ARP4W06PDp3VCBn0tAyGW +90Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MMuFyIj5; 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 v17si1417059eje.376.2020.10.23.11.35.52; Fri, 23 Oct 2020 11:36:14 -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=casper.20170209 header.b=MMuFyIj5; 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 S465158AbgJWNzd (ORCPT + 99 others); Fri, 23 Oct 2020 09:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S464793AbgJWNza (ORCPT ); Fri, 23 Oct 2020 09:55:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 103FAC0613CE for ; Fri, 23 Oct 2020 06:55:30 -0700 (PDT) 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=DUM2mNQ4emo0v/3jqiFibKilR7KsDiF+au+361QHlpM=; b=MMuFyIj5elfx3kGM3uwhDp50uJ geYYk7luFdjZiJ43Jyw2RMXEdjF6tL6fn8s6hJUzGA+UJEGWcYw+GFVSClI6dGKHVSOWB17kruDUc HVL0QB0tRYOs3RoXQOCPQJu0BRcn35nENOLPe5DP9yWuVtOTPM5A8TwfGGlOj8g0CKhubjLTG/pUT LpTki7Rg64PH34z6LBWHJaGgjPl2RjugHYGLYTqSmRMNk022AxgTYaEO6CPkYkGHDUTDl53+UaF3g ts0e1Uqg/o8O37499KZB+4WoDkJGBIgayqSWbEeNkSmvXGlmnlVdHhvFPKXZ/CCDWRYxC5WCJcX3N nsAvOOdw==; 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.92.3 #3 (Red Hat Linux)) id 1kVxW5-0007mP-Jm; Fri, 23 Oct 2020 13:54:01 +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 66F7F304D2B; Fri, 23 Oct 2020 15:54:00 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5576C2B82561F; Fri, 23 Oct 2020 15:54:00 +0200 (CEST) Date: Fri, 23 Oct 2020 15:54:00 +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: <20201023135400.GA2651@hirez.programming.kicks-ass.net> References: <20201020014336.2076526-1-joel@joelfernandes.org> <20201020014336.2076526-7-joel@joelfernandes.org> <20201023135129.GS2611@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201023135129.GS2611@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2020 at 03:51:29PM +0200, Peter Zijlstra wrote: > 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. That is; it should be the exact counterpart of this bit: > + /* > + * Optimize the 'normal' case where there aren't any > + * cookies and we don't need to sync up. > + */ > + if (i == cpu && !need_sync && !p->core_cookie) { > + next = p; > + goto done; > + } If there is no task found in this class, try the next class, if there is, we done.