Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp565576lqh; Thu, 28 Mar 2024 09:36:08 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCW1p451FM5qAGStFnc0SwY+QALAfjPZJW3rk0f8hURc2eCmFWaJeVF1r1A7yzNAgcVLuQ012NDu0f/3jXABRbrQI9FnlmtMlibquuq/jQ== X-Google-Smtp-Source: AGHT+IFFoisyKAyenUP2cb1nowYekXYDAzm7ulnwM6jCZS9f/YPPplsTamtQDsPOT+7OQQZbMnR/ X-Received: by 2002:a50:a456:0:b0:568:d303:74dc with SMTP id v22-20020a50a456000000b00568d30374dcmr2539704edb.38.1711643768742; Thu, 28 Mar 2024 09:36:08 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1711643768; cv=pass; d=google.com; s=arc-20160816; b=ZKiifXifJc6TO43h5yhe18+YnYUnbWvCTfgyPNusxJlfcXekfnjX77zib5efE5Swuw yibH0Fy+wb9i3V1cV/zuh3gH5C5C4leWCIYGu3ommVQ//w6bbkjhO0ULz9o5t/na7Bo7 Gq1mUrY1+1VnoMg1OWg9+mXwa+GI92bk9poTsxHBZZQIOywswxZviB2GqCnQECJTBPFa Xglyo25f87e2Q1E3OpDKIwhKXWGTu3BqIOoIEULaFkTdyPSNXqj3v2RSEsgW1YA/00+D O4TDRqpfKqRHxqlYvNq2vZnJk0yEXX5imU0C63uKBRZcm+KM4mg9m7v5+Yk/j/sRdZry ALAA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=cED9Awhfc1vCla8jeiZzKgUEOIEF9249yC2TVR3tHtI=; fh=lGFu6CMNnGQ5U0KleYCi5iBqlGbSdg3iIa5Msy/sCE4=; b=vuBw8AChOeqWOWBdot2QvIfmzRafxw13la+bR0U145SM73ldXcF8qHL8O0D4Kg01GT RVU6A9PalnjPFm4vBcMp4sUTI5jTKq2oP4UKUjjZDk+XdNtO2fdpCXi2f73hEqhGH54Z 0msk9IxFpJw/xvUOSt69XQf9zDwfroWgl2xFnd19VMq4vieb5sZ2NNAA16XKTWQKS+LJ u4SapwnPVKMmNTlWXw3o+vKnMxWDTPF0sHuazDgMQOZjZcMCBkpYZSnycP9OzAvk0DNl zUTpQ9PWy/UJUmOMqvF8GSEtFPhQQzkDQrlzt88QSrUH3gPON3I6bGXmfrt3x5wuWkWM KU4A==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=J1KF93Iy; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-123259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123259-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z64-20020a509e46000000b0056bdd109ef8si917831ede.171.2024.03.28.09.36.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 09:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123259-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=@bursov.com header.s=zoho header.b=J1KF93Iy; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-123259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123259-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 789801F26537 for ; Thu, 28 Mar 2024 16:36:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 904113BBC7; Thu, 28 Mar 2024 16:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="J1KF93Iy" Received: from sender-of-o58.zoho.eu (sender-of-o58.zoho.eu [136.143.169.58]) (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 5EE923A1C4 for ; Thu, 28 Mar 2024 16:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.58 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711643722; cv=pass; b=bV+havZLQ8WVpjEE0cpQkFY9mGt5Ai7OqdqDPsD8AZYkEzexRsGr2cPFpLCf8H8D7asBaghtxrfkawQ77HtzDgIs0xhV/JO4QaxeuH+3ebldchBVlLHwBTUGlslLI5obmozcGf3Ivqm6xPlVbRSmtjoxN74Obt3/5dq5A7HrzDg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711643722; c=relaxed/simple; bh=jWm9h4bEyRjCM9yo1TuiTy0WnYH+mWXWfvuJwWCVK+k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lqtAlLddSMmNLEOKuB2tM3o3t6hSPkXMjXaCQHM9FiMhxxzR2+ulaybu1ZZ0YUdu81jQlrzmjVDmkjpzXSnxoz2C0OU1aalcpJlBTEBwzxJUzIKXDnZfNxDbEhEIlwDMUIB/lCvpCfAFeDJZN51zU6Im5/vWuAOCDvNC/Ml61ww= 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=J1KF93Iy; arc=pass smtp.client-ip=136.143.169.58 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 ARC-Seal: i=1; a=rsa-sha256; t=1711642777; cv=none; d=zohomail.eu; s=zohoarc; b=Vg2MDAWErE3CnQQcUPVvzZSCgDcKi02Xk5ejr8GnC5+5yABp70FOO2Tv1qaOxVYx+El8xebnVXaPHd7nijvAaYkCcDaeWWUT7MXeuVLRC8rb8PQonnIdw2IqIk2VMMnrgekGhFtZpJV7uNpgTDGoPWTPB8oWN2+/P3Or18PmIdU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1711642777; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=cED9Awhfc1vCla8jeiZzKgUEOIEF9249yC2TVR3tHtI=; b=Vr5wc3KYzC6MMBpSmSxyJ0DpwwephWIL5hUEmP8oSyMAklXIP4W8mxmAdx3PRXeIjN7FAr2J8tuaNhPCkDvJ08e7A3kF3dsquyvHnmcOt1E84GSj/Di8olPu59zHNJP/IjZU2NXpgA5SStoFOraeSxnf4qgjNuGxC0zOqJ03d14= 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=1711642777; s=zoho; d=bursov.com; i=vitaly@bursov.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=cED9Awhfc1vCla8jeiZzKgUEOIEF9249yC2TVR3tHtI=; b=J1KF93IyyzirxQiTaeSUuqLKfj7mYD45CQ1qBCfMcvZYVSOt6TQ1DuFtu0Gzs86r dVfsxfQfX3N2kCK7xfjID8cvwv3zLvyIbXq0MxKSKtcF50U4ES35QSsUU/JJESOnoMp Y9I3YzkWfdxQIqVycYapVYu+S0RwTo6l8CqUwU48= Received: from [192.168.11.99] (217.20.170.230 [217.20.170.230]) by mx.zoho.eu with SMTPS id 1711642776065691.1973913101963; Thu, 28 Mar 2024 17:19:36 +0100 (CET) Message-ID: <9a27094a-bcde-4226-8559-86bfae290895@bursov.com> Date: Thu, 28 Mar 2024 18:19:34 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] sched/fair: allow disabling newidle_balance with sched_relax_domain_level To: Shrikanth Hegde Cc: 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 References: Content-Language: en-US, ru-RU, uk-UA From: Vitalii Bursov In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ZohoMailClient: External On 28.03.24 07:51, Shrikanth Hegde wrote: > > > On 3/28/24 6:00 AM, 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. >> >> 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); > > It would be better if the level can be after group_flags since its a new addition? I'll change the order. Thanks >> 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) { >> /* Turn off idle balance on this domain: */ >> sd->flags &= ~(SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE); >> } > > Other than the above change looks good.