From patchwork Fri Sep 1 13:03:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13372586 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BA43CA0FE1 for ; Fri, 1 Sep 2023 13:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0HiXA1XBeuz9xXnpQU/7cnwf1Y0+LAQehNAuDgDvkkY=; b=cUqJATDgAvoegT WswxCDiLtruu/suSdiUWjeR+BSjwtWdrR6kZXn3zkmFqFbdJHoYPoXbWcgGE+GNoAlz0eMDx9+a1O JbtQkcoGcPmB3ErMmVL5Ue1BXjaKDwu207xy9/j/uNZTUIA6LnWg27Ikpip1RupCez+jjz00NcaYe sUZIFARuJLcyi2RcHfiz8JNhpPz7MsAp9VadfKLSXz7oGoCD4mfdOwvJ+kpzwApCBNISsPu8o4RTh fYHxSB9ISAJpGoXn8vXLdWkg5fpchCUcmxi07SvA2XcWYGWcZtc1XLFm1vAhazJe29kcmutSbjzjB lt8ZTT+4cglBxdb0XgJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qc3o2-00HXH9-1F; Fri, 01 Sep 2023 13:03:22 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qc3nz-00HXFc-0T for linux-arm-kernel@lists.infradead.org; Fri, 01 Sep 2023 13:03:20 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31ad779e6b3so1653668f8f.2 for ; Fri, 01 Sep 2023 06:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693573396; x=1694178196; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=75a9HyrrjsY749mq1nl+lxvfuPogake/gzHsJRTckdM=; b=CxSccmYM/O+PNPOKPL0WO7PCJImCF2OTxgUB9xSPNqPW1PNMgylgDBZNQ0ZObtYwiA gbeklBXuHSxK0qHaqMKX6h6ucTHvmcsaCsFH6mdhkXAqd3uHCcul4fH24+2jx2MCcHat w4VH+DAwCFwvneXcCrkGQxSpRzSvVN2ZtEnmkpYHdq3cJF5DX6dQshcVkPq6cwLo2hxg 3ul1ZbKPLxCXK4AZ7K4Em/qgLZRdLRLn7EZ2uQ/TMjCcXZVqkPselrD+saoKvGrMKGaT n8N3AkVy+5zRgh92PuUAR7CpXtCa6epJWu9ISylFyFYgUxLvKKu4+l2cnXG8/FrUYai7 58xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693573396; x=1694178196; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=75a9HyrrjsY749mq1nl+lxvfuPogake/gzHsJRTckdM=; b=WOPdGQUsic88eLzx+XW5RH0Ae8XrVi/VvXdVLeAAS1MZg1IbJ57OJGmNaSd304iof1 WNEXHjiStzbnniuQxI9a1OqG5kC1ha6GIbbiqskLoFiNLibv1gV7613R0Xx0Uijx0aiy gbmKtQ0SPs7j4kpGJXGiARk0VFRFvb55LXvfh7haEdS8e2kRmMPUvxVvn5gDUFnqm0H4 wTo35zd+7o0QGCl4ilB1tuecZmzIJjiYIRc5GV5pB6Xl8BAYDxNc0iMiODrIDgP+6TIS epe0Z5s/OJo540ok9Gh/q0jJp4UPEGz9922EId7i9tMsMRG/eBLsmxTs8yzgzrJZFf1U +aWw== X-Gm-Message-State: AOJu0YyWLOnjsK9fx9ttjlPInbA1imMcw26xVSx0EapmZqFVcybCxNEk /99pCHJDSIxH5OWYJuT2XKWgaw== X-Google-Smtp-Source: AGHT+IHxmfvngPUK7Awew8G7DdP5NSFVpNGfgrE/M5Ydxk/eDsyeJJCfJ1+9HSWbnzqkm8MYrfOrQQ== X-Received: by 2002:a5d:500d:0:b0:31a:d90d:8d9f with SMTP id e13-20020a5d500d000000b0031ad90d8d9fmr2074597wrt.25.1693573395616; Fri, 01 Sep 2023 06:03:15 -0700 (PDT) Received: from vingu-book.. ([2a01:e0a:f:6020:e9bd:add1:d9ac:7b3e]) by smtp.gmail.com with ESMTPSA id i14-20020adfdece000000b003142e438e8csm5167452wrn.26.2023.09.01.06.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 06:03:15 -0700 (PDT) From: Vincent Guittot To: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org Cc: conor.dooley@microchip.com, suagrfillet@gmail.com, ajones@ventanamicro.com, lftan@kernel.org, Vincent Guittot Subject: [PATCH 0/4] consolidate and cleanup CPU capacity Date: Fri, 1 Sep 2023 15:03:08 +0200 Message-Id: <20230901130312.247719-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230901_060319_212729_21853D1D X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is the 1st part of consolidating how the max compute capacity is used in the scheduler and how we calculate the frequency for a level of utilization. Fix some unconsistancy when computing frequency for an utilization. There can be a mismatch between energy model and schedutil. Next step will be to make a difference between the original max compute capacity of a CPU and what is currently available when there is a capping applying forever (i.e. seconds or more). Vincent Guittot (4): sched: consolidate and cleanup access to CPU's max compute capacity topology: add a new arch_scale_freq_reference cpufreq/schedutil: use a fixed reference frequency energy_model: use a fixed reference frequency arch/arm/include/asm/topology.h | 1 + arch/arm64/include/asm/topology.h | 1 + arch/riscv/include/asm/topology.h | 1 + drivers/base/arch_topology.c | 9 +++------ include/linux/arch_topology.h | 7 +++++++ include/linux/energy_model.h | 20 +++++++++++++++++--- kernel/sched/core.c | 2 +- kernel/sched/cpudeadline.c | 2 +- kernel/sched/cpufreq_schedutil.c | 29 +++++++++++++++++++++++++++-- kernel/sched/deadline.c | 4 ++-- kernel/sched/fair.c | 18 ++++++++---------- kernel/sched/rt.c | 2 +- kernel/sched/sched.h | 6 ------ kernel/sched/topology.c | 7 +++++-- 14 files changed, 75 insertions(+), 34 deletions(-)