Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp355762rwr; Wed, 19 Apr 2023 07:25:18 -0700 (PDT) X-Google-Smtp-Source: AKy350bn/Esx9AkXA9yFla3uKaZJ6MMuwaaXGjEAPd05vtY3R6y3cZhCPitEIrDLPWAHCiQ4/qLo X-Received: by 2002:a05:6a00:1799:b0:63b:8b47:454f with SMTP id s25-20020a056a00179900b0063b8b47454fmr4237685pfg.13.1681914318215; Wed, 19 Apr 2023 07:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681914318; cv=none; d=google.com; s=arc-20160816; b=gIGQn7AE+suNZ54fVEJGOr7MSlZ80OGuBqfSiGPKYLqQFW/kD+rKvNn1GJNfcAIOaM VTPlAqHY1QyPeKcJlO9WT3uoS38cdny+4BEWJ+5B0YAMKmdmMjigVcMVHs9H+Okffjxc rFoueNpRAMM+bDIYTVf1Hy/xKe5y0ngli/JAhiwUvS7ifgV0vMbpJrxAJPyuoWMl4yk0 /CMKs4Rbjdq984T4gUhnOPD96yGGJhw0Ai5IiBQ8Ts8abkZaJ1+Qg/YxVISlhFtaw+oe biI6mfk+7xW5UCgP6C4VRUirDju4jObKqXkFnJIQhgc9lr6l3Y65XaU4kjqsQKx+TVGq r3mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=9yB70xeJV1N0ZlteQUIRM4Nk0DPs/RCkhgDAa0rx6NU=; b=NebQJui+Wgbw3gpuKCnMRdGyyWhjUkLhQnnX2Nib0P3UK3ZJNjv/0qirNff0AoiFWi pGnDLQQ8Aj9BFG+nVTfTAmhLL5FlwGu17BkZMr4nAgoT7PSEzckR/VGa1/dcaYi8pFpj AB4Pz2lT4eUVOObQD9xn5rSTNalSfqwvpgl5ITDXWpZT4u6H9ncY5y4CSvk3u1qCX31R 5eSXwgKveMTVI8NPF0QTWuxbMXk575sXeShjctD/sIiKTtxPHHsDyjiJl+pJ1FhTPgLd 4HTvTYfbw+vH9uhn/4mmA6QZPwrV6Krt+9UC3fj1EiHSs3W6KFjt7zomICkyO5mFHerK ayPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=FGr5Z0zW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020aa79490000000b0063b870e736csi9617806pfk.199.2023.04.19.07.25.06; Wed, 19 Apr 2023 07:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=FGr5Z0zW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbjDSOWr (ORCPT + 99 others); Wed, 19 Apr 2023 10:22:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232338AbjDSOWo (ORCPT ); Wed, 19 Apr 2023 10:22:44 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 257707690 for ; Wed, 19 Apr 2023 07:22:39 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-52160b73bdfso206101a12.1 for ; Wed, 19 Apr 2023 07:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1681914157; x=1684506157; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=9yB70xeJV1N0ZlteQUIRM4Nk0DPs/RCkhgDAa0rx6NU=; b=FGr5Z0zW4TGX3/eVr4y3eJPb2jFX9DbliZVi7umZ2GZlwZ+2GsTc/Xh2fkFs9PUu+F WAt3LkmHaWOmFIYENjePl8OoWg21kk335vx0Ap0xvGiTHgo2NMY39AeP3YfuDdK+dnCF gkGN+ntnQkXyV8zhwtreIXNDsm6tMkcMYpCRyEllxz1jzmoPguDZBEARb27KEbOyLr+6 sRYhlmkSp1nDK6KovQcJ60RG4sT4q3IJxazWV5Vk9t1H+vaHdeRXnfIe5fAUS3i5Z4Y+ LZzpCNezRR/YdHW14aU5gzBuMCvvX23ts/K/yIVQikCFrQKpNDo721r/VZg8F6FCWLjb 6eug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681914157; x=1684506157; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9yB70xeJV1N0ZlteQUIRM4Nk0DPs/RCkhgDAa0rx6NU=; b=J4ugagg2+12TTHBme6AUVgt2gjuHFiq1YYHfrA0rrUVUsHS/4PAyS/jziFKXlVXvou IyKBLRq2TUqVKOr7SNMB1LPnecwyERKb1KpyZe44OXZQvYar5/bmlB5/tIomKT7LByGd p+YanszEwtPNRVoZ2trmf3BdqcyRI1JT8TqaJ5Y62UsDX7+xFE/anXCBn9P7+7ySh+yx eLNiSx/n+e0q6ZuD2RfdsdSXjIuJgXLzjpl7LiGICzpuLJZ+9d1d71LbgujE+dTGH+AG SA3lzmNXcUH+cD07BfU1WoEeK7tH5gWU7ica2E5fVNhnKqISRFZLRqWp1bB4qp6Urkhz ZSiQ== X-Gm-Message-State: AAQBX9fnug2VM52Rqv4zQWsTkmEx0r4nYpv+3eVL2PjsCd65F+FCfOti fEvFm7THAX+7rgZvh6C6C3H9rQ== X-Received: by 2002:a17:90a:b28b:b0:23f:29a:5554 with SMTP id c11-20020a17090ab28b00b0023f029a5554mr2484436pjr.48.1681914157446; Wed, 19 Apr 2023 07:22:37 -0700 (PDT) Received: from localhost ([135.180.227.0]) by smtp.gmail.com with ESMTPSA id jl12-20020a170903134c00b0019fea4d61c9sm11512208plb.198.2023.04.19.07.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:22:37 -0700 (PDT) Date: Wed, 19 Apr 2023 07:22:37 -0700 (PDT) X-Google-Original-Date: Tue, 18 Apr 2023 20:30:26 PDT (-0700) Subject: Re: [PATCH V2] riscv: export cpu/freq invariant to scheduler In-Reply-To: <20230323172403.nfrtgm5vea4qvinu@orel> CC: suagrfillet@gmail.com, Paul Walmsley , aou@eecs.berkeley.edu, Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: ajones@ventanamicro.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Mar 2023 10:24:03 PDT (-0700), ajones@ventanamicro.com wrote: > On Thu, Mar 23, 2023 at 08:39:24PM +0800, Song Shuai wrote: >> RISC-V now manages CPU topology using arch_topology which provides >> CPU capacity and frequency related interfaces to access the cpu/freq >> invariant in possible heterogeneous or DVFS-enabled platforms. >> >> Here adds topology.h file to export the arch_topology interfaces for >> replacing the scheduler's constant-based cpu/freq invariant accounting. >> >> Signed-off-by: Song Shuai >> --- >> changes from V1: >> - fix the leading underscore and tidy the patch up >> --- >> arch/riscv/include/asm/topology.h | 20 ++++++++++++++++++++ >> 1 file changed, 20 insertions(+) >> create mode 100644 arch/riscv/include/asm/topology.h >> >> diff --git a/arch/riscv/include/asm/topology.h b/arch/riscv/include/asm/topology.h >> new file mode 100644 >> index 000000000000..727e8d163a3b >> --- /dev/null >> +++ b/arch/riscv/include/asm/topology.h >> @@ -0,0 +1,20 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef _ASM_RISCV_TOPOLOGY_H >> +#define _ASM_RISCV_TOPOLOGY_H >> + >> +#include >> + >> +/* Replace task scheduler's default frequency-invariant accounting */ >> +#define arch_scale_freq_tick topology_scale_freq_tick >> +#define arch_set_freq_scale topology_set_freq_scale > > I was thinking all the right hand side would line up, which means > the above two need additional tabs and so does topology_get_cpu_scale. I don't see a respin, but given that the feedback in just whitespace changes I've got and picked this up while fixing the whitespace. > >> +#define arch_scale_freq_capacity topology_get_freq_scale >> +#define arch_scale_freq_invariant topology_scale_freq_invariant >> + >> +/* Replace task scheduler's default cpu-invariant accounting */ >> +#define arch_scale_cpu_capacity topology_get_cpu_scale >> + >> +/* Enable topology flag updates */ >> +#define arch_update_cpu_topology topology_update_cpu_topology >> + >> +#include > > I'd also prefer a blank line here. > >> +#endif /* _ASM_RISCV_TOPOLOGY_H */ >> -- >> 2.20.1 >> > > Otherwise, > > Reviewed-by: Andrew Jones > > Thanks, > drew