Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp152350lqh; Mon, 6 May 2024 14:32:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAaH7tcRVCDvd00p+HmbZKdyWHO3YIS4DOSupSJX0D8RQ/2eVEqzm1NQVzcYPoJ3CNKmWWi3VK7j5uQxwZ8iR3sqve29eskmP0hKAjpw== X-Google-Smtp-Source: AGHT+IF8NjXq8fiT98zwUP8cB/HQd8Hg6KS+62tn3rEk/qoxSRdrM01K/hBKOQtcnvAnD42vYSiu X-Received: by 2002:a17:903:1ce:b0:1ec:7084:3d8d with SMTP id d9443c01a7336-1ee62f75661mr12950125ad.9.1715031122968; Mon, 06 May 2024 14:32:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715031122; cv=pass; d=google.com; s=arc-20160816; b=ix/cxFgN1CPCevHvgx2w1+5pl62ol0qthcKBD7U0IYw2m1njvz+V8yFHQBcF+smoSn /YPbzcj+B/8FGUR63QU+DjZ9sy78JGakNRfEiPny63NQ6Om/YCSIndkulT5ZJLGgvNGs 1rZ3vA3LxzCXksc7ZTzbHM1+DsarZDCP1dz4Crwo1aA/3ntzURVzKbaaARUgegH70fQZ 4bMFvm2ro6Vlxxq+q1j1VGq6nT1ZUk/rEYuUSV6/KTI5C1cogIjxf0yqpK9AJxWelOoH qHG7FvxTwrmjDwNNwYJJZSQvBAb6tR3sDv++SVqfrmtNy2ETvaHr7YXQ15D3D3+Zpr9C WsFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=0C9sj5lYnX5Se84emc2aH7p5IP0yHRhAhDOYWxq1wAA=; fh=MeoGMW10KRyqXJyIMQGlDh08Rdr/e0hOz5h9bZw+y0M=; b=HNdalm5DD6mTKdFCChHVJKAA4j+MnyTmzGh4ZraEWzdanChW//MSapkwgXW3XIhPaE zhUbxvJoeGAHW0ua5Ud2Dzy+/ycPB+hZm7xQ0+Rsv8lozfgOfi1ZZFWr7q+fo6a1s6ha pVSIX6kx1dR4ieTg54xawhyJyCCx2gMO8dHvPkZhELxrLHDRX1b/JDgfdkM3H3jy2MsZ xad4OKft0fFhoGtsMFF20/A6SZZApq+Yi/M7juqm0YthyhUdoib7aVTBw8B7IhwIJenA HU1jU5mTxShgg2XBcKMwUqqx/IX3B1Tv+KG6bTQn+1FwkDM5hikAE/SoMFx+BZZsufDa byeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iljeouOH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k2-20020a170902d58200b001eb3ea8e583si9144275plh.5.2024.05.06.14.32.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 14:32:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iljeouOH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 928EA28230B for ; Mon, 6 May 2024 21:32:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AF9515B986; Mon, 6 May 2024 21:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iljeouOH" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4569B446AC for ; Mon, 6 May 2024 21:31:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715031116; cv=none; b=k1e2vMDtVKbwtqahVlmZwJAWOyKe8bK45ifpRYbRBEu5ySDC26DmWYQRrYVnHjtcl5WYaLvg3cgLxcjwZgb7m80rN8MqpVXOURM2EliKDVoq35ttfJJznJ55SAQy773isn7uX2gG1Yr6xx4SuwqCsx/cwz7LQpshK2TLuRh3yys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715031116; c=relaxed/simple; bh=HVLHvpEyG2mfyd18sLfQXaFprFxs1P/zGv7gmW5JvUQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EE/CGEM95S4SXFXoLZ3QfqM059vVElPMoYnJ9iw6ONLr2Mm0tPUOTgA0M/h0Zm89+bqFLQmLaIE+/wsIutlbDb4oB18iIYLQU4yniib7Sjt6eJfK/2kx/7youGhx61r4xWBm3Fkql1ddcFdUCivCV9qkVTpqmDw2GoQ7NlQUWv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iljeouOH; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-41b21ed19f5so16726575e9.2 for ; Mon, 06 May 2024 14:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715031113; x=1715635913; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0C9sj5lYnX5Se84emc2aH7p5IP0yHRhAhDOYWxq1wAA=; b=iljeouOHU5sQFbR8tH7BH42qIQM5sNpF3usbyaI0bGvqegvnv5OwvVTVCZDZX4ZPzI knovvTsJVJZAMyJm6bZLcDbjEOuZU0v5/Hr7aS7ZAzjgcinjYQsbhG8txQ+HQvcgHega JNwP8ZwBYZAHn+/yEjVFDHZXlM6tqV3V789ps4iSGPgIRUMAMDd6SGsICNkmhMh6/5gA KRYCzsZIdal+U2ucAeShXPFXN1KjKUdGdMwTN03r4ocXgUGz+klzA4GzvnCb1S7IVdvm LTeawtCvnC/y/PJEOX4gvzeZJirfZm4fLSY6RXTdVZ4rEK89pnNzHW8u3Oo+BwBuCOf9 kJ9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715031113; x=1715635913; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0C9sj5lYnX5Se84emc2aH7p5IP0yHRhAhDOYWxq1wAA=; b=vTUyI/UXJPKsfY/aiNetddQk1jjR443bPmdwQk8vCWmmYNAyHJEzLxqGSU+DwOHXN2 b/hhkZ0xAl2R1botBIf8slp83qj2ANUykxyIUtPZ9OThghf+TQTanYNltl/CAPMTZKMW LPYNMaau+fP6Qkf26w9+p6TkXDtKDEt/fhWzF7Ds4loAA2Od1/pK15i8FMsW55S1nrDb PygHb+uTxVJVtLXsbp3qPhXXrM7EF0fJ5T/ugSk0kD0Ug0t32x4068zpqsvsncq0Byhe qvXLKn7sCDt5+5U7VXhY3vJLMfuMIRPFcGChnH80QeXxqBPq1iU5B4/T3zKPOTaRQi1V SFPQ== X-Gm-Message-State: AOJu0YyY6fWl3Lh3pyQHxfRRIEVlY+UfiBqvezT4uXEcFS0Al/bQ7yNg PVEy62cMLmj+CrYE8BiryRvRpdRjRjjzhhn35bR8u9pcRIyh75o8vuIa+w== X-Received: by 2002:a05:600c:1c03:b0:416:605b:5868 with SMTP id j3-20020a05600c1c0300b00416605b5868mr8692902wms.35.1715031113310; Mon, 06 May 2024 14:31:53 -0700 (PDT) Received: from localhost.localdomain (host86-177-210-156.range86-177.btcentralplus.com. [86.177.210.156]) by smtp.gmail.com with ESMTPSA id iv16-20020a05600c549000b0041bff91ea43sm17270669wmb.37.2024.05.06.14.31.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 14:31:52 -0700 (PDT) From: Levi Yun To: anna-maria@linutronix.de, frederic@kernel.org, mingo@kernel.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Levi Yun Subject: [PATCH] time/tick-sched: enable idle load balancing when nohz_full cpu becomes idle. Date: Mon, 6 May 2024 22:31:50 +0100 Message-ID: <20240506213150.13608-1-ppbuk5246@gmail.com> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When nohz_full CPU stops tick in tick_nohz_irq_exit(), It wouldn't be chosen to perform idle load balancing bacause it doesn't call nohz_balance_enter_idle() in tick_nohz_idle_stop_tick() when it becomes idle. tick_nohz_idle_stop_tick() is only called in idle state and nohz_balance_enter_idle() tracks the CPU is part of nohz.idle_cpus_mask with rq->nohz_tick_stopped. So, nohz_balance_enter_idle() could be called safely without !was_stooped check. Signed-off-by: Levi Yun --- kernel/time/tick-sched.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 71a792cd8936..31a4cd89782f 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1228,8 +1228,10 @@ void tick_nohz_idle_stop_tick(void) ts->idle_sleeps++; ts->idle_expires = expires; - if (!was_stopped && tick_sched_flag_test(ts, TS_FLAG_STOPPED)) { - ts->idle_jiffies = ts->last_jiffies; + if (tick_sched_flag_test(ts, TS_FLAG_STOPPED)) { + if (!was_stopped) + ts->idle_jiffies = ts->last_jiffies; + nohz_balance_enter_idle(cpu); } } else { -- 2.41.0