Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp593021pxb; Wed, 24 Feb 2021 09:45:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJytV0WZX74G3ep0qC6MfaXEXfR+40vnYH3BUkWZWM+s6BXpCsiUTZM9+m9KDs4Rq9G6aM/6 X-Received: by 2002:a05:6402:c15:: with SMTP id co21mr34506677edb.115.1614188740889; Wed, 24 Feb 2021 09:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614188740; cv=none; d=google.com; s=arc-20160816; b=MB5qWmrUNaCHqcvIce7fBwNJdWisz4p7QNyk73555nim+4oqWQ7OMw+tWVmkfgnTd+ djx1lRjuldhnlRFD/auVVElVy6RePu2Z/AnRei5I5+rQXIgMfnhiYuJ5JWV4fGUMqYW/ XkIFud5vVrcn51UzVHk6V2SnDQYVTzszsazzOS79KveI7w4GWf6oQQ/APawAufxY7Pud hjX27Tc3inq+lKonvXtSXWaJ594eTgfzp9dCmLUr7sZnsz0iouO7YyiJPnQpeech7BrE /1gcF2mLlOuK7yFsSYv0lKatohBd2YccAwZ++IamS/v0W9y7K61i3DEqm2jIzk1c7bMx HoTg== 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=AZwEr410feKVIXvCVj35Znp2sGtryfBWRcBLV6+cjK8=; b=NwgUOv2LFttidtVJDlxCzaUa4Rdac3AQqZAHkI6yIIqxP1xE4ddLGwFaIji0L1PyvT IL7xZ0Uo8ZGYD/mke647RbJXmEg/NGcdWmNA2EeD+UZOZD4kxDOlD7OfmR5fzSBg8hMR UaRvWRV4SqgcuoVa4zdvJXbXnV/1X/dRo0Zp/DxvSt8nQUZzQwBkjQwJS6zG0tVJOXft oZPlVfem3x4LvGqazW/KJTmhQBOi87sfNSd2oaz3FP6oRSzT5vvOVTl5ToIPlBC0+U/D d9GRLO5hE58zMObQvybXpUvtCPeUwlLj/+w1xW2eafUEl5BPM0iMEPtlUfS9MQ1nxyCh AvBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=GIY8rMdx; 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 o14si1640179edc.231.2021.02.24.09.45.17; Wed, 24 Feb 2021 09:45:40 -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=GIY8rMdx; 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 S235543AbhBXRmN (ORCPT + 99 others); Wed, 24 Feb 2021 12:42:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbhBXRmM (ORCPT ); Wed, 24 Feb 2021 12:42:12 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87CB3C061574 for ; Wed, 24 Feb 2021 09:41:32 -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=AZwEr410feKVIXvCVj35Znp2sGtryfBWRcBLV6+cjK8=; b=GIY8rMdxjvPdrYBLMx7jKiATdp SDZxb5uoY2/trxTRq6TsHskE1B7D3SRtD7eUDNFkLcQwSJH9qvTJDEeos6JE5RvMxTvN8JJNqLheH pqny+EBd4wXKT4ssJkudoTxRxesAzGpSObkguYq9kSd+NV7xBWUseexArtnl2Y6wOC2u+o8e4BNme T0l8IV4MQ1jvKh3Emim8Tt3j5O0QtWQy1frt1Q8ufBUsOzs/ayYVSeXRlp/3idTGKZHUTvpmi13AZ UJe8gtD/Fb9kJFa5tgZYxufaLexLwMvBWmJSZLNwPP1OFMLDJpwP69m0QHd+rVMMNgdlRtM+ihGn4 aazUHLdw==; 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 1lEy9z-0001sx-UO; Wed, 24 Feb 2021 17:41:16 +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 603A2305C11; Wed, 24 Feb 2021 18:41:09 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 478E2206936D2; Wed, 24 Feb 2021 18:41:09 +0100 (CET) Date: Wed, 24 Feb 2021 18:41:09 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel , Joel Fernandes , Valentin Schneider , Frederic Weisbecker , Thomas Gleixner , Qais Yousef Subject: Re: [PATCH 0/7 v4] move update blocked load outside newidle_balance Message-ID: References: <20210224133007.28644-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 04:57:15PM +0100, Vincent Guittot wrote: > On Wed, 24 Feb 2021 at 16:54, Peter Zijlstra wrote: > > > > On Wed, Feb 24, 2021 at 02:30:00PM +0100, Vincent Guittot wrote: > > > Joel reported long preempt and irq off sequence in newidle_balance because > > > of a large number of CPU cgroups in use and having to be updated. This > > > patchset moves the update outside newidle_imblance. This enables to early > > > abort during the updates in case of pending irq as an example. > > > > > > Instead of kicking a normal ILB that will wakes up CPU which is already > > > idle, patch 6 triggers the update of statistics in the idle thread of > > > the CPU before selecting and entering an idle state. > > > > I'm confused... update_blocked_averages(), which calls > > __update_blocked_fair(), which is the one doing the cgroup iteration > > thing, runs with rq->lock held, and thus will have IRQs disabled any > > which way around we turn this thing. > > > > Or is the problem that we called nohz_idle_balance(), which does > > update_nohz_stats() -> update_blocked_averages() for evey NOHZ cpu from > > newidle balance, such that we get NR_NOHZ_CPUS * NR_CGROUPS IRQ latency? > > Which is now reduced to just NR_CGROUPS ? > > Yes we can now abort between each cpu update OK, shall I add something like: This reduces the IRQ latency from O(nr_cgroups * nr_nohz_cpus) to O(nr_cgroups). To the changelog of patch #1 ?