Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp599133pxb; Wed, 24 Feb 2021 09:54:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxA23jiBNfwP6dVwYnlQ0FjQAqRUewWh3u4CfVJAmqmm2oMyp32xx+ZifwErqR+j2knq3cr X-Received: by 2002:a17:906:c007:: with SMTP id e7mr10896894ejz.518.1614189260179; Wed, 24 Feb 2021 09:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614189260; cv=none; d=google.com; s=arc-20160816; b=FxM0HT4MTXJTuwpJ1R0gwfI8KvoJUs4nx5A15Aa41aLqld80C6PyV62kS+fKTWeaGX 1343X6UN28DdWNEuF0ytsnewuoswFYB75v7Mw9hd3jNVZK813Ra8J/o6KbaYdXbxzWky jRmGsiLEGYmoCRfURCGSzLW8PwIQMj0JuYasiikwwqns8UE0aBw1pov9j084S9+COH3i 9iHSXYTWMBC7sV8GivVDyT5botLhs76vBNvMOdQTth6LYN4pM2i4x4vwPjffe7m3oT7A DMEuoUuZuf5cC7io7CGx2gEjm3+n1FhJjPhUVXfesQRraB9bu5/Imykmf5f1b6VEk8wR pUng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ay8VFNLJCcW6ITuDju9MjR/2sje2OxTEgOlv3Ly0CcY=; b=RGaETTsjXAtPtKSLysxenp9NACFViSSLKlQPAqP97HTwfsgR+0ZB3SIZEm0BOd1NAJ A9akmVz1viyoRaY6egCjx3fIsXwg2yQSqMpVYIDDS7Jz/iFFczELj/FWPzBc8Hon3myv F6QtvxigjFiD1XPeVO01Y4TXNFQ9iSbmWwlWQ008DjnHPfcOEccmzxmo17V87GLCrTEh 8Cfhti8JMzfY7ajNPtZH5dERtahYaZFCwmdorE1LJ6GuJB9fZwyttX7+LVTtSSRWlGJY /uo5vdbYRVGTMy3dMzeIkHfxy4SJhsShm1X4zW13wUO7dWakB9/FVaTzWsSxf6OBiNmd KZPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lCyvLtLY; 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 e19si1668835ejj.523.2021.02.24.09.53.53; Wed, 24 Feb 2021 09:54:20 -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=@linaro.org header.s=google header.b=lCyvLtLY; 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 S234316AbhBXRvh (ORCPT + 99 others); Wed, 24 Feb 2021 12:51:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbhBXRv3 (ORCPT ); Wed, 24 Feb 2021 12:51:29 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD59C06174A for ; Wed, 24 Feb 2021 09:51:14 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id u4so3426876lja.3 for ; Wed, 24 Feb 2021 09:51:14 -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=ay8VFNLJCcW6ITuDju9MjR/2sje2OxTEgOlv3Ly0CcY=; b=lCyvLtLYbt+QkOD05izVJUyuG3qaryzImuBF5w8wxwfxaPXfsIKKRGde8qTyHvdL0g j8BavobCo+X7pkbWEetsWHJiGNxe+DdThV+f+fuTvPB4Igfib8IL5XbMUwlenD3kEGhU UlaqYzINKcZgoQSQ7/Tm/PBWIBPGA5zNR6FUoBH9cAcxc5RvKkysTmAbMkBIHraJTNE0 SD7dkxzGYfzDtoY18ZQ5mY/c8cSNcDV7x7/+B8y5T0MT7O1GQf+OJITAdD/vmbLx2VFV GT6DdfdNPrhORxR8Bt4pE1KNW9M4lTYWLU+NvxSKCPV9QpEWdUngNJH2VNLTxH+Enl7Q rwPA== 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=ay8VFNLJCcW6ITuDju9MjR/2sje2OxTEgOlv3Ly0CcY=; b=lS2BoyZGBAXkLHBGe6krWHQT9MBG6eQSKYH97lDnc/P+OY7ZuB+Ww04FmyMqDDrOqy Ep3fIBDn+auUljwH5KYVW6qiaIb8UJGDxBt62ko33ABvyg0DDBd/r8qlMqwAC7iJ+iW5 WhCbsYGAE7HolWAVC3du0Bf1LOfSemzOExL6L3pnf6puQwhPKxxe5RkLqeiH2474nF6V QE5p5pZMJh55kx20xULM1o3gYh7cP/ikFFt4OpgpoVZi5J5wRygFKyxr4uuaVVdcqMWl 6+LhGAZH4t0Z+TmEzqlgC6E4UnkXjAn3knb40pr0wutBxrjjWQellL2D+rprwkErg4aU 2WoA== X-Gm-Message-State: AOAM531kTvNibBFKWHx+k83NqZL6VB01lwU+4Pet+BmwsrlMHIVlJgOH fuM8sbGdvNUaQiNYlLrd9zrg5u38p8+evUbjyzTaQw== X-Received: by 2002:a2e:b355:: with SMTP id q21mr20228418lja.209.1614189072658; Wed, 24 Feb 2021 09:51:12 -0800 (PST) MIME-Version: 1.0 References: <20210224133007.28644-1-vincent.guittot@linaro.org> In-Reply-To: From: Vincent Guittot Date: Wed, 24 Feb 2021 18:51:01 +0100 Message-ID: Subject: Re: [PATCH 0/7 v4] move update blocked load outside newidle_balance To: Peter Zijlstra 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 Feb 2021 at 18:41, Peter Zijlstra wrote: > > 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 ? Yes, good point. This will clarify the range of improvement