Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp604701lqh; Thu, 28 Mar 2024 10:39:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXk5H4MM7vY3Xj64HY7ZvG409u5KsrcSc6cNd1ebYGphs9u1uhLxAgD7ZMVAymh8VS3l/9KSCLLs3uCdlLFhPVrdCboKStHgMYknRfxg== X-Google-Smtp-Source: AGHT+IGO8qZMPDViANautzEn1DMmU4LKjpvKsrqj1L1ltrKyyn2O/X5wmWhg4/UWhGHYCnINfmdD X-Received: by 2002:a50:d756:0:b0:568:32f7:6c55 with SMTP id i22-20020a50d756000000b0056832f76c55mr3519011edj.9.1711647540463; Thu, 28 Mar 2024 10:39:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711647540; cv=pass; d=google.com; s=arc-20160816; b=a6XOehXbxEhs6ZtDfNAwptYRT9WdarSnIZcGSgiMVoMPDuK78kcE0MHx7F5C3cWeJM kHMqe5AXWCxIXfWktYzHiIsDZ/gyvl0wRgRlqAqWE9ejUo4htFlKdE3sdmabdVanUGl1 XKcmPeUwe1I+D8oxbWduYueJba17lLuq9HJ0iyu3KJJOMExNOzL/yH70cyv3JmgE1Roe 4a/gOBvPAwyxJE/q+WqP+w21E3X+nyS6IF7ZzQM4SLWYhxeAt7iZ4J1hldKD2n5OSMGq Qe3mi1ywGYy8UUiWkUdA4fctXwzdU54rDPITMbiM50cxCd2UxZjs4v168OQhfdd5gRfo 8lRg== 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=EcQTD2Kr0y2yHUjxPpxpF3woyw+SyS6YRJDLTY40Bqo=; fh=GAfq79SYN1/tVGwPRWxCLi/UGBccAFexI6d7kl/Fcuc=; b=MV7UUMojEKGPUrvEiNH75xdExfBcSQ0dDkKtT/Lsd89yxh1OCxy3UcmnJ3S92XbGF/ M2yYoPH9lYuuaMpX3QvI4Vt5iSK/uSOHKjY//0sJPZBlDcjUUkb9H6y7zmNm+Tkmd1QC hPgsICQDkidbuCLuXwsMXOKLygUMGB15BgxzUbO+zrMc8cFFHz9XP3Oy2FU67vIn5cWE tfKsVd6F45aAMndNldE9f6JZnUjUhktUijvlZ2an58EaHuCVKeu4JVuPr8HxmKPKPWKE lUS6rRkjn0fX/OoDZuKgjgiEZU2ST8KIFMF1iGTk+VfXESwWLW/nhla9jj9J37uTSrnc XbfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DtS9F50v; 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-123371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123371-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z11-20020a509e0b000000b00568b98d006csi984867ede.634.2024.03.28.10.39.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123371-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=@linaro.org header.s=google header.b=DtS9F50v; 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-123371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123371-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 0BD901F250AF for ; Thu, 28 Mar 2024 17:39:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 060157E788; Thu, 28 Mar 2024 17:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DtS9F50v" Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 7E68814A84 for ; Thu, 28 Mar 2024 17:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711647532; cv=none; b=amagwZzR0RQwzmOjhfVsdmIQh2AtjwkB65gFTFU302jiR3gnUECEr/bRWeOyxfmKGC1I22wT5kwznNmDAT5uZJwubpqRcNC2pjNzYYNfsRAcQeaVW05oYAdxEFwgefbnlgkmNcEBt/IlfA5nUUpgwMZ7jyirZuE/KpjTEoTo0o0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711647532; c=relaxed/simple; bh=mTJ0nmtG0NZNp0eWCead9GHxzS4WDqTAoa7fzaxOO1g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ScRA+pbQKN57+LOxaVLcTCpAoK9MaxLVugXS1BpK76Rplp7aUvmnroHX6kREQGFVmlFVzgOtjzDCT744RIe+5qxRdgw/bF/M+oYutrKBXujb37bxH+i/b+RQL0JZUoQOY8Gmwn5qLpkLPqGfG9FI4ecwyPvpnZ+/mgW6cI3jhck= 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=DtS9F50v; arc=none smtp.client-ip=209.85.216.48 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-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2a20c054811so437036a91.3 for ; Thu, 28 Mar 2024 10:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711647530; x=1712252330; 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=EcQTD2Kr0y2yHUjxPpxpF3woyw+SyS6YRJDLTY40Bqo=; b=DtS9F50vd1BVL/7SxNEYhcpuX8LewK0x8GsUaesHVTp60rtrr9cnDj8bVaYEcSS7Y3 V8FWtyRzwfETD0oJhbPHYlVZj9NL4TvExDK4+q4uEob7kcGPSJJL+ZvdSDUeXU9eDp6y KRSbNeOoB9X78kf90aJciSKX/zIvEfmzSdjASnq0xaLdiAvRvkn9UNoOXiF20SgssptM Tp3EB0W6w58wZRyd7gPN1VZhmR9s+NmWXJRDaKttIF+EiRdJNYOmgR4KFgzN5yD/rpqi iXc1VXPEoAAiqRs1wVSyNIyo3PU2KGTK5WTJ6MlU3W1qja34LwQf9ZICbBfngh3LNPJp Eacw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711647530; x=1712252330; 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=EcQTD2Kr0y2yHUjxPpxpF3woyw+SyS6YRJDLTY40Bqo=; b=fXxBayvqafeSTUTK7N4Yt7mr8jIBnMfZWT2T6zsXqnEey5FY/JZs+cHRYtwLVmi/sn jWZNib6Xmu8lPD6kFBj8JOtYNCiTfImMy0XR7I1kyD1iHtebgZ8qvaHPGHKeXzhCLgC+ Ivv65UQUN9lQxzv3vbZyZg0MFpc1ba/jUzV1XsJkExZQiK1rqFNjO5V/PhZKQTXyaR3E 3GHYCa35OEONjfvaYt7wJMfb92XTevetZq2ku0KmU4N8Aj2I2Fhmeg00+sHOY8eEyd+5 Wvp1W+CnyHJaxzfCiwyOS6d1sC5R1jnPIOovOqRBvOiLPK2crpUe9b+yalkls4csTH1r zrvw== X-Forwarded-Encrypted: i=1; AJvYcCW62WBJOVhEis5d3yj1VQ2eofY2dcfBYrl1I6+LWVxQqWT+M4iW3/RYSssHnK9lkZNe/3KTSrBM/LwtVTiCp1h8iGqGvMNQjLbBUHPu X-Gm-Message-State: AOJu0YzSceC0VVIn/DOwrJPOK8RiirIGC7P5HIcFD8dG88cY4C38Fomy Pjot2a6ihd1oqYD+PxNnGCBd7LkK7qhBnhMKyeqwfzYfAuORbZxwdd61J5rzWgVXrb5ZF9gMQHh VXIzOeXSXnvogD+jl1Fn8tphRJR9I2dyenhjuWA== X-Received: by 2002:a17:90b:682:b0:29b:331e:ec47 with SMTP id m2-20020a17090b068200b0029b331eec47mr117121pjz.27.1711647529777; Thu, 28 Mar 2024 10:38:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1679cb16-a4a1-4a5f-9742-3523555d33f9@bursov.com> <163e1980-41ff-4a5f-9d93-431e65fd3a9d@bursov.com> In-Reply-To: <163e1980-41ff-4a5f-9d93-431e65fd3a9d@bursov.com> From: Vincent Guittot Date: Thu, 28 Mar 2024 18:38:38 +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 18:10, Vitalii Bursov wrote: > > > > 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. Yes, I meant that before 9ae7ab20b483 ("sched/topology: Don't set SD_BALANCE_WAKE on cpuset domain relax") The flags SD_BALANCE_NEWIDLE and SD_BALANCE_WAKE could also be set even though sd_init() would not set them > > 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. Except if the boot parameter has set it to another level which was my point. Does it make sense to be able to set a relax_level to level_max in one cgroup if we have "relax_domain_level=1" in boot params as an example ? But this is out of the scope of this patch because it already works for level_max-1 so why not for level_max So keep your change in update_relax_domain_level() Thanks