Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5907983ybv; Tue, 18 Feb 2020 06:17:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxA2nQ3n5Hv5vMx5SqnR8yStJZhd2Zdzaiqwxb8hbk3XN7fOC/SuXs4KFJiGWctx7W17EHe X-Received: by 2002:a05:6808:487:: with SMTP id z7mr1379453oid.59.1582035452308; Tue, 18 Feb 2020 06:17:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582035452; cv=none; d=google.com; s=arc-20160816; b=VrcAEyA3WhD3d0Y6aSJ5nl0rdrzi+T5dD0r/CluL9oTwB6H7ZhmVQmkK0JrUGWYEWN GjfB9Qxkxr+ndhUQE2Nsrp6sFKdKs+y08pD7x6PCvDZpyd9nVPqY6OQMAPq7kyKdIqaG /KniKRHjtyMvMzAodVKdG6EkwciVdZeFrMpsVrSgIMlG8sJzg+QIOgrPYANX207OndOY 7AKVM9wl7Th2rYFb09uHlTjcuAHWB6DvamJ7gPoMfbx/5/S5YAZMGowgXypK01eu24LN 7p9ftuYHeW0x+KDKJljm6cGaiKKtwZmRe03oj1sCFDsPN/Lv9c7T5K6+ZFssvD6apJlE S4xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=e/I96XjCy45FrSiOOSIP4LbktmpEXlMTBIVpcEP7eY4=; b=TmSHH7jDEDTSHoPsFZENynMb6lCjIUndc4ojOalc2cmdSSHYpWjUWpk9lAW3t2Bd0y skOzXIEr2S53OGl3jEdufQQDZxKjS0g22ySj00hyrnMXw07FwZFp5QQ7+UCyy81fSqzh MXoMxRn7oVxMHrpGAaPuccLjRnXe1YJ80vBTuYWeY2pqLa9waANYEJU7s7Vruooro/Am 2RJFA7whHIH53tUxiihtTT9jO/vzLbjfcRM6JTZLGrx0BuPH0FxjySa3Y064NszF86RG pEaZ15JHFUtaK4D7qm0W96+Vb2KOikCwCOsBb3MdwlToBmU6Re1+eTNGUpxKML5KBTBR g5eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WvIOoKWd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13si8061191oiw.106.2020.02.18.06.17.19; Tue, 18 Feb 2020 06:17:32 -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=pass header.i=@linaro.org header.s=google header.b=WvIOoKWd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbgBROPg (ORCPT + 99 others); Tue, 18 Feb 2020 09:15:36 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43319 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgBROPf (ORCPT ); Tue, 18 Feb 2020 09:15:35 -0500 Received: by mail-lj1-f193.google.com with SMTP id a13so23141260ljm.10 for ; Tue, 18 Feb 2020 06:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e/I96XjCy45FrSiOOSIP4LbktmpEXlMTBIVpcEP7eY4=; b=WvIOoKWdR3yhpJT8DTNT3yzKoIzfOYLSRNYg0Sj4Wfq9Nxv6caTGv2ew5IEi+yDuXO pKGEgTqEkYwnVlyxt9zBUBpxvYyZKVmmPgXQ0xcRHPRt0GHzD+tpuEb1tm9BMKWClUsy 8zxNdvD/COqAhRQ+25hf1eLEaTvHP5DVrvel0YAZkczYZKmt8Pdhe8DptvCetcW5yfyc 8v6Xhf396Iv0kGJCQqsF/f5+YAbJPPUFxAxVG3tByf6+k9ZiLYy/sCEL8V/uSPGFruyo 9iTWlZRtga168ec/jNIJHTqWPmd36pUQtkacJspWlnp30FO7R3EgD8zUexWaNuc2Yc7F 3SaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e/I96XjCy45FrSiOOSIP4LbktmpEXlMTBIVpcEP7eY4=; b=UKnl7RmEtdgZ00aOzk0cg+eQ/s5wCvPXJp+HcCyg9wgO/qceFBeNW8yBv4KTQO/D5t 9rvlxfqgiQPHGHHd+c+UmdXzGgsmkt7aK+NPx3lX45KWmQMashag/C7YAQZ4jQzhnq9C //0N/OM8UU7Uqjvswc1RYMjXugg5WrmSsLu2eDlWHjayMNCZIE75yD9BngsWviqZ6Jpe /bZOfdmS6gMwenUJURip8jWnlzAFBfxHb1QbTcmUhKYKmQlqkW+IoxQ9BABmTG78NeU9 PC4yrP1pXd4WuPM4Ur/R+LrZgA6C10WQE3abQtiROGys3yGL+4aFvNH9AZhGWbyhtsZ0 8I4A== X-Gm-Message-State: APjAAAUZ3czj3Bd5Ugbaq5Cbsd+cHNzyWg8Z3LJnixtUATYqOsQJPb+s QuMw6BpivUWE4xTHlrF4rEQw51cAqU4dtZSv1FJJNQ== X-Received: by 2002:a2e:80cc:: with SMTP id r12mr12317715ljg.154.1582035333487; Tue, 18 Feb 2020 06:15:33 -0800 (PST) MIME-Version: 1.0 References: <20200214152729.6059-1-vincent.guittot@linaro.org> <20200214152729.6059-2-vincent.guittot@linaro.org> <20200218132203.GB14914@hirez.programming.kicks-ass.net> In-Reply-To: <20200218132203.GB14914@hirez.programming.kicks-ass.net> From: Vincent Guittot Date: Tue, 18 Feb 2020 15:15:22 +0100 Message-ID: Subject: Re: [PATCH v2 1/5] sched/fair: Reorder enqueue/dequeue_task_fair path To: Peter Zijlstra Cc: Dietmar Eggemann , Ingo Molnar , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel , Phil Auld , Parth Shah , Valentin Schneider , Hillf Danton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Feb 2020 at 14:22, Peter Zijlstra wrote: > > 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. Yes, that's the main reason, updating load_avg before h_nr_running