From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1289B12C530; Thu, 13 Jun 2024 12:00:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280042; cv=none; b=fJDy8BDAM35Ai5AL4ZDVtQWBr1MstyCzirvsTOSIei8oIxlc5H1DAWfFt4/TDgfr4y/FQmzZOIGU9hAJTkC5FJm+ePVKetXvU6KTejWMTyXhol4jGCcyfnM3lS4j0QQKqo9H5z88aYmz62lWaY7krtiQrDqLkYNfC0su8xW+0RU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280042; c=relaxed/simple; bh=BTYITVFDaH10HGNJ2+7SFwQh/yHBBLFXSziJvUvd4wU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Clo5sTlqQ2QkVjO/xQefSL4TcjPH/gDwbLL0Aybs9Ss6N37l1hDhhz8oVZKNAbjZj5Jnl3vuL5kDL5lVbNEGyI5Jroq1gWg2pDIlWzG3C/1g0HCk6FcYZn/w0C2/EaW9+00Oir7EL1yc2Zh0gS1UhZNgoGZrC1xm4Uonk6nmDNM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fjvZN3M8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fjvZN3M8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E5B9C2BBFC; Thu, 13 Jun 2024 12:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718280042; bh=BTYITVFDaH10HGNJ2+7SFwQh/yHBBLFXSziJvUvd4wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fjvZN3M8dZu2xAWXjRQpI8I8EeUBxpjzWsP5oUaTQ/20A3wcs5YYkcXACXSVX/jH7 F/kvJgSkaxwk7X40F0Fh5qqMbYOJeE05FFe4eWNvqWIfmzXUfCn2y9obl9t8imWySO PCQ7wGVWr6CwInlX+Zw0G5IiUIhQxY553jdcVNZU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vitalii Bursov , Ingo Molnar , Dietmar Eggemann , Vincent Guittot , Valentin Schneider , Sasha Levin Subject: [PATCH 5.4 092/202] sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level Date: Thu, 13 Jun 2024 13:33:10 +0200 Message-ID: <20240613113231.319263254@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113227.759341286@linuxfoundation.org> References: <20240613113227.759341286@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vitalii Bursov [ Upstream commit a1fd0b9d751f840df23ef0e75b691fc00cfd4743 ] Change relax_domain_level checks so that it would be possible to include or exclude all domains from newidle balancing. This matches the behavior described in the documentation: -1 no request. use system default or follow request of others. 0 no search. 1 search siblings (hyperthreads in a core). "2" enables levels 0 and 1, level_max excludes the last (level_max) level, and level_max+1 includes all levels. Fixes: 1d3504fcf560 ("sched, cpuset: customize sched domains, core") Signed-off-by: Vitalii Bursov Signed-off-by: Ingo Molnar Tested-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/bd6de28e80073c79466ec6401cdeae78f0d4423d.1714488502.git.vitaly@bursov.com Signed-off-by: Sasha Levin --- kernel/cgroup/cpuset.c | 2 +- kernel/sched/topology.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 5d50ac2f26525..6ec74b9120b75 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1868,7 +1868,7 @@ bool current_cpuset_is_being_rebound(void) static int update_relax_domain_level(struct cpuset *cs, s64 val) { #ifdef CONFIG_SMP - if (val < -1 || val >= sched_domain_level_max) + if (val < -1 || val > sched_domain_level_max + 1) return -EINVAL; #endif diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 844dc30fc5593..fc0dcc812a07b 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1205,7 +1205,7 @@ static void set_domain_attribute(struct sched_domain *sd, } else request = attr->relax_domain_level; - if (sd->level > request) { + if (sd->level >= request) { /* Turn off idle balance on this domain: */ sd->flags &= ~(SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE); } -- 2.43.0