Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5859068ybv; Tue, 18 Feb 2020 05:24:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyesXMyQMw5kEhcGBV3QuuC6loUXK+MtswB1Ok+6z1eFcE6u9/L4hb4mTGY5+6yZngef+Ya X-Received: by 2002:aca:100e:: with SMTP id 14mr1231230oiq.88.1582032248540; Tue, 18 Feb 2020 05:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582032248; cv=none; d=google.com; s=arc-20160816; b=bBukm1csvF2r5B404oCuEhECzff1kqBDhX3LQ1esU/GutyFHmNjV/JdCuh6Yz675wo uz7zFxjM2MbBUKpdYsrA1BcTFl9lZmliRaJeL1r6OxHIZ4lTRnfNy/OYRmO0VJRbCR9D V04GyLeZ+ygLUgxDiOYaKb7kja9Q9cLckcFA2Ug6NvTpLfuWEMCu8Pj0lyizAk6EoYI8 yi4DHIVYqon5wlo/qCf3GAP1R5I7Zt8m+szMFQsqnciq+Vo9/DUQEsXGwkBZd/MkdeDm NQWym7+FE/tNn+xROs3MoGM6TjlVJSveTNaLZTeH+trvR9522SzG+9NHKc8NlHILXvMt v5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VDHLWu39JTGXnvSuCqTu6wPEeUVN5TaC5Pa4fKQbOi0=; b=CIin6kI7h7ZnBrrLmJO/+euFNKRWL9k+cqQaZQDKAjwJxZ1ecM0Mqmj2WjeRxHoMlb OMIiIkrkbDB/2R/cWJwzdXVH/pTp9yuvd5J3K1h8ZNxP/8HVrSW+wqG/Kyn2mw/J6BxH oC4S7mZEGpDEYkk/JwmzrK7O8Z3xJLeDt22mhC+fsZRWopu3XoNAY8TFzJbNfJ3/5Adw L4EAyT+P3hpxjhqseihpbgAsHzyDkZ9fCnjuKEuA0nLEm+MItQIXBcG2Iy5nSFFR/9vG 87/pcJjCYrlmxhZoWi7XymZlZhB5vxMvMa3hqWbtZKKs0eOzV8aaIWUKmhvdq5R+EE47 P+tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=u7HWeoQq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 200si8038183oii.156.2020.02.18.05.23.53; Tue, 18 Feb 2020 05:24:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=u7HWeoQq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbgBRNWi (ORCPT + 99 others); Tue, 18 Feb 2020 08:22:38 -0500 Received: from merlin.infradead.org ([205.233.59.134]:49876 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbgBRNWi (ORCPT ); Tue, 18 Feb 2020 08:22:38 -0500 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=VDHLWu39JTGXnvSuCqTu6wPEeUVN5TaC5Pa4fKQbOi0=; b=u7HWeoQquqyFUskQLOatRnHpU/ YDftRdbVmII8+TjJuw6hYTZMu7dJx5M86eKMTq/xyE/3ym6vlfDaWj6OqgcnE0SlK/30Vi/CfRn6S MP5NksYoy3GlMSYif7UXddTe0lmTS8oIl7zkUDdrNwKcQ8oNJpA1uSx+2jPSKg5Aaj9rnS008G8jW ylQ5trxolWp+xX81HXEs9Z9oUc06UTES9cuqck/TNGR5rfKfxhCHOQ5KIEnsNEIgc9qPslMwSWvdx 60RoCRMsWuy33kAGJP+5H/A5XwFeE64ZIDD2IbO3zMYLCtPUFEAaQ6NcC2xLFCo91JnBpenCOTn2M fOiFoylQ==; 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 1j42pB-0004fP-73; Tue, 18 Feb 2020 13:22:05 +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 5698D300565; Tue, 18 Feb 2020 14:20:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 369082B92FA22; Tue, 18 Feb 2020 14:22:03 +0100 (CET) Date: Tue, 18 Feb 2020 14:22:03 +0100 From: Peter Zijlstra To: Dietmar Eggemann Cc: Vincent Guittot , mingo@redhat.com, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, pauld@redhat.com, parth@linux.ibm.com, valentin.schneider@arm.com, hdanton@sina.com Subject: Re: [PATCH v2 1/5] sched/fair: Reorder enqueue/dequeue_task_fair path Message-ID: <20200218132203.GB14914@hirez.programming.kicks-ass.net> References: <20200214152729.6059-1-vincent.guittot@linaro.org> <20200214152729.6059-2-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 01:37:37PM +0100, Dietmar Eggemann wrote: > On 14/02/2020 16:27, Vincent Guittot wrote: > > The walk through the cgroup hierarchy during the enqueue/dequeue of a task > > is split in 2 distinct parts for throttled cfs_rq without any added value > > but making code less readable. > > > > Change the code ordering such that everything related to a cfs_rq > > (throttled or not) will be done in the same loop. > > > > In addition, the same steps ordering is used when updating a cfs_rq: > > - update_load_avg > > - update_cfs_group > > - update *h_nr_running > > Is this code change really necessary? You pay with two extra goto's. We > still have the two for_each_sched_entity(se)'s because of 'if > (se->on_rq); break;'. IIRC he relies on the presented ordering in patch #5 -- adding the running_avg metric.