Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp42911pxu; Tue, 24 Nov 2020 18:02:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsVzKCddDfQGoZwASjcLEBcquF84aNHFe+/HAN0UWtECekFpgZqsFYA0IsnFdfb1ZTevIO X-Received: by 2002:a17:906:cede:: with SMTP id si30mr1200243ejb.16.1606269741791; Tue, 24 Nov 2020 18:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606269741; cv=none; d=google.com; s=arc-20160816; b=0ss5VFuB/YQQ9iE4gd21+1AuAAKt2fpiZQLFmI+GKAfv4DSFyVSyGQe4uYzuvPCNZK ts576SdCMegHhCIgF88mPZVDceSZVBC299FUDmXtgc1qDQ0t5i7PE0xVg5l31l73bdub c0vu2NzAPphXqhppIvJuPli6m86ir91fO5p3uPrSnFyW2QcO0rS/d+M28B+ZCJ/WAdMp 3aAqWbMaTH0xwP6T5UMKCmQVDy09quZUgAFFz4Pgc7jqV+HgHN/UHHmh2DECzSYMf09p uRvR8PSyhFZTacL4hdEclujs5vx/vGVRTVHjazT2wlJ0NcOnwVQ0AwoMsCyfACBhr78I e32A== 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=sVZQg3f+H2ITDjvlnKTguk7GALp7qDu3IpnpV1tFdEg=; b=u7aa+QBC0UfnDxDdk87HwkYCR9zCiPmLiiMWWXkfpm3Avwmjp9R8cC3VSREk58fRJl R/v7OI+pt4cQSmVpyAoK0Bn9GaJiMyrC52FQzvsMWDoRJdAKSfUO5Os+IhQU20L8cTrB yvj04CATlQNXR//RIhI6fJ/vdoxLARITOjM09EdyzM1qy8mRq4V2E1j4x+XHN3kpCkEl yCm0Ju383IokXGcprMKcFk6BnexW0Hg3zlZulZ01V0vgAWaBbxwOvFLxGfsGXNhcOSeR VfccmE/qYjxZUORJKygIVWUsmATCQYGjAKoRw7lC4Baz0YtZGSMO+xhcmzdFHH2Ot3ZF Yr8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=Xu8CN1ou; 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 zm18si438062ejb.309.2020.11.24.18.01.58; Tue, 24 Nov 2020 18:02:21 -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=Xu8CN1ou; 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 S1731867AbgKXK2q (ORCPT + 99 others); Tue, 24 Nov 2020 05:28:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbgKXK2p (ORCPT ); Tue, 24 Nov 2020 05:28:45 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C935C0613D6 for ; Tue, 24 Nov 2020 02:28:45 -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=sVZQg3f+H2ITDjvlnKTguk7GALp7qDu3IpnpV1tFdEg=; b=Xu8CN1ouCtzTaU1ix7xlnqX3R4 tBAv/vR0vhxTpNPpEarikmEtI20E7lOkSkghk5O05MTuFSG5cxqErMLb23jhP1HGojQmatiu2jC93 3bh47C0998+gxT/aCMwekc1IGWSdFqctw1h0qlw/Uc2JnbGB8xlHis3tFJ7UrE1SgvXgZ1JAZpRC5 wjH+Cg3cVh7pt6xDTilzGiDtJf3/kz23xdIQ4QVoUyMHwz6aWRuVguq1Bi8KgDJlT6Ao17X243gcc jeOyPC8Eh66nimwzdK185BxhwwAJu77I/L4MVpSOBcFbGo/a7goZaB3AtBb/AcddgEgbdKkiNJDba uWwBV3Kg==; 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 1khVY2-0007xS-VJ; Tue, 24 Nov 2020 10:27:47 +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 F2050300DAE; Tue, 24 Nov 2020 11:27:41 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C8C1F20298C91; Tue, 24 Nov 2020 11:27:41 +0100 (CET) Date: Tue, 24 Nov 2020 11:27:41 +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 , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH -tip 15/32] sched: Improve snapshotting of min_vruntime for CGroups Message-ID: <20201124102741.GW3021@hirez.programming.kicks-ass.net> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-16-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201117232003.3580179-16-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 06:19:45PM -0500, Joel Fernandes (Google) wrote: > A previous patch improved cross-cpu vruntime comparison opertations in > pick_next_task(). Improve it further for tasks in CGroups. > > In particular, for cross-CPU comparisons, we were previously going to > the root-level se(s) for both the task being compared. That was strange. > This patch instead finds the se(s) for both tasks that have the same > parent (which may be different from root). > > A note about the min_vruntime snapshot and force idling: > Abbreviations: fi: force-idled now? ; fib: force-idled before? > During selection: > When we're not fi, we need to update snapshot. > when we're fi and we were not fi, we must update snapshot. > When we're fi and we were already fi, we must not update snapshot. > > Which gives: > fib fi update? > 0 0 1 > 0 1 1 > 1 0 1 > 1 1 0 > So the min_vruntime snapshot needs to be updated when: !(fib && fi). > > Also, the cfs_prio_less() function needs to be aware of whether the core > is in force idle or not, since it will be use this information to know > whether to advance a cfs_rq's min_vruntime_fi in the hierarchy. So pass > this information along via pick_task() -> prio_less(). Hurmph.. so I'm tempted to smash a bunch of patches together. 2 <- 3 (already done - bisection crashes are daft) 6 <- 11 7 <- {10, 12} 9 <- 15 I'm thinking that would result in an easier to read series, or do we want to preserve this history? (fwiw, I pulled 15 before 13,14, as I think that makes more sense anyway). Hmm?