Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp493830lqh; Tue, 7 May 2024 05:54:14 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCW/aZ6Wp2EmjMb/6Oqj23LK9dq2yn6hfvThkbMlEO2eogrPD7ZNqQsFb0Lmybn1A+Eoq+8Bg0e6zRgdOJkDMPup6C1gEA9WoIr0flfuGA== X-Google-Smtp-Source: AGHT+IEaMqQpSobfPueiXKbGy2xPhOx66/r5f9OHVFgdsrSvYNkogEOoBbXg9I7fu11sDdJDj/Y7 X-Received: by 2002:a17:903:26d4:b0:1e3:f012:568d with SMTP id jg20-20020a17090326d400b001e3f012568dmr10960239plb.15.1715086453917; Tue, 07 May 2024 05:54:13 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1715086453; cv=pass; d=google.com; s=arc-20160816; b=jlVAHit8fBk7INBkerrQ+fJvx31NkBAigROlsSLxf8dVkLCgpzTBfb0HcqUzfatrLC D06XrzXHDkutc6e+2ymwhUMLSmJaS5nGZ9oXfTeRS+ymdD+HcpxD2KTh9wCA6Sey/0W4 LeAaVvPiuJaKtcp6sj4cmuBGUyqIBnoqMUOT8iOfsm8JIidMzuKiBqYsf2ZQHCjQpsf8 X2Vwhx9Cwv9lFptIlgflWE0OyJz/nU3itl98x3UWjFjKFjgFwQ6BQnurXIl1+kkgAYec Fa4R6JjadS/lc3HpprXuqBFGIfaxkkIW+i3Rbdp8DURPlS38i7Yq1rVNi+CSJADC1oUp hk1w== ARC-Message-Signature: i=3; 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:references:in-reply-to:message-id :date:subject:to:from:dkim-signature:delivered-to; bh=Qf/DRn4qZUpiOJrkJT7ccKfXdyqNZ+DNd7d/2NT8FLA=; fh=SotPdUFMeEEyMi/Tle40x0qcsTe88+U78qIS3skPpMM=; b=dfaiISPu+oMpKmyACGVFA3a6kBL0XxmuP/OwXZABWAPs8w0PAMHDzMLCw9/Cspqrd2 B7VyFz64VCQzoKTdfbbj1owqI0bbIBdnT+qE9ajLer7ScSzGb4PQufy65CGj5RhREjTT xBLU8H9FbRjJhGtVb/YS8t74bypw7uoNkExSBalMAHxlLJc1CgWZKwpLmonp6cASrorA eXhef/JAAYAW+Jh8sBFZRwTslIe91hZGdwGUGpRLPqqG8dcMJCV6vtnUydzXp1TlKc3p 52ewTEXI+9lqW1gB5jfJVicRX0tcP8uhxmd0kP8aJE7ScZ9UaoFQXuKOWNjIz8/Iyw+V WVUQ==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=ByO5uEb1; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-171280-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171280-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j6-20020a170902c08600b001e875a4ffa1si9925404pld.323.2024.05.07.05.54.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 05:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171280-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=ByO5uEb1; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-171280-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171280-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4538AB27F25 for ; Tue, 7 May 2024 12:31:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 851D271B48; Tue, 7 May 2024 12:31:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="ByO5uEb1" 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 Delivered-To: vitaly@bursov.com 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: 8bit X-ZohoMailClient: External 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 >= 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 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 = 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.20.1