From nobody Thu Jun 11 00:36:12 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 981F9346FA8 for ; Fri, 27 Feb 2026 16:47:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772210853; cv=none; b=WKi0CTUco6JuvI+IG4gVqBhl2xaGereGyj4RF+Z8dndCS2+xBOhZ2X6SoOo0k0VPA/2A/gijaaxtPySpyEW1sNV8xFnjTFoAPvQa+oVBCUawSdOLmTpRjV+2VL3QvmTs7LxxQkSp7F+s3edS70OJxhdyaddQW0G6lR3eCGvjNu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772210853; c=relaxed/simple; bh=Rssq2w++Y1lo/fvBXe5YLpP0g9IpCCZdjqnkYJP1G1Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JiuF967rnW1Gr3z4viiCxgCXxd5cY+zgIlPQrlptCCjlLQ8POBdj5P+iybZemU1L9R7cAcCQ1FSkKVgIP4vsH15QlwOLjePnFMpAd2U2bK7Ydn9oIOiuRlSJH6Sd5al2usmIcinNP83htFnrSd88VkdPSydG3oL+eNkHQT5oe8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aCKQlVbB; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aCKQlVbB" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4834826e5a0so24867815e9.2 for ; Fri, 27 Feb 2026 08:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772210850; x=1772815650; 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=mq+LUorsA0HlRR3ACROfAJQxGLf2q8hYN7Ri8QzQVv8=; b=aCKQlVbBwpN6V6tWyxzSmKxXGlfa+aRd5d41WI1UKjFDmGW0vg8jof+2QnBwP+Rltp kJ5FfnL7xf3FV+kI45i+jXUnng/FBvZSKM0OmZ3Sxo3gTAi6/ocB69e2/MofPKvzG2zB 4/t6XS7GVPoh7jEmuToJj9N8GgkAYE7pJ/cpGPhpu3oGztX+W/TO44MYT7qUYAsWiFVD 7xOm8F6UaLakl52NvcNx3tmewX1kGkmWrTjXXsDzNbZlNCZrZiz1/YgFHoMEKche1dSH u0yT7yCdds6XyCvtT9O+rMMN1ERRC6wc492FfQU0yv7uB8U5wvHVGklq2yjgS0LaE4V6 I0tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772210850; x=1772815650; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mq+LUorsA0HlRR3ACROfAJQxGLf2q8hYN7Ri8QzQVv8=; b=hMmmUmU/frvHnnj8DOlR0vo4Xk511D4U2D0VQ+xYVSFaR+F7Bq2IRzfSSLxB7vmr9t Y8Hx+Z3SneVjl1MXuUmjIHyaOJRVGCEHWs380lYO0KqRS3PEUJ+98dFEuisOFnLDjqD4 EYNghykGH2WmaDVog96e/Ivjzb5KVvemnLb62mrpTA5/Ga+AielNbLQ7UNx2JxdSuSjv P65dcz/ZRbQTDzvsH8JjOWh5LePz0FFQkpel/SVELEaz2/y9q5OAI3v4ySN8iGXOuHtu ze6I9wVIdlMUAbfHhdK8gf47Bu+j17Q6i/50d3jp0sdz1J7lTSXBf5qOI70aSri8LKA1 sogQ== X-Forwarded-Encrypted: i=1; AJvYcCUAa0GhYOT9CCFo6WykWuRk6wqyEYQEArgEiOgRqfUpM/UYJ6y5z3tdD42WxjUiTNl7hQq05NrpCH/vSrM=@vger.kernel.org X-Gm-Message-State: AOJu0YyWQskXSR481dFiiZpuh0jrNazodDVWmNJTyBl6OCJiIlp2ySeI 1y+GxmEfDLEcFdTbnZp5ORXvzfBPt242r8l/ZC48W1Qw0kgCAE+tLC3NUsu7AZnoE2U= X-Gm-Gg: ATEYQzwsyei72QX3mmQLagk40xO90PEUoFnunmZA26tajlOMHrilJ1LbcPzakg/3QBk WeM+t6vd08C7EzAxyiWcepe3+5nlbBr4iPk1h8h0gKZjFSzWd9TwlHgmWdaq52J6xA96ZiuAggQ B3QC9x0mENC6XZKkm9mhnzvWZu4zIhvaRD0qk24j2SrWsJ0Ga5F+/Yr72P/MeTI3cUQh18msVMI aCHMR0SFJGne+kbfbA47/GJnsTOelLeJV4mA9wJTsjxM2bkWD4Wl7y/wOa7m/MOSz9xUi5Giry/ Z0bGG1PmWIg6mHlRYVTP9B1QsM805AgqJ5ASM9KsBFGMbA0eR7mviMOpRGnKw73xtFu/8U/bjAU ourI1+hTo1R+G7pYsATEB4vLd7gqqHT6Aa9b/Zji2FEaFJgAHv3YMk7G2ZIKmw8cWapPIdgC2gS IMdfcX66zGAL0nn1Ee/510wkrW35/JTrgbaYynCda/Dg== X-Received: by 2002:a05:600c:3550:b0:482:eec4:76d with SMTP id 5b1f17b1804b1-483c9bedad1mr55411395e9.17.1772210849959; Fri, 27 Feb 2026 08:47:29 -0800 (PST) Received: from vingu-cube.. ([2a01:e0a:f:6020:6b6b:a907:6b5e:dd2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bfb789efsm112922235e9.2.2026.02.27.08.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 08:47:29 -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, vschneid@redhat.com, linux-kernel@vger.kernel.org, kprateek.nayak@amd.com Cc: Vincent Guittot Subject: [PATCH] sched/fair: Remove sd->nohz_idle Date: Fri, 27 Feb 2026 17:47:26 +0100 Message-ID: <20260227164726.1330712-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" sd->nohz_idle is used to call once inc|dec of &sd->shared->nr_busy_cpus when entering or leaving idle state but the call to set_cpu_sd_state_idle|busy is already protected by rq->nohz_tick_stopped being already set or clear. Remove the useless sd->nohz_idle field which equals !rq->nohz_tick_stopped. Signed-off-by: Vincent Guittot --- include/linux/sched/topology.h | 1 - kernel/sched/fair.c | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index a1e1032426dc..59e498006072 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -82,7 +82,6 @@ struct sched_domain { unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ unsigned int imb_numa_nr; /* Nr running tasks that allows a NUMA imbalanc= e */ =20 - int nohz_idle; /* NOHZ IDLE status */ int flags; /* See SD_* */ int level; =20 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d57c02e82f3a..888875e91073 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12818,12 +12818,8 @@ static void set_cpu_sd_state_busy(int cpu) rcu_read_lock(); sd =3D rcu_dereference_all(per_cpu(sd_llc, cpu)); =20 - if (!sd || !sd->nohz_idle) - goto unlock; - sd->nohz_idle =3D 0; - - atomic_inc(&sd->shared->nr_busy_cpus); -unlock: + if (likely(sd)) + atomic_inc(&sd->shared->nr_busy_cpus); rcu_read_unlock(); } =20 @@ -12847,12 +12843,8 @@ static void set_cpu_sd_state_idle(int cpu) rcu_read_lock(); sd =3D rcu_dereference_all(per_cpu(sd_llc, cpu)); =20 - if (!sd || sd->nohz_idle) - goto unlock; - sd->nohz_idle =3D 1; - - atomic_dec(&sd->shared->nr_busy_cpus); -unlock: + if (likely(sd)) + atomic_dec(&sd->shared->nr_busy_cpus); rcu_read_unlock(); } =20 --=20 2.43.0