From nobody Wed Dec 17 13:50:50 2025 Received: from sender-of-o51.zoho.eu (sender-of-o51.zoho.eu [136.143.169.51]) (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 6BDEC15AAD7 for ; Tue, 7 May 2024 12:31:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715085067; cv=pass; b=vEj2On4ucnwmOLmYTjLI+1yw5NeRu2NxMfQQpTP4Jsm0ShISAkQcOonynuLC9xGDR0oGBwi7bivhuWvi8w5tDy0+d5CS9HqURn2e/641clNdl7vSF8RrfJHsjBzYTfToowLEuRBg0jyN5dDKChqlo9En5hXRQa132k37+b8lQYY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715085067; c=relaxed/simple; bh=6q30XqqIAVi2szTLHa69yYutLTZ79zT2WYETcCvxjFw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XyI+75yps+73fzL/MqvzTfDZqy9ymFCWQFFYoLC2HlrBMemkKqNBypNggqRBnXSn4+SXYSPbwnV+P5HZR67rNDBC5xT49RcDXkuONNFTQ2VGovLmRLyh7SnTzous9/xMk3S/DgUGuVE7z5SCJoNMsMUB373jwzPerEU0rwTQSog= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bursov.com; spf=pass smtp.mailfrom=bursov.com; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b=ByO5uEb1; arc=pass smtp.client-ip=136.143.169.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bursov.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bursov.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="ByO5uEb1" ARC-Seal: i=1; a=rsa-sha256; t=1715084143; cv=none; d=zohomail.eu; s=zohoarc; b=aNOOw+VmB7ew9ck5+vlGFbOhYVSxOjPxpgvJ97AeMQM2tIwcVCzUGxEaX1+CzaMh/2CQUWQ96W7RHDXrXT69O+p2vFu7+24w55F2FQV5xOkuCSWpARUEVFCfWoRiEc75B/pkYO2QJEziq9aL4kGWifL2IeC7a3+v+cwHDcY/5ec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1715084143; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Qf/DRn4qZUpiOJrkJT7ccKfXdyqNZ+DNd7d/2NT8FLA=; b=U6Ac0+ebrQqfm8Fj7JYlxCNueu5GnB3iREIb8qmslq5u/OAefcZHXNhH7OHK5MPiT0bvrqo2Yr3Y1ysLZEZ5PxbnEgwQzuDgobkbR5FAMB5/odWkeV47phMgVspLI5cnOIivv0QWpFFgwLGuPDtlpBB4Atw2ynatDJO+UOq/Bp0= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=bursov.com; spf=pass smtp.mailfrom=vitaly@bursov.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1715084143; s=zoho; d=bursov.com; i=vitaly@bursov.com; h=From:From:To:To:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To:Cc; bh=Qf/DRn4qZUpiOJrkJT7ccKfXdyqNZ+DNd7d/2NT8FLA=; b=ByO5uEb1Dhm5+QUTavnDcozXV4PjbQerVarNJ2uc6lpFYpIhBr1zY+MEhUbfYNIy dlSAFKIM8J6ivbUbSp4CRkvzr6TRMcJlX56BCzI39K2D1csGIQhjhc2HBLcETw6JAev ngIoz1boPT4B1PKMqw4FDek9fIpUu4pGqoXvP8z8= Received: by mx.zoho.eu with SMTPS id 1715084141240732.6014896306322; Tue, 7 May 2024 14:15:41 +0200 (CEST) From: Vitalii Bursov To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Vitalii Bursov Subject: [PATCH v5 1/3] sched/fair: allow disabling sched_balance_newidle with sched_relax_domain_level Date: Tue, 7 May 2024 15:15:31 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Vincent Guittot Reviewed-by: Valentin Schneider Tested-by: Dietmar Eggemann --- 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 a10e4bd0c0c1..c12b9fdb22a4 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2941,7 +2941,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 >=3D sched_domain_level_max) + if (val < -1 || val > sched_domain_level_max + 1) return -EINVAL; #endif =20 diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 1d6eefa4032e..a6994a1fcc90 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1474,7 +1474,7 @@ static void set_domain_attribute(struct sched_domain = *sd, } else request =3D attr->relax_domain_level; =20 - if (sd->level > request) { + if (sd->level >=3D request) { /* Turn off idle balance on this domain: */ sd->flags &=3D ~(SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE); } --=20 2.20.1 From nobody Wed Dec 17 13:50:50 2025 Received: from sender-of-o51.zoho.eu (sender-of-o51.zoho.eu [136.143.169.51]) (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 070221EB39 for ; Tue, 7 May 2024 12:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715085070; cv=pass; b=szr4ykmtXP89O7WHTU2Uvw+ebbfL/DbNRHV+kL+F8hoiOfoNYw08GopAyPW3glHykqmBJz9OiDQS3GeLXbMyi3QRvcltUSBPV3N0ajoXU28JED4wV84jQ9BseBAfs+fqkP8EEM7bV6nMa6w8Jylgu3fzdz9TdvcWgSaKDBPBeWA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715085070; c=relaxed/simple; bh=bs+h8XBwWTekscegq5DgAwV/n02OCwwakDqEuTkElAA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KFzFFIcf8tyexW6+xBRfiJMyTtlw8KDvI5lYrRRqH7mmL+cRiRRsStQQCARK+A/IBR02KnYXcKppReVJ0gczgUFpoa2QDCjx7tu9pyYn+qP9e961CC9KnOY8aiwFTHzz5aTBzD/FiRY6++8tu4MYrkYmYPEUFWp5OGEWxgRxjrA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bursov.com; spf=pass smtp.mailfrom=bursov.com; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b=pqXfNRDR; arc=pass smtp.client-ip=136.143.169.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bursov.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bursov.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="pqXfNRDR" ARC-Seal: i=1; a=rsa-sha256; t=1715084145; cv=none; d=zohomail.eu; s=zohoarc; b=kwVJ+N1mjKd6Co/P0zGuK5KQd/aoxmUeGKS+d2meh6+yVidMcN2HfEY43ZR96cJJSt8MOFzmYqTQ0GPIsFPIpeqc3AU7Nq6ypOPdRzJKSKe1fgVSCvsN3qr8LYZKk2CuH1P2nyk4JzhMZPHNiDehEvooeLQZTLL4jL9+OCQL7yA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1715084145; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=AlUlR02UFXlJEerPpMyC2hkxwpJ7T7Z0GszKEfkWHbk=; b=jqADz9Z2E1Mtx2NS6NLeMdLzIEFJ2PcXqzFO9j6q+ACDAk0qVu4UPYsMa0o8Eqpr7kQ420uOC4d/MVF7HPz8UJOf55ZMRUPtWKQe1u7gn875ZitK3YB7K7a3NDyX5iUtVNgINOTou+eicFU420XWBcHwOs0mQhuKUnfyyYDgnJY= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=bursov.com; spf=pass smtp.mailfrom=vitaly@bursov.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1715084145; s=zoho; d=bursov.com; i=vitaly@bursov.com; h=From:From:To:To:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To:Cc; bh=AlUlR02UFXlJEerPpMyC2hkxwpJ7T7Z0GszKEfkWHbk=; b=pqXfNRDRw1Rpm4pvBwrV29vB/We/8YAqmq9V6uEsm2K2BGq8jV+pU5PbQxj+XY/P YdSP1oIKE6cVGWFYOJaeBd+JvJ0McFo41m62SjXYaxM/CT65Jl+g/ZTQ5FmasZttjVs rhb6WzDNXntkLqOqaroXJp0F8Nvokyp4x6GAfJVc= Received: by mx.zoho.eu with SMTPS id 1715084143194878.4481998596577; Tue, 7 May 2024 14:15:43 +0200 (CEST) From: Vitalii Bursov To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Vitalii Bursov Subject: [PATCH v5 2/3] sched/debug: dump domains' level Date: Tue, 7 May 2024 15:15:32 +0300 Message-Id: <371eb783614dd9263cbcc91c9a560adcabe6e539.1715083479.git.vitaly@bursov.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Knowing domain's level exactly can be useful when setting relax_domain_level or cpuset.sched_relax_domain_level Usage: cat /debug/sched/domains/cpu0/domain1/level to dump cpu0 domain1's level. SDM macro is not used because sd->level is int and it would hide the type mismatch between int and u32. Signed-off-by: Vitalii Bursov Acked-by: Vincent Guittot Tested-by: Dietmar Eggemann Reviewed-by: Valentin Schneider --- kernel/sched/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 8d5d98a5834d..c1eb9a1afd13 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -425,6 +425,7 @@ static void register_sd(struct sched_domain *sd, struct= dentry *parent) =20 debugfs_create_file("flags", 0444, parent, &sd->flags, &sd_flags_fops); debugfs_create_file("groups_flags", 0444, parent, &sd->groups->flags, &sd= _flags_fops); + debugfs_create_u32("level", 0444, parent, (u32 *)&sd->level); } =20 void update_sched_domain_debugfs(void) --=20 2.20.1 From nobody Wed Dec 17 13:50:50 2025 Received: from sender-of-o51.zoho.eu (sender-of-o51.zoho.eu [136.143.169.51]) (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 B99BA73530 for ; Tue, 7 May 2024 12:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715084183; cv=pass; b=rPjUreElMk1bZjax+IWuNzrJs+/6TYDFkq8ZAPrn+Hxur+OuHxBFcdDyMk0Kc6dsf3+ft+85igGZSioacmdA+OjnDyP3YYcgwjn5WNSoJKhyScfmM46+Fw+VPGz4dzAG9pnv6aj8MX9JJcg7FGGwSKCRs6Q+o9Fa8Hb7ibMBN1M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715084183; c=relaxed/simple; bh=UNytWRjy0n4ufLE4F4bgxm6zk7gEYUpI72DLf8Lh5nI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u98cPtB4tuv5RLYwwvWxjt7pBPkKKXmFZy0wy5NkCaHg0md/RylY7xSGxrxNjg37fIZST1d5odXO/sAfRsCX+oXbKDsFtLpJyeGdvnfw7oLpV9YYZvaBg6MrOlPxp3S70m1J7Dluu25t3/V+PdarWuH+6swnDuE36q2i+uQaC/k= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bursov.com; spf=pass smtp.mailfrom=bursov.com; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b=DlBDuFVN; arc=pass smtp.client-ip=136.143.169.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bursov.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bursov.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="DlBDuFVN" ARC-Seal: i=1; a=rsa-sha256; t=1715084147; cv=none; d=zohomail.eu; s=zohoarc; b=eDhgaghwNO9TkR+6P3sk9209X/Av29QJ+dZ08tiqdNuNI4cO/NbU+FZ9qILWIAFcFELF5KDRIYTUUtCZAZG3UDVhnCloVz/Y/oSkef/idXRnc+HK5hWWhw3fRH4SsM3YvBsIFDLJpWrWNcfDExox9rjD+IrYbev0Y608pwSn3X4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1715084147; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ztyWG1tL5SLCHcSqhDRsGp0b5KZvYGYaxjeAuQmObZI=; b=C2WDLSV4C3vw7yohjhzOuQmkQE/AXQFqX44q2lX1yhdS4k6w2xy/LjqKbYEaRn02DCgi1h75cWqiOrLmVO9QKIzbBIxBZX9fN6Gs8AroY6L/3wdYQkg5DybRn5TzIl2yGCuUmUDEnPWS01lIZkvg7FdZQNnG+C5Tb4If36ypG+Q= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=bursov.com; spf=pass smtp.mailfrom=vitaly@bursov.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1715084147; s=zoho; d=bursov.com; i=vitaly@bursov.com; h=From:From:To:To:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To:Cc; bh=ztyWG1tL5SLCHcSqhDRsGp0b5KZvYGYaxjeAuQmObZI=; b=DlBDuFVNVCo7Y0r8HV6HNTPJ3bCx3tbX3/guZf9EpcjlakXuGYdSZsJajtJDUx1c u6SQyfkwIyqnlQaemwep7bVHUhVVFei43+CBJKAR6whOeHW/vqiiXvJho5YDDQ7qSdw LG3cX7e/ehTLCQ9TxD1cT3Ld8+hyRCJNVlrBQa8A= Received: by mx.zoho.eu with SMTPS id 1715084145078400.64154813110486; Tue, 7 May 2024 14:15:45 +0200 (CEST) From: Vitalii Bursov To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Vitalii Bursov Subject: [PATCH v5 3/3] docs: cgroup-v1: clarify that domain levels are system-specific Date: Tue, 7 May 2024 15:15:33 +0300 Message-Id: <986e31abb79644e74df0b80adc829eb71a1e4551.1715083479.git.vitaly@bursov.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Add a clarification that domain levels are system-specific and where to check for system details. Signed-off-by: Vitalii Bursov Acked-by: Vincent Guittot Reviewed-by: Valentin Schneider --- Documentation/admin-guide/cgroup-v1/cpusets.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/cgroup-v1/cpusets.rst b/Documentatio= n/admin-guide/cgroup-v1/cpusets.rst index 7d3415eea05d..f401af5e2f09 100644 --- a/Documentation/admin-guide/cgroup-v1/cpusets.rst +++ b/Documentation/admin-guide/cgroup-v1/cpusets.rst @@ -568,7 +568,7 @@ on the next tick. For some applications in special sit= uation, waiting =20 The 'cpuset.sched_relax_domain_level' file allows you to request changing this searching range as you like. This file takes int value which -indicates size of searching range in levels ideally as follows, +indicates size of searching range in levels approximately as follows, otherwise initial value -1 that indicates the cpuset has no request. =20 =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -581,6 +581,11 @@ otherwise initial value -1 that indicates the cpuset h= as no request. 5 search system wide [on NUMA system] =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +Not all levels can be present and values can change depending on the +system architecture and kernel configuration. Check +/sys/kernel/debug/sched/domains/cpu*/domain*/ for system-specific +details. + The system default is architecture dependent. The system default can be changed using the relax_domain_level=3D boot parameter. =20 --=20 2.20.1