Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp641758iof; Mon, 6 Jun 2022 09:52:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycc4w7Y8ooyhBTMp3WxR01ybZMC+JG6IrSdJD16wOEaAC19wtL5LJkn/9aQxxPTe1MhZbV X-Received: by 2002:a17:90b:1c08:b0:1e2:fcfe:be30 with SMTP id oc8-20020a17090b1c0800b001e2fcfebe30mr27144463pjb.240.1654534372303; Mon, 06 Jun 2022 09:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654534372; cv=none; d=google.com; s=arc-20160816; b=s1WaMOuOIA5DLkSgf+qlb4kyqpXu8eDtGZVoP03PCPZIgvoNDgN/jQZTWmzNsHsRB6 hKoRo8EXp4RDksYNU1aPp2lvvbF2w3yxyMs3KD4dAevu3jqdoKJf+N78ynm1MN3rrXd6 gt7xkgNCz1OSrdrE8rHppJLrLNlEmsWpyzQTFHRkDo2H/mWFE5qff35NWG3w1P7FuryR qUKpHtPzlSTW8BTvtypDewzPMZOKJF/tQvq4c3ZDd4A2XIL1ix0RZjpvc0Ox/D3jhF2w pko/6u3BoBcRXrQ2HQaQExUMe/ynsBTgymsBFOBBCvPLFKrT8h4eBRjt7773f2NDBtUi YGqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :message-id:dkim-signature; bh=+cw7GSi52irFHu7tmrQKZlX5aBLvwVS6H3H0YOi+uL0=; b=Spu5legarnp3ZOrphoj3S9B4RO1RcCztOQ6kYc6H18MzKskzJngGK24EMTyUhTItK+ SuWx/V6mTMGjMW4Wtg5oq3m+w7iJtCiF3/4UlkFo11Dh4U6UrK9S6SbexT/pV3aAG5YH nPKrk6yHjFozMWb2n7knoQKUx4EDr94kzE9g2rxyK1Xbn5FFdLABKr1+oYwFJLk21Vd6 y0+27V8MTjQXT3C1DiglYrOYPIBWoEhTZZ39iVwztuK0D0QDW7W9B6sHSXq8G9n+q/Le qwTHTcvKEtsq0bUfwqXrQ58qGMiUFpACp8mA0upongsHbR76m3BLEMmWlwPmlX47X35k GhiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sy/VMLg9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x71-20020a63864a000000b003fda16081basi6628420pgd.265.2022.06.06.09.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 09:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sy/VMLg9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B2C1136E83; Mon, 6 Jun 2022 09:36:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbiFFQgI (ORCPT + 99 others); Mon, 6 Jun 2022 12:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230527AbiFFQgF (ORCPT ); Mon, 6 Jun 2022 12:36:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8A1B7F7; Mon, 6 Jun 2022 09:36:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F070A60C93; Mon, 6 Jun 2022 16:36:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1B57C385A9; Mon, 6 Jun 2022 16:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654533362; bh=0Mjg97U+ZMbST6i3lAYoqGdbBWQbXG3j5keTPSi7ieg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sy/VMLg9MW8C0l9Zr0sNxqtsspglU0kkaNq2eEia/2PxI5+Q2f6dSBLb4gOJ3vnTX fl05wLcv9Y3j2ZfIQlo+pU/E1XoxPtcrduH/v0+SkDFZXEMiStQx0Uert34UQ7KXre 47gRZQMQ2DvMS/CX+ZzQkSerZQe6GY0+RavtTcs87RFi3toceavaIFlJGqJ0gTRXI+ zjf5c/FOzORqq3hpbw/i2bq8KPllQ1EAleKosvdED8vwgq5A7Z9PzFbft8sXx40dP1 wEisxn6cbmo7Hxmro/CBvVfwkPaLbZw5ctwOVSmQFE9R2qcQjG0EQ09Fa1C8YkS2k7 ytmgpVftCrWVw== Message-ID: <29ac9241-7007-1c5b-a313-2bdea32e1dc8@kernel.org> Date: Mon, 6 Jun 2022 19:35:55 +0300 MIME-Version: 1.0 Subject: Re: [PATCH v4 2/4] soc: qcom: icc-bwmon: Add bandwidth monitoring driver Content-Language: en-US To: Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Rob Herring , Catalin Marinas , Will Deacon , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Thara Gopinath References: <20220601101140.170504-1-krzysztof.kozlowski@linaro.org> <20220601101140.170504-3-krzysztof.kozlowski@linaro.org> From: Georgi Djakov In-Reply-To: <20220601101140.170504-3-krzysztof.kozlowski@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi Krzysztof, Thanks for working on this! On 1.06.22 13:11, Krzysztof Kozlowski wrote: > Bandwidth monitoring (BWMON) sits between various subsytems like CPU, > GPU, Last Level caches and memory subsystem. The BWMON can be > configured to monitor the data throuhput between memory and other > subsytems. The throughput is measured within specified sampling window > and is used to vote for corresponding interconnect bandwidth. > > Current implementation brings support for BWMON v4, used for example on > SDM845 to measure bandwidth between CPU (gladiator_noc) and Last Level > Cache (memnoc). Usage of this BWMON allows to remove fixed bandwidth > votes from cpufreq (CPU nodes) thus achieve high memory throughput even > with lower CPU frequencies. I am curious if you ran any tests - e.g set the CPU to some fixed frequency and run memory throughput benchmarks with/without this driver? Could you share any data? > Co-developed-by: Thara Gopinath > Signed-off-by: Thara Gopinath > Signed-off-by: Krzysztof Kozlowski > --- > MAINTAINERS | 7 + > drivers/soc/qcom/Kconfig | 15 ++ > drivers/soc/qcom/Makefile | 1 + > drivers/soc/qcom/icc-bwmon.c | 421 +++++++++++++++++++++++++++++++++++ > 4 files changed, 444 insertions(+) > create mode 100644 drivers/soc/qcom/icc-bwmon.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 6157e706ed02..bc123f706256 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -16376,6 +16376,13 @@ S: Maintained > F: Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt > F: drivers/i2c/busses/i2c-qcom-cci.c > > +QUALCOMM INTERCONNECT BWMON DRIVER > +M: Krzysztof Kozlowski > +L: linux-arm-msm@vger.kernel.org > +S: Maintained > +F: Documentation/devicetree/bindings/interconnect/qcom,sdm845-cpu-bwmon.yaml > +F: drivers/soc/qcom/icc-bwmon.c > + > QUALCOMM IOMMU > M: Rob Clark > L: iommu@lists.linux-foundation.org > diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig > index e718b8735444..35c5192dcfc7 100644 > --- a/drivers/soc/qcom/Kconfig > +++ b/drivers/soc/qcom/Kconfig > @@ -228,4 +228,19 @@ config QCOM_APR > application processor and QDSP6. APR is > used by audio driver to configure QDSP6 > ASM, ADM and AFE modules. > + > +config QCOM_ICC_BWMON > + tristate "QCOM Interconnect Bandwidth Monitor driver" > + depends on ARCH_QCOM || COMPILE_TEST > + select PM_OPP > + help > + Sets up driver monitoring bandwidth on various interconnects and > + based on that voting for interconnect bandwidth, adjusting their > + speed to current demand. > + Current implementation brings support for BWMON v4, used for example > + on SDM845 to measure bandwidth between CPU (gladiator_noc) and Last > + Level Cache (memnoc). Usage of this BWMON allows to remove fixed > + bandwidth votes from cpufreq (CPU nodes) thus achieve high memory > + throughput even with lower CPU frequencies. > + > endmenu > diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile > index 70d5de69fd7b..d66604aff2b0 100644 > --- a/drivers/soc/qcom/Makefile > +++ b/drivers/soc/qcom/Makefile > @@ -28,3 +28,4 @@ obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o > obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o > obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o > obj-$(CONFIG_QCOM_KRYO_L2_ACCESSORS) += kryo-l2-accessors.o > +obj-$(CONFIG_QCOM_ICC_BWMON) += icc-bwmon.o > diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c > new file mode 100644 > index 000000000000..1eed075545db > --- /dev/null > +++ b/drivers/soc/qcom/icc-bwmon.c > @@ -0,0 +1,421 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. > + * Copyright (C) 2021-2022 Linaro Ltd > + * Author: Krzysztof Kozlowski , based on > + * previous work of Thara Gopinath and msm-4.9 downstream sources. > + */ > +#include Is this used? > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include Ditto. Thanks, Georgi