Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1161697rdb; Fri, 19 Jan 2024 09:59:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoy9LIlXeqDzfLcNThYGOT0at5x46Hfl1uZOn4YU2TZPRH2BaXsGKT78px32uWEnkftj0l X-Received: by 2002:a05:620a:4141:b0:783:4c3c:917e with SMTP id k1-20020a05620a414100b007834c3c917emr293690qko.94.1705687176453; Fri, 19 Jan 2024 09:59:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705687176; cv=pass; d=google.com; s=arc-20160816; b=GLWlddrPJWXgLoiAoeESyXv9CrBei03G1Yqn6X5YmRD4MR7Bg4liNQNZd1OJFrNPta 46hVt3deiDzyHJghG7BcvIdnIDyQfcBSS5V5WNm094Rv3Vnj81e2wgULcSA6CJ0wUu6h pHpoIC5Vdhia/IOKF7BhrTJHb4uvI2hRQIQO0yW3UyWjqoAx4cxv7Lu+aKScJQn8QBrX AJV83aHC5UEISbnLJhQpuIX6ivkO5X1NK6cqUS1qo18hO2PQvZfWt49t1k6qqQYXcYbz Rzrbj4BNxeuCHEeM5ObVaEaE7hNboBWZ15x4kaY2vdIOixFbr/6pQYl15PXRK1M+WBLj BdQA== 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=STdvALwx1cJlhI4fFxZ8A3ouzBnNEklbbv9BMOJUhas=; fh=w3K2Ev1Lx5qucj3KtSJJgkYgwF53UGeTjuXSwrGLKtY=; b=SFnNcT1eFItiJKAegF0qzOqWVRUNWEwIGDzRLiBp0AubWgZH5JKHDI5Grpw78CZBD7 s7Sz2/meLF3rPgWsdAOc4UQZoD6XQBB32ngisUPTSKQyM2PvqqwYMvcWP5VS9kHxKpX0 W2x7zCsal/ku3d03twT2x9eMNejw8wSNHJB8etba/cJ4xt1tezb5tDz66rXweBj2b/QJ RJ+/LYYcFIgC+nGZJ6pmZn4wJz61vKGj2Svwu5jDkEbcZuoQOk66qwEkjaAKsi3OVoTa P1hSqOj34Y3QtDvwzZrOQqHm2A8PnEuQW8XXnyJ/NA8cRUsq1FLkUNMv9+5GWRu7IXuF Tj+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NvbwUvsW; 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-31453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j12-20020a05620a410c00b007832fa306f5si17573643qko.237.2024.01.19.09.59.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 09:59:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NvbwUvsW; 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-31453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31453-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2B91D1C24360 for ; Fri, 19 Jan 2024 17:59:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6716C58AA8; Fri, 19 Jan 2024 17:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NvbwUvsW" Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 1DC3F58227 for ; Fri, 19 Jan 2024 17:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705687074; cv=none; b=hzZGdKcLULnuDlkPjSC0a4+sFnhced2hX9TFwI3kQIPgCzw/5fFh1klUp2QAYOF+yT94F8rDfRMFTPwSJVpzWjbMZjC4MEufQRAQKaapNCoABmAUFTv5QRWMdzVnQTB4jKXt24qCATYMKjzEUQLq7l2OhjgUvtlcxa2cqFe6jcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705687074; c=relaxed/simple; bh=Hs5EhcUi8XoiZYod5yUZE9vnnJwoed4gSPgHtPxEZEo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UCZp+ZSEve1qEuAtwd2LvXwR4XYHLzWwg/X3ZOQT3zrlNvgFMfNETTdTEqTVJ9EXROSGJdEpitITQULs2iRCIwwT5VFLdO5cHE/0eRaeiVUGgOsBitP9RnOKAWnlAlS1kl5BFcWh0Jy4TB3OoAxaPaXdwp3bUtOsFZL10Xq4e/w= 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=NvbwUvsW; arc=none smtp.client-ip=209.85.215.174 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-pg1-f174.google.com with SMTP id 41be03b00d2f7-5ce942efda5so847324a12.2 for ; Fri, 19 Jan 2024 09:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705687072; x=1706291872; 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=STdvALwx1cJlhI4fFxZ8A3ouzBnNEklbbv9BMOJUhas=; b=NvbwUvsWrEVlcfhW7AgGuAINh8pp1XjxCrJzYyZaS4lMga7u+djlqr9uLY5vBhaZlx U1IM4aer3ms10BfUiMdzGfowzuDhsA46bZ/YX94W2txmPdZhzjhE5Y8YSqBh5IFtuzEw 0vwC6dNUDNpycOCAsIIXcmpVmrK4D/g6KSXp1bTUvlglIJpgOFEZFx1P05LXkJ2B5U1G Y/erq/fojEvcPeW1vNkaa34uDYcaN3yV43Rs2kn3YBFO210ytnnqWqEx/HtmpPdhZ3dV OGeNcYdvYl/RfiCay+vOQa+r2dtGE7LyNbdPnF1O/uPXpi+j84ysPacyGarqwqgxWLge AqFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705687072; x=1706291872; 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=STdvALwx1cJlhI4fFxZ8A3ouzBnNEklbbv9BMOJUhas=; b=P8vlcit6WKVN4HxeEsDuWI85qBHhptu1c8MmJTly9DgvpPxlOAZDmxErXhTelV17nB xU5qEqTgx89RjBkBJs/v/D6jTcpOlJoiiahtWDJkrdFj3+RseVzoeJsyuKY5ceLSQg4N 6wmWB5zmPI/JLBX/SbjFQJe51SAGnF8e8sYTcGrgpB1q7R23jElvIXLTmH+vq9JWCQnh qZc3+lAueHBdUnfme3W/47GqS2LgajRoNyvaQqV6hJmNWS2kF7hiepfmC9xRoi6You5g aZfEHberaLUc5pVn0AXQzMClB2aMuBJLnXo3+fL/iwbgQq2Uw03uOtAQ2Xi+PQnSIWzG ftAQ== X-Gm-Message-State: AOJu0YzfEd32sqL2a2PQttvs1NaFxrqTzegnG181xWAvUrnaFDFmGubn sehlX2nswytQwCTgi5Ulqj/Iui5v2fPmmgs2HXne24tevsP1lcl9z/55KQz0m3DA1qVh9OdnsYT NpL4hDS238YdapBtbmzxVfEneZg8Sm/r2SIA0PQ== X-Received: by 2002:a17:90b:157:b0:290:2c5:b231 with SMTP id em23-20020a17090b015700b0029002c5b231mr116943pjb.81.1705687072457; Fri, 19 Jan 2024 09:57:52 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240108134843.429769-1-vincent.guittot@linaro.org> <5ac0df44-82b6-463b-a805-65f93d181215@arm.com> In-Reply-To: <5ac0df44-82b6-463b-a805-65f93d181215@arm.com> From: Vincent Guittot Date: Fri, 19 Jan 2024 18:57:41 +0100 Message-ID: Subject: Re: [PATCH v3 0/5] Rework system pressure interface to the scheduler To: Dietmar Eggemann Cc: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, sudeep.holla@arm.com, rafael@kernel.org, viresh.kumar@linaro.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, lukasz.luba@arm.com, rui.zhang@intel.com, mhiramat@kernel.org, daniel.lezcano@linaro.org, amit.kachhap@gmail.com, corbet@lwn.net, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, qyousef@layalina.io Content-Type: text/plain; charset="UTF-8" On Wed, 10 Jan 2024 at 19:10, Dietmar Eggemann wrote: > > On 09/01/2024 14:29, Vincent Guittot wrote: > > On Tue, 9 Jan 2024 at 12:34, Dietmar Eggemann wrote: > >> > >> On 08/01/2024 14:48, Vincent Guittot wrote: > >>> Following the consolidation and cleanup of CPU capacity in [1], this serie > >>> reworks how the scheduler gets the pressures on CPUs. We need to take into > >>> account all pressures applied by cpufreq on the compute capacity of a CPU > >>> for dozens of ms or more and not only cpufreq cooling device or HW > >>> mitigiations. we split the pressure applied on CPU's capacity in 2 parts: > >>> - one from cpufreq and freq_qos > >>> - one from HW high freq mitigiation. > >>> > >>> The next step will be to add a dedicated interface for long standing > >>> capping of the CPU capacity (i.e. for seconds or more) like the > >>> scaling_max_freq of cpufreq sysfs. The latter is already taken into > >>> account by this serie but as a temporary pressure which is not always the > >>> best choice when we know that it will happen for seconds or more. > >> > >> I guess this is related to the 'user space system pressure' (*) slide of > >> your OSPM '23 talk. > > > > yes > > > >> > >> Where do you draw the line when it comes to time between (*) and the > >> 'medium pace system pressure' (e.g. thermal and FREQ_QOS). > > > > My goal is to consider the /sys/../scaling_max_freq as the 'user space > > system pressure' > > > >> > >> IIRC, with (*) you want to rebuild the sched domains etc. > > > > The easiest way would be to rebuild the sched_domain but the cost is > > not small so I would prefer to skip the rebuild and add a new signal > > that keep track on this capped capacity > > Are you saying that you don't need to rebuild sched domains since > cpu_capacity information of the sched domain hierarchy is > independently updated via: > > update_sd_lb_stats() { > > update_group_capacity() { > > if (!child) > update_cpu_capacity(sd, cpu) { > > capacity = scale_rt_capacity(cpu) { > > max = get_actual_cpu_capacity(cpu) <- (*) > } > > sdg->sgc->capacity = capacity; > sdg->sgc->min_capacity = capacity; > sdg->sgc->max_capacity = capacity; > } > > } > > } > > (*) influence of temporary and permanent (to be added) frequency > pressure on cpu_capacity (per-cpu and in sd data) I'm more concerned by rd->max_cpu_capacity which remains at original capacity and triggers spurious LB if we take into account the userspace max freq instead of the original max compute capacity of a CPU. And also how to manage this in RT and DL > > > example: hackbench on h960 with IPA: > cap min max > ... > hackbench-2284 [007] .Ns.. 2170.796726: update_group_capacity: sdg !child cpu=7 1017 1017 1017 > hackbench-2456 [007] ..s.. 2170.920729: update_group_capacity: sdg !child cpu=7 1018 1018 1018 > <...>-2314 [007] ..s1. 2171.044724: update_group_capacity: sdg !child cpu=7 1011 1011 1011 > hackbench-2541 [007] ..s.. 2171.168734: update_group_capacity: sdg !child cpu=7 918 918 918 > hackbench-2558 [007] .Ns.. 2171.228716: update_group_capacity: sdg !child cpu=7 912 912 912 > <...>-2321 [007] ..s.. 2171.352718: update_group_capacity: sdg !child cpu=7 812 812 812 > hackbench-2553 [007] ..s.. 2171.476721: update_group_capacity: sdg !child cpu=7 640 640 640 > <...>-2446 [007] ..s2. 2171.600743: update_group_capacity: sdg !child cpu=7 610 610 610 > hackbench-2347 [007] ..s.. 2171.724738: update_group_capacity: sdg !child cpu=7 406 406 406 > hackbench-2331 [007] .Ns1. 2171.848768: update_group_capacity: sdg !child cpu=7 390 390 390 > hackbench-2421 [007] ..s.. 2171.972733: update_group_capacity: sdg !child cpu=7 388 388 388 > ...