Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1005547lqz; Sun, 31 Mar 2024 09:05:40 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCWrV5LAREWocqnu/FSuzI2zeA58qYU7Itu9KstccFsoDHTXUSs2hpLQlwKx4+E7AHx2MdLEBmG5C+VSBP8S1SKwageTL6UE56mFAzAEkw== X-Google-Smtp-Source: AGHT+IHQENqJo2NnWdV69gc/M6R9+RP+Watn1lEBXY5V3+HvHG+0leV4ridQbXK1uuAiFVGoq1bd X-Received: by 2002:a9d:62c9:0:b0:6e5:22d6:71ce with SMTP id z9-20020a9d62c9000000b006e522d671cemr8574853otk.5.1711901140692; Sun, 31 Mar 2024 09:05:40 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1711901140; cv=pass; d=google.com; s=arc-20160816; b=WbUeIUatP0UvZhqotigyG/QlUEy4Km7xRet+H1zTQm0HmKFaIMlC5xnfZYJeiP1YmN QBXCrT1bJkJozlZs/zUVi3TT6DVjlqi8Sil3osJ8PLlBiJLA03TOrT8YHBp+m2BLKh+n V+E6vlHffytenIzU7YI+IXT1wC8nqvdsCON+jJYRY7JecVMT1RyX7t4QNskQIJjYMICU O9SqVSoD1vuP76EZ7HokW6MQmg31qhRFz7vpdOq/0kdjeU68x2H2+Wk3myO2mS3I8BUl eC4ObLHiV251ulWPTQuz84AUqjHTBXxL/5Ac6+HlT8xT/QQCsrrIo04NhBRXGA2xqZV/ ELfQ== 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=NUqGMZkK65kGj/RodGIbLreaTB54XBuS98+nAYke6Zk=; fh=SotPdUFMeEEyMi/Tle40x0qcsTe88+U78qIS3skPpMM=; b=FzevOV8VV+Q1g8kAG+ZPYSdhA4DVn/y2zALewNLd1KJwNipTdpPh74ZGA4bRRcHF/0 cANwrNg7EHptL+nibrNJiNZKRwMK+STEcuDphWI/rDmUqJq7QD3TmiOGEakiGGuy5DDu IU23bw7NaLTRN+ZEsUSE6Fv2zB2AU2l0bpqwMopiwcFdFA1nLigFVNOpGWLB3c6/Rl7N ThUVhUGF8Q2Tc0ByWwR9Vv45VtCoMFlbBRLVz7Za9FP6lrD+T3GzVbVKBp36B3rF0Lbd Hy+ya7+QAB+tEKlfCJT1AUhDmPhQ5qcm/0vzbdwuJl4O2yhg7fhzIUOa9CBgvtjp6RB7 gqTA==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=cgdXFN2b; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-126111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126111-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a10-20020a0cca8a000000b00696a6fb4fb4si7894106qvk.212.2024.03.31.09.05.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 09:05:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=cgdXFN2b; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-126111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126111-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5264F1C21BF3 for ; Sun, 31 Mar 2024 16:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18A8614831F; Sun, 31 Mar 2024 16:02:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="cgdXFN2b" 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 A0988145B1E for ; Sun, 31 Mar 2024 16:02:26 +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=1711900949; cv=pass; b=RAuAxJWdl+gbeiiTCsHZ5WVSmQZ78ugYRms9WGIikFubJFvv8SD1AEzd2xe9Pkj23QeeMI7JaWTeKbxaxYvzulp65PJyR8fGhAFpbaVHrv00hFAmTBm3qoOPcAil22YG+oDRPT2z8ruAQ35F5ayMWbrGb9GJ/prdgYP0lDg0V/0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711900949; c=relaxed/simple; bh=7UriqIK5rF+laeCwYFZ6FEfSLpeqjqBoWq+9Dbpj8RE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H21a7/GUFQyQCsd4Fjf3HXPHi7LmaQV3nQNMDvI26RHaa34sv79ZzB8CKuA4sfwm1BhqurYfssttwMbnXMZBmEdo/YzEInDFlxvmDYwOYcIIAsrL0TmybhdXioAx2baoIdl2qgf7L57Lfi/jBb1ChSJb5xVJc9Jbhm92g0q+RFg= 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=cgdXFN2b; 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=1711900922; cv=none; d=zohomail.eu; s=zohoarc; b=BtVoi6YDJhPfA0QR3VMk8rTo/NyjF0EHmIVw7hKKEZZmzS0UqS5F/gmcdghvMC5msm5qiBXgtqH56DFJ2Wpjk1zY9KxhHCT4rqqARukhH8oALHrQ3yGHRuC65Q9fn1xSmYiJVoQNj8yu8ZNDImiKfrW/q+9IaDJtl5MyQII3vz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1711900922; 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=NUqGMZkK65kGj/RodGIbLreaTB54XBuS98+nAYke6Zk=; b=BmSdmxBQrUTW+fiWkkvmJZjM3pukz0uHYBiOAp56Jkl9vNv16lZRY1JZES7Xct8E0eSa1shu7dz0MXs9ePImUMgSXjELRgb2W4pLSly/wZ/I7qfRrjqQbGFCi2aTOUdwW7gqQaqoNaGlRMhJGC255tnJNSWrNWvReCzzseH3mVI= 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=1711900922; 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=NUqGMZkK65kGj/RodGIbLreaTB54XBuS98+nAYke6Zk=; b=cgdXFN2bdwUwcxvRZPtnRVFPokwYLVYzaFIVaDvcidAtxJJ63Y1hsIeOF1L4+caB mmxT82ikSSl+lZGFyKZVoDIiskbwK3fFAfRYxC2yPhKdAd08EDcF8dPATFdsQs7Cp9z 7U+9WBunfZ3BAMT80UUrmo+vaTx6S9MG5mk8C5XE= Received: from localhost.localdomain (217.20.170.230 [217.20.170.230]) by mx.zoho.eu with SMTPS id 1711900920516823.7166383685085; Sun, 31 Mar 2024 18:02:00 +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 v2 1/3] sched/fair: allow disabling sched_balance_newidle with sched_relax_domain_level Date: Sun, 31 Mar 2024 19:01:47 +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: 9ae7ab20b483 ("sched/topology: Don't set SD_BALANCE_WAKE on cpuset domain relax") Signed-off-by: Vitalii Bursov --- 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 4237c8748..da24187c4 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2948,7 +2948,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 63aecd2a7..67a777b31 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1475,7 +1475,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