Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp485411lqh; Thu, 28 Mar 2024 07:43:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXa67e4behWzthTR7/ciiGsalRgkbVQI+5SCaVSMzN4Cxz3slyiXECKa46DZoqwvl6XlkM+XZqB3EIjQJBxdahOqO39rK5V6wNsfjaUNA== X-Google-Smtp-Source: AGHT+IH82YqDsFspOqtH9mT923KCwgR3UWOC97Oa3rYNgYj1w4P618/9/qP2K/CFYD343zwCD+QN X-Received: by 2002:a17:906:ccc3:b0:a47:1f61:4d02 with SMTP id ot3-20020a170906ccc300b00a471f614d02mr2039905ejb.36.1711637007394; Thu, 28 Mar 2024 07:43:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711637007; cv=pass; d=google.com; s=arc-20160816; b=SKTpwkfpraCt2vx//mwjOKXBabivUG8dJH1gDUz4mY/dyGiNMJOTOKCYEL3V8m5tD3 WWSWJ80N9jPkGRAY0FEY6pLla1D91HPqmI/xzUI0t7bx/8roO4TWknFLSpGYhfNe/GDz hw/3d+fxfU79ec7k4fAB0GzFYC0oijkWeXExPpw++wVyCT5NWxxwg6JH4nKhuQK8Cl9H JwJyy9e/ggcrl+COR8uYACgJTys1hD3bRflbK+HfZ5KBdeKmUAmoOZw4xnEOX+Dvn/qq odwWxC38NlidiqcZSl5hehsRRXanMTYGLtWK17h20ZqZMCxqNA8DjgQUBm4fr9AhrNku iIEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=+IYKdlLOF58lOHPLCX4kHglsTCyj/A/Ku3dDSw21YHw=; fh=s1LvfttCmCDcfwY6j2Hp+Q5/xjkh2+JAF4uEY2fPazw=; b=uJD5jnq/YCCKGktHcrxO4F5vZmG636csAXQHwPSady5pMFDuJYDBNDVfbgZ7B5v4LB 0bp2jN1/Kl9QR2RWzTR1+6B3XNm7i7jvjmzQ0OUy44m4tsifM8QZIfhs9LqrF7hl4deE +8lE1K95CnM9+SFMyMf46/rysvWhRvbQuZDBmoOQzhJUf0Wbhi7h2uygn8GRNb1CJ2Yt s2oDM96EPEs1bBEfOrtfQSqgNz4pfhW5s4LZZNDOGlEBZ+D/+P8uQj+4CdTcrxo1MeTR aid+/zBKhaManR+z/S9EwYDBOFrE5q6+GF4TAQZRSAcnUKckugN33Gy8HXnSQlVQZq8H l4NA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUsxoU5y; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-123100-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z22-20020a1709060f1600b00a4956d4d603si771678eji.639.2024.03.28.07.43.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 07:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123100-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUsxoU5y; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-123100-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E8EC21F277F4 for ; Thu, 28 Mar 2024 14:43:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D726C1FBB; Thu, 28 Mar 2024 14:43:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VUsxoU5y" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 86759127B66 for ; Thu, 28 Mar 2024 14:43:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636995; cv=none; b=GzskooMN+4GCTPw1CST8nPyMEKq03bIAHeThWR4ma5eYRlsBHVS85nJ59/MbWijJ/Y/h9CyTHsPm/acsrphI8wmCFDg4utllmU6HE2iMU0HK6SMM3uiyOuMJVRQKlLaMvSIAG6X8/lXbMG9wyigtJNkWDGsIXIgq4X86u6outGc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636995; c=relaxed/simple; bh=FP+PjcJtBihvI3lmTTnq4UygK8snjjZb87vYNUD/7Mo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=I59iW1mmce3m8X9FHOe36vnoYLG2eSYfgvTNhBrzkD153TZhNmr2L0mdWnkW9BvWWG1B7XZ56+RlLrzzqn1DsU2IBfOkwLgri+wOydCnXDJFCCLGIXwYBA52O9KoGmc6K0HPI5nime8sg/k4jvFUYMQtOoSW8avFhaD9JGKFKI8= 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=VUsxoU5y; arc=none smtp.client-ip=209.85.210.178 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 Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6e74aa08d15so938504b3a.1 for ; Thu, 28 Mar 2024 07:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711636993; x=1712241793; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+IYKdlLOF58lOHPLCX4kHglsTCyj/A/Ku3dDSw21YHw=; b=VUsxoU5yUXtSMgNXcbZIEebWpO/9PLxMQkVQfW4G660/BBorwPZD3wcl5fETKpJBWO DaEDVUZjvw27ciJnWwh6Whg7ox1ui/09aHwtjrMB34Bn1O+DvXU0xlJAu+JWORkOx/GA eEFKWSKzw6KhfAWIhCzfkIwgwAL2vEfLViBJtBSgI2pdbHEp1d40zACD00h4rv2t0MXT 2g/HfuaWuNwLwhuQQwNztnVmBA9S7qL1OjhG7GEB8FjAURbZ9DkaECUXfrRq4Y5FwAlC u+FA45gwdOKr/wydIErH1FAKS1GL8oXrzrG+GDY5EdZjq7RJyVNvox7do9Q8+A+V6vIb Qc9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711636993; x=1712241793; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+IYKdlLOF58lOHPLCX4kHglsTCyj/A/Ku3dDSw21YHw=; b=RCoHWYed1yJHr2wqBchqIBwBaoc5j7rt0JAKGz02lL1m+DW4oQ1v97GRnKRe9H6Kop KDRnFqb5GC2NcF65xFv2J+Q6ljMS5oe992FsWdu7bCOu71St8g9y/fELgdNwt3GvEpbz 04pUGkTeDkN+mnI00h3UZQC3jzHNQZKGVFF6TVLZdEhRGJR7yfEe8Q/Xi/NRlHACr/o4 b1QsyxENVG1tzWdQ8ogPbjclgWjuQfKDqfDpbSD4jiJEngzFYA+0dysDMAzQFi37SLa3 8Uu0Csb80PUXcxe4qLPUGnVmviGYqZ1arfdCVzIet1gM7EeTbplC9xcnqYXijXQsHdMq c1ng== X-Forwarded-Encrypted: i=1; AJvYcCUSVsZLfr8TUR3avi+LDKCbhQpWD1ia1JGTgMUa9T7ALZgLdKO2hbsERxBf9G0crTLNPVCY+IMaQq2zbV2wzyZzzVxUwKzSgJ4d+bP/ X-Gm-Message-State: AOJu0Ywy4wB/0Pt5n8VGLFrPrmLbm91Fb+tiDduHRughmot5+7ZotvTL n8yPMGCOqsz7aBO7U4eqt8w5+jo9OwZdXlX/KMitz1tTLsXdE0JyZvnNfIjHTEZlVyteYgdtxzn EWp5ZLij+kWHxsK4GOUG0IJBneiRK0XZauPgR2Q== X-Received: by 2002:a05:6a00:391c:b0:6ea:ba7a:d180 with SMTP id fh28-20020a056a00391c00b006eaba7ad180mr3582489pfb.15.1711636992828; Thu, 28 Mar 2024 07:43:12 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Vincent Guittot Date: Thu, 28 Mar 2024 15:43:01 +0100 Message-ID: Subject: Re: [PATCH 1/1] sched/fair: allow disabling newidle_balance with sched_relax_domain_level To: Vitalii Bursov Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Thu, 28 Mar 2024 at 01:31, Vitalii Bursov wrote: > > Change relax_domain_level checks so that it would be possible > to 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. I was about to say that max+1 is useless because it's the same as -1 but it's not exactly the same because it can supersede the system wide default_relax_domain_level. I wonder if one should be able to enable more levels than what the system has set by default. > > Signed-off-by: Vitalii Bursov > --- > kernel/cgroup/cpuset.c | 2 +- > kernel/sched/debug.c | 1 + > kernel/sched/topology.c | 2 +- > 3 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index 4237c874871..da24187c4e0 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/debug.c b/kernel/sched/debug.c > index 8d5d98a5834..8454cd4e5e1 100644 > --- a/kernel/sched/debug.c > +++ b/kernel/sched/debug.c > @@ -423,6 +423,7 @@ static void register_sd(struct sched_domain *sd, struct dentry *parent) > > #undef SDM > > + debugfs_create_u32("level", 0444, parent, (u32 *)&sd->level); IMO, this should be a separate patch as it's not part of the fix > debugfs_create_file("flags", 0444, parent, &sd->flags, &sd_flags_fops); > debugfs_create_file("groups_flags", 0444, parent, &sd->groups->flags, &sd_flags_fops); > } > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 99ea5986038..3127c9b30af 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -1468,7 +1468,7 @@ static void set_domain_attribute(struct sched_domain *sd, > } else > request = attr->relax_domain_level; > > - if (sd->level > request) { > + if (sd->level >= request) { good catch and worth : Fixes: 9ae7ab20b483 ("sched/topology: Don't set SD_BALANCE_WAKE on cpuset domain relax") > /* Turn off idle balance on this domain: */ > sd->flags &= ~(SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE); > } > -- > 2.20.1 >