Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp588369lqh; Thu, 28 Mar 2024 10:11:43 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCXc23B49OaSbiM5gE1KwTE85mJql8CAqUqsnbrQgdzrZ6TeUs1C7RA0lyLaaWVpYBKovYj3QFlj8msp+N8SOPOayKCLww2gLQtF9cHxxA== X-Google-Smtp-Source: AGHT+IF8UNYQ+Q94UMT9owjbFrCv3SPMyxG5xKAbPIausKf2aeHWQTBnx5ROdtTIhUb6EioXS8ot X-Received: by 2002:ac2:44bb:0:b0:513:cfa0:b688 with SMTP id c27-20020ac244bb000000b00513cfa0b688mr18157lfm.60.1711645902964; Thu, 28 Mar 2024 10:11:42 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1711645902; cv=pass; d=google.com; s=arc-20160816; b=ZzazOyQGMGD7ieVu/aNGi0J9Q5cbf3/ElWfJU1oX37ziiSX4uDM90Ll17a0+fEnGtW LdiSZMkIXUpdAHI/5JzOgGOKliCvr4clgORxMxm3EHSC+HjFkHjRS7+lsMZgMElJpQZx mZdTsj1jYb8yHL9ie5z3HUfx48PPvACtTGEVjyhhGi8jS6dkpstEZX1iFB0X9nhXbAjz j8j8niNX0aur/U+32CAmpUIQczgak60HFsxgm2HeY3NzBHpCGVsvJoDaep9bjtowazEK TQl9v4O1EItBLu64ypT5cMG8L1LGxjDN7xd1vq5+jC8W2DqSE03OCgzMIHYeXo8C8+QW f5fQ== 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=ZPoFcPyLcDvpSZuEBD9w5JR4kbrua7Xy19ysxDlZfiE=; fh=K0+YjhYpqZnzuzXD3ngvxbaIsIROj628Zsuj7x+YbSI=; b=UTZC/pRBzlzNqfm0ifaR7eMNSvsHPpstHZQYm6/IJXDF+TydQLNNrKOuYUOqUNmsNj 8qmEW5LaAbnKt0EteuXGOxYnk65yL9dQDPdSB64peftmj5Xsr7F0GcD4uBEwlcFfOvEk Nj+yqFzNS9ozJ2e5rvI3hJwVR2kadl8AqLQtJvZwKwHaMPayryU07aCCGCrtT0QpKiQZ mfbtgoclPbpFIty9mr2sjTGv53/4G+EPQyx3YPui6VwUDHxyzC1OZcaVDo0d6QrQeoB0 9xx1R4dPCQRr3Vqyccw/cIHXkF/bLwQfaFY0gFFd4ju8yngpddGz8zZIKMVsQbEBeKVL wdXw==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=T46JQNJ9; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-123349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123349-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gz17-20020a170906f2d100b00a474898cd9esi892938ejb.896.2024.03.28.10.11.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bursov.com header.s=zoho header.b=T46JQNJ9; arc=pass (i=2 spf=pass spfdomain=bursov.com dkim=pass dkdomain=bursov.com); spf=pass (google.com: domain of linux-kernel+bounces-123349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123349-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 AA7AB1F29162 for ; Thu, 28 Mar 2024 17:11:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3481342A86; Thu, 28 Mar 2024 17:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bursov.com header.i=vitaly@bursov.com header.b="T46JQNJ9" 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 1C8C13BBC5 for ; Thu, 28 Mar 2024 17:11:08 +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=1711645871; cv=pass; b=kEvcUbia8HKpjwsjAqyDZgoUsRA/wBeitDU6RVD09/LXfCWpDddu7q8f3bL/fAareD/bs8UabIEYIY4+uA/sUI0QvhuLjizw60j9zA1KQSKduT50N+pd3NINrBqqWsd/URSXLM4/dtxCWZEJnFC1guVNdcZHX/1Sw6tU3SUzkGo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711645871; c=relaxed/simple; bh=6APAIIP6Iu8uhBPiP4+nplcZGdT+3EuubTzekx7NgQs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yd1rdGS9RmN0RYZZZFFhIvXJbFFP1JsYLYPUrosDXtMu/T8LBzAPdeIJJJqQaypLOe4uvlnzFgU8czwo0ZRUhfcA8OazRNcSs+iNTx88XNHpS+Tkqb3q7ih+iGFS59ujnoQT0PdBjagBWPGLLqDoQ0s4ZBQQAK9aLeHZL5I4xGk= 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=T46JQNJ9; 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=1711645844; cv=none; d=zohomail.eu; s=zohoarc; b=PyVQ+2/h8Sz170gJhF8C4cm1S8Pooes3SI5S1Yx3wAoumwaLRXjEkJ6KDwqYn9FloDkq07JcvTjzNRuF+d2xRltZ+u+rBOJjlRD3TSTQt0PeiVEdjP7aEVXaRyR7JVmG0p/20h0HOLiypVt1YUYmh76dqslMFJy/hsP/iRkk9KI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1711645844; 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=ZPoFcPyLcDvpSZuEBD9w5JR4kbrua7Xy19ysxDlZfiE=; b=chR8VfbqxON2PPMqRKfp47eVgBSpRnNLIHZado/RfA3BKXFebRPKrwApFXuLEAAtmj0nOpVfgS6rRc8mwtdWK43T/nPVyhSJM4keT35BMnXRj8evmUPkCcjtCR0DYDqppfxo1cyGGL/Vsr47Et2yHRQlEq+vG9JLN4kVN+TElw4= 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=1711645844; 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=ZPoFcPyLcDvpSZuEBD9w5JR4kbrua7Xy19ysxDlZfiE=; b=T46JQNJ9AhgRY8pJJ3lt2pOZcITbuQjRCIrsufsl+T0PVNhj5a5Nh/4Xep+NMzz/ au4kmfzsjgAgzqCtuq+cL4xC5euxOa2LPmJhzBhsNPw29wsubqIiEPVG6VwzaUkffWU vDGNftWthgQZHqBe4leueIovKD4XA6rDuKjFfeas= Received: from [192.168.11.99] (217.20.170.230 [217.20.170.230]) by mx.zoho.eu with SMTPS id 1711645842705803.0613795359005; Thu, 28 Mar 2024 18:10:42 +0100 (CET) Message-ID: <163e1980-41ff-4a5f-9d93-431e65fd3a9d@bursov.com> Date: Thu, 28 Mar 2024 19:10:41 +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: Vincent Guittot 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 References: <1679cb16-a4a1-4a5f-9742-3523555d33f9@bursov.com> 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 18:48, Vincent Guittot wrote: > On Thu, 28 Mar 2024 at 17:27, Vitalii Bursov wrote: >> >> >> On 28.03.24 16:43, Vincent Guittot wrote: >>> 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. >> >> I don't know is such systems exist, but cpusets.rst suggests that >> increasing it beyoud the default value is possible: >>> If your situation is: >>> >>> - The migration costs between each cpu can be assumed considerably >>> small(for you) due to your special application's behavior or >>> special hardware support for CPU cache etc. >>> - The searching cost doesn't have impact(for you) or you can make >>> the searching cost enough small by managing cpuset to compact etc. >>> - The latency is required even it sacrifices cache hit rate etc. >>> then increasing 'sched_relax_domain_level' would benefit you. > > Fair enough. The doc should be updated as we can now clear the flags > but not set them > SD_BALANCE_NEWIDLE is always set by default in sd_init() and cleared in set_domain_attribute() depending on default_relax_domain_level ("relax_domain_level" kernel parameter) and cgroup configuration if it's present. So, it should work both ways - clearing flags when relax level is decreasing, and not clearing the flag when it's increasing, isn't it? Also, after a closer look at set_domain_attribute(), it looks like default_relax_domain_level is -1 on all systems, so if cgroup does not set relax level, it won't clear any flags, which probably means that level_max+1 is redundant today.