Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp460397pxb; Wed, 24 Feb 2021 06:49:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpXATdaElm0szTzKImN4ojStzWChiOsQn+Ur4QD29Lauv8gu5oSVB/NzyFXQdZWYJffZeY X-Received: by 2002:a05:6402:2d0:: with SMTP id b16mr441650edx.194.1614178140914; Wed, 24 Feb 2021 06:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614178140; cv=none; d=google.com; s=arc-20160816; b=RlHltOPO+FuNI6Vxk92JElBAYbRPv81yt87vQrk3T+YL9PYQiINNKaI3rSQ6Dsq1oC h86B2/BExNqDMurylE291IL/qewEpvKoruIUbY7bXkiBQzdCbE+cwVO1K9CJmCkgfj3v chXW6CNZCzlaHl5te8L4146WEisdFhxb3qymBW9Hg6IWg8sLhO4Ve7dN589tHvWgIH+f 4D49/ZvYfYFxLEIQho5XV3XxkXdEVxW0GglAAezZ8mS2mtpLFTxKoIgSOHNdrJFa1kpw B7DpWwaofIJ19ePxSpt6s2FnH4canBozq9P1yZbkpC20W8Yxat0f7pj/t/dDGFh4dzfH kfqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=UOFwRD1FgRA6MEC5Xp6hiDeGTtRx5W6SwmdjJ6Nc2V0=; b=0CeeEThWGtbxHA0ua6/IH4Fgm36DxasMUj11klnfy6RUK5je2YRAd0vjkT2okiEDJz usPqGDX9WqHgINhvA29F/ylvRSqlrtCvr2nsjOV3Cdh3D5FVdjzh+yTEiu4bIsKO9ATY CjWmk7vWTGhndZ26CIiVgSoup+qvJGiUeggf8HztgTnUiMwv/t/ae4dua6ZCDXuW5trD UXBDJzzzkj8yx5BViIPRjAYk9KYlnRIfFhZS07NHg+ftE9O5LNqI5Menw36IGBDf5aQP mYvZzZTX33IQyQyKPhJFzwAJ0Mlt2DHbA1+uEyp1tdZ8BjawLmgErZcDdhgcWA4O5oOe 78lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oqRPByOy; 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 ov24si1518879ejb.407.2021.02.24.06.48.35; Wed, 24 Feb 2021 06:49:00 -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=oqRPByOy; 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 S233162AbhBXOmo (ORCPT + 99 others); Wed, 24 Feb 2021 09:42:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236995AbhBXNcZ (ORCPT ); Wed, 24 Feb 2021 08:32:25 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631B8C061793 for ; Wed, 24 Feb 2021 05:30:25 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id w7so1791619wmb.5 for ; Wed, 24 Feb 2021 05:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=UOFwRD1FgRA6MEC5Xp6hiDeGTtRx5W6SwmdjJ6Nc2V0=; b=oqRPByOyUUv4ZTcjnRH8Vdp0VJ+aeUd8eE5ueydEefmztprKnoEbSw/HWx2rFTKD1R BeMsYIjEFLI+UWWEx3XCuEFUKOaklgfFQaxhrhKeglqWH/gbcop6DcHWG4+ETqY9spHG JUdyw4V60xTHcnOwvUN45NHtXD3eBjHJl2pYbqZjAvJJlrVK4KG+EK76vyQhGieSrXL5 PsFEyLDqj3fANbyqlrWF1aMvZ91vj+x+UxpUcrccVHsKiWU+v7alj/pw2R7/KnOWhmiD hrU3fKVXvqw93dC1HjmXsVQmPAEJRwsk9SSZsfV6gDpXU6+gO6hkQkhjc7ljmTMtH+Ee QUOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UOFwRD1FgRA6MEC5Xp6hiDeGTtRx5W6SwmdjJ6Nc2V0=; b=M1/EIuuCAwwr6XHzG9U6K9WvfjfwrZCWXFeKAFFfwWLNvVOFru439kF+vBqSBTD3oO XVpLE2IsOmoII3z2H/YgoO74LWl8IKhtdbN94rcmcTpbrR6Qs06Wuu97UYCsUpFsblbg mPYt6IGiuQZzplTHuEisF1Hf1wfqcg3IgiA/IEvRe2MsVHvFovYAKaW1WFVYdsl9a0xy SuI0o3HTVEKOWuO0l7+sw0yR3fGx2NxdzjNHHkWo4joDFEQZZf7LoXjvnqhHxeIM5wma gYYTWr0xSZIpFOhGaZcjygSKeUsEDSd+Wg5iu6KeNdwXQVmWfvUuGafd9JuiGp7TGAmi lORA== X-Gm-Message-State: AOAM530A4HkiBuJJ3dZvHLwsA+PnuImhdSz46sSwP9y1BglCbfdu/JKz cbIdmtfuMqTIrqJa0N4NsTfPOA== X-Received: by 2002:a05:600c:410a:: with SMTP id j10mr3682546wmi.172.1614173424013; Wed, 24 Feb 2021 05:30:24 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:58e9:8af9:3cd4:ded2]) by smtp.gmail.com with ESMTPSA id h10sm552611wrp.22.2021.02.24.05.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 05:30:23 -0800 (PST) From: Vincent Guittot To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, joel@joelfernandes.org, valentin.schneider@arm.com Cc: fweisbec@gmail.com, tglx@linutronix.de, qais.yousef@arm.com, Vincent Guittot Subject: [PATCH 0/7 v4] move update blocked load outside newidle_balance Date: Wed, 24 Feb 2021 14:30:00 +0100 Message-Id: <20210224133007.28644-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Changes on v4: - Add a dedicated bit for updating blocked load when entering idle. This simplifies the management of concurrency with kick_ilb. Changes on v3: - Fixed a compilation error for !CONFIG_SMP && CONFIG_NO_HZ_COMMON reported by kernel test robot - Took advantage of this new version to add a short desciption for nohz_run_idle_balance Changes on v2: - Fixed some typos and updated some comments - Added more cleanup - Changed to way to trigger ILB in idle thread context to remove a possible race condition between the normal softirq ILB and this new mecanism. The cpu can already be set in idle_cpus_mask because even if the cpu is added later when entering idle, it might not have been removed yet from previous idle phase. Vincent Guittot (7): sched/fair: remove update of blocked load from newidle_balance sched/fair: remove unused return of _nohz_idle_balance sched/fair: remove unused parameter of update_nohz_stats sched/fair: merge for each idle cpu loop of ILB sched/fair: reorder newidle_balance pulled_task tests sched/fair: trigger the update of blocked load on newly idle cpu sched/fair: reduce the window for duplicated update kernel/sched/core.c | 2 +- kernel/sched/fair.c | 118 +++++++++++++++++-------------------------- kernel/sched/idle.c | 6 +++ kernel/sched/sched.h | 7 +++ 4 files changed, 60 insertions(+), 73 deletions(-) -- 2.17.1