Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1453112pxb; Fri, 10 Sep 2021 06:19:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFVxGeHbRUmsELX2QixQpU31ACPHwSffl16xYNM3UfJNN1Fn3YU7uEimGOj5YnH9Pee/7O X-Received: by 2002:a05:6e02:120e:: with SMTP id a14mr6128438ilq.222.1631279999361; Fri, 10 Sep 2021 06:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631279999; cv=none; d=google.com; s=arc-20160816; b=xC5EpAU9/o67Ad8NXRof295jZNQkrLEdrGSu4wLcIPzmX+SFN5JBhWlis11v8/ZrqA B0zItfPtaOFIxVmgEkT6gJrvwaRh9KcrW5S7yyD/+P6crorcptdzTLjxKkVQiBn9NPla OGngT10Tv9c4ZY8T27/EnLrKDLf2RWq797gIas/2EgdNwcIfFPVaR4eyIgX6BOph4arL 6HPCjdwxejFLWrYZxff5+5I9ZmtvycrWnsJvh5IXglE1SuTtNGAVNOCLFlsH4OxHpnQQ mVVW+PdcTR5Jg7lTQYHbfXPwFu3JKpQhsGnN6+WW3fnBdrKSy2i4DyhcKvItuSjijmI7 VDsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QUTLtwXLUjfxOMwwCkVC2MzQatgqxlfkVT2ny2bxECk=; b=ZGN4mFAzh3GgrM3ZYDPw+CjnDTm5uqod+PNQsG/K3utycCe62oSAU7woN+giEwQzTE jg7y23+m+zizuVKWldCwJFo0QtdrQ0VfNRUqFzUxnjfv3xCk0sfIb7swAUm0Yu9DHE+t UiYVSz8x2I7W5wAiGsHpVmFW7wOIF+g1yEuK2o+zU2nBLeHLDUlsICz8svr6Ea85s2s+ ofQUINtXAXybz6VUo+ausR0aL/Bm7CMJmLsRO8DT+CodeDhxzNPFNywrA/ZEcKowQ6ND xnPklSTwDhr3cobfD4ZRxJqDRGP35x4jyB+nOlrpz0NMSOlwwfH60pLR5n6PGiwj4PD1 oN/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fXaPnGcA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si4981809jac.8.2021.09.10.06.19.46; Fri, 10 Sep 2021 06:19:59 -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=@linaro.org header.s=google header.b=fXaPnGcA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233485AbhIJNS3 (ORCPT + 99 others); Fri, 10 Sep 2021 09:18:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233443AbhIJNS2 (ORCPT ); Fri, 10 Sep 2021 09:18:28 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 471BCC061574 for ; Fri, 10 Sep 2021 06:17:17 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id r4so3774066ybp.4 for ; Fri, 10 Sep 2021 06:17:17 -0700 (PDT) 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:content-transfer-encoding; bh=QUTLtwXLUjfxOMwwCkVC2MzQatgqxlfkVT2ny2bxECk=; b=fXaPnGcAznaUA3B1hBspE7kTkmYHXyNpZqbO3Mojt7CDWtVzBV4hLNUk3pukQe2prn 9vUn+gIrniMOKcEMNsonsdn2J+GUFCnrlCP4T88WxMp4grhWi3C8nKzCrecoufJEQVzQ zwj9Ql1+uXRqZd/2OYkSj/nc8EzYramo8MjWj3utvP72bP42ScAeVpfJpOjnLmStJ6/p 25hz/YpReJPfyNhgXCjvftR0852EnCixSytT9PJv7mgdXwuvqbN7gCiHihaBRmdtBUUJ siEBEouDZu3OFEig+qt/RZ/R4FF3lAVJzVbp81svg1tkCrIfkVUhqb8E5/4zyVC89fvT +KhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QUTLtwXLUjfxOMwwCkVC2MzQatgqxlfkVT2ny2bxECk=; b=APqKnXgoMjJ+U25lqaMUOcqP7w5OhmVQPvKpkDb+LGvtpqDJU/CdZlMDaWqD3dCbuE NhXsQw22NxpRMVwZqdnGQeerUxiEiJkJp5VyyLfipuhYOBFyD0j5Q87kvfWOCPqFGsRl +UEJgHsmRpf8D6ertPsKJo85GRXTjRn0T+eCV8ClWROjDLhXGQWLcsYuCkWMFd84bm1t XYTFrR+tqlhM84F7hn3Gss9XjK6AcHPr4TR+6VcOW8a1M+++30zIJ8/cfyvO1M3JDZO+ U4Gx00pKE+Wy6mZRrqi3ZPbNYxCSoU2SrM/81hcvHMhlM02kOC9a+utcdZUrl9YrBTj2 qB5g== X-Gm-Message-State: AOAM530WqOBd2pECSfTWrSBh/RRDq45xHIL+D4IoeR4YIyDaM/0NRjr2 8Ph5NfHnh/Lwufhm+9BQR0klInzwM3T9R5IjCoBHGg== X-Received: by 2002:a25:802:: with SMTP id 2mr11014314ybi.61.1631279836534; Fri, 10 Sep 2021 06:17:16 -0700 (PDT) MIME-Version: 1.0 References: <20210819175034.4577-1-mkoutny@suse.com> <20210819175034.4577-2-mkoutny@suse.com> <20210910113544.GB24156@blackbody.suse.cz> In-Reply-To: <20210910113544.GB24156@blackbody.suse.cz> From: Vincent Guittot Date: Fri, 10 Sep 2021 15:17:05 +0200 Message-ID: Subject: Re: [RFC PATCH v2 1/5] sched/fair: Add ancestors of unthrottled undecayed cfs_rq To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: linux-kernel , Phil Auld , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Odin Ugedal , Rik van Riel , Giovanni Gherdovich Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Sept 2021 at 13:35, Michal Koutn=C3=BD wrote: > > Hello Vincent. > > Thank you for looking into this! > > On Thu, Sep 09, 2021 at 03:57:37PM +0200, Vincent Guittot wrote: > > > + /* Nothing to run but something to decay? Complete th= e branch */ > > > + if (cfs_rq->on_list) > > > > Could you use !cfs_rq_is decayed(cfs_rq) ? > > What needs to be checked here is whether the list was modified by adding > the cfs_rq (and branch needs closing). > > It'd appear that the equal condition like in tg_unthrottle_up() would > make do, i.e. > !cfs_rq_is_decayed(cfs_rq) || cfs_rq->nr_running > but the unthrottle_cfs_rq() can be called under a still throttled > ancestor (i.e. throttle_count not dropping to zero) and in such a case > cfs_rq should not be added to the list yet. > > Therefore, mere !cfs_rq_is_decayed(cfs_rq) doesn't seem correct to me. fair enough > > > > + for_each_sched_entity(se) { > > > + if (list_add_leaf_cfs_rq(group_cfs_rq= (se))) > > > + break; > > > + } > > > + assert_list_leaf_cfs_rq(rq); > > > > Instead of adding a loop here you should better jump to unthrottle_thr= ottle ? > > Oh, that looks a bit clumsy now (it's an artifact I've left when > reordering the patch in the series to be backport-friendly). > Jump to unthrottle_throttle seems easier indeed, there would be just the > additional check > if (rq->curr =3D=3D rq->idle && rq->cfs.nr_running) > . Besides unnecessary work, it should be harmless. yes the condition should be always false > > Is the jump the preferred form? yes compared to adding the exact same loop > > Michal