Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1372656pxb; Fri, 10 Sep 2021 04:36:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySG27VkbQXSv3u9wtY+QUBTt+PIMJ+j/7QQp9YI3ulfQaEgc0Ba8CVKY9EiQczgGEgq+UE X-Received: by 2002:a05:6e02:d05:: with SMTP id g5mr5899540ilj.42.1631273799518; Fri, 10 Sep 2021 04:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631273799; cv=none; d=google.com; s=arc-20160816; b=sUvMxXZiTFEYYYpbDABI/9Z6p4SSR1kKeXnSPAWEKQnxu0hTSH8Ebz56bzy55ZyzOz cvevQ/LYhgDs+sBX2uhCrPXFxbuzspY1RSTjnpiD9Gfdl4psZpffQkHh4HPIC0xR7142 KYpSyKzvKk3uzPJ0yrXuDqDZXaI7lNEqOGb2IvLMUS4UlBL5OPs/g9iBW1Au3ygBIWYe myUr1Knr6xYmKHX7A91BkCYaY9ENJmEtaLqGg9aUAUHpajeWXS/NewCehFIw/Nssy8/m GH7r93NQ2axYBTBfr105u4gBYnp0LInn4mOi4LiUF77/hpzCKXLX1MJn0FSapnDUc5dt KyRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Zcbvus5WA0+0z24tstC+hoTCjs3/w77jO9Kk7LmE44w=; b=GAQiDiB5q75lzR48OC5Bws6RMlXOzRux0o8xZBamhWpC6vQYOtxh0m1JHct9Q7DaKY WNfpQNwJdmUAD2OtdlhJLMVgDH7nRoLJJoIjHGXiJM8g6drdCo9iNa7w2pqS009dA6M8 /xEBnY5Ilr6WoFhlu3BZTuuZfkSH1XU8eQAhaw+gLKdC7F5JbIte2rQlxfbsYyrppZF+ Wv6tvKLZt/WwHPowEQnmYdNijL+IoVeYMuhrDGN9WH9OiDeZQKw7l0xaDeyw9K+jPj0P mfTikVRZU3LbXWzFTUVRO0PgGxFRHQmFOzNE7O4VLcURe2z2n6p4XHWg8A6ekoF8YaTX 2kZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=accfizHe; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si5112551ioj.96.2021.09.10.04.36.27; Fri, 10 Sep 2021 04:36:39 -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=@suse.com header.s=susede1 header.b=accfizHe; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232758AbhIJLg6 (ORCPT + 99 others); Fri, 10 Sep 2021 07:36:58 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:35590 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbhIJLg5 (ORCPT ); Fri, 10 Sep 2021 07:36:57 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 13D0820060; Fri, 10 Sep 2021 11:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631273746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zcbvus5WA0+0z24tstC+hoTCjs3/w77jO9Kk7LmE44w=; b=accfizHeK35x//PabQEWdEL0MaQmdN/eNtI66epTYgHerUKhebZi7evLgBghkZVToEJA+8 t1T+XQMPY8rgLvCCPiUhEODpMmUfyQMjF55S1+OBDg3brXARmihcmtRV6X3HY5Lw8K0KZ4 rdOtJzEwKQZeNJWDVM4YhIx3DEaH5L8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D322E13D34; Fri, 10 Sep 2021 11:35:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bwKHMRFDO2EINQAAMHmgww (envelope-from ); Fri, 10 Sep 2021 11:35:45 +0000 Date: Fri, 10 Sep 2021 13:35:44 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Vincent Guittot 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 Subject: Re: [RFC PATCH v2 1/5] sched/fair: Add ancestors of unthrottled undecayed cfs_rq Message-ID: <20210910113544.GB24156@blackbody.suse.cz> References: <20210819175034.4577-1-mkoutny@suse.com> <20210819175034.4577-2-mkoutny@suse.com> 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 the 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. > > + 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_throttle ? 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 == rq->idle && rq->cfs.nr_running) . Besides unnecessary work, it should be harmless. Is the jump the preferred form? Michal