From patchwork Wed Mar 8 13:45:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Singh Tomar X-Patchwork-Id: 13165865 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 E2098C64EC4 for ; Wed, 8 Mar 2023 13:47:25 +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=XdeHzvHAVRiBtqHNF1VmaG9BEdBnDUi9LZLU2RPB4Ik=; b=ixZteqqA60CC1R BaR/wv2egdRaTsAB72r0rTDufvFhC94EyHmaE3xJM9EfsZvpvL/6qoKqkWwBGKQ9V+iwBD/5ruOYf 4++jHhtA0spai+xo0Z4ew1e3rxEq49Zg82u5Ubdurpupx0BQo0TKIN/YCP/vDZr2KM0TZ3uWWE4wU eVZPFUOQhfxXal9RNJS2b7Skl2uH7wuguO3SizyekXhNp0PUrKnJSIvHlqjS16IXv51H2zMb5TlOG TcGMRePuWl0DaByjerHJJu90Hzg8YdiLzNSO71Ez4qzwqnvmzoZn6lyLrhOlPTxq3+BqqxEY02yda 5CtRV3gqqIOZIlcmH64Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZu7d-005Ghe-5H; Wed, 08 Mar 2023 13:46:25 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZu7a-005GfE-Dw for linux-arm-kernel@lists.infradead.org; Wed, 08 Mar 2023 13:46:24 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 328822XR025566; Wed, 8 Mar 2023 05:46:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=LItUQ4ECxvJCBZiI4/k0jOYJrwI0avI19Sn3a0GhpWQ=; b=UUhxNpfaEEzlZA3SX/u3Z3XM1wbh31HQrxeVQ5EIVREfz5VEKTB/4yYC9S7gn+obKDtU hnZnsR45yz1H4Cl+uTZQfLB8Sr4tGpl2GUXEZZJiFhFYjojWzTqDqxdgG7ISu7UZorCz 7D5kRB0J+iFovGrkuUtKjXPPzdBtJpYrlRa02xtEy33G/cbf/tpY8QewpVOdz8Ym5nCG +0omL5sOcK82qFNE0TyJqqht7q4FygB4DMiplGw0eWvRwuk6+EE6lGvSl9FhaogTDLMk 6jhuZvbkGSlQ56v1mnufbGAFMkC2etS2iCtTqafEuPpTjz+ej1a3fFEqCBuK4S1wcr5F Hg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3p6ff3bcqn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 08 Mar 2023 05:46:15 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 8 Mar 2023 05:46:12 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Wed, 8 Mar 2023 05:46:12 -0800 Received: from localhost.localdomain (unknown [10.28.36.167]) by maili.marvell.com (Postfix) with ESMTP id 286A55B6929; Wed, 8 Mar 2023 05:46:10 -0800 (PST) From: Amit Singh Tomar To: CC: , , , Amit Singh Tomar Subject: [RFC 0/2] Add support for DDR MPAM monitoring Date: Wed, 8 Mar 2023 19:15:37 +0530 Message-ID: <20230308134539.3071034-1-amitsinght@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: gMrNkAaaNsCe7y2uhjgmW2FFBX-AxUVz X-Proofpoint-GUID: gMrNkAaaNsCe7y2uhjgmW2FFBX-AxUVz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-08_08,2023-03-08_03,2023-02-09_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230308_054622_689876_2B285C08 X-CRM114-Status: GOOD ( 14.27 ) 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 patch-set aims to consolidate monitoring support for Memory bandwidth monitors present on DDR MSC block. First patch (1/2) in the series is to support a topology where bandwidth counters are enumerated as part of "MB" resource (in other words, when these bandwidth counter are hosted by DDR MSC block). Expecting comments on x86 part, how it would be handled for both x86 and ARM64? Second patch (2/2) adds support for long version of MBWU registers MSMON_MBWU_L, and MSMON_MBWU_CAPTURE_L. Patches are lightly tested on internal emulator platform, for instance after applying the patch (1/2) a new file "mbm_total_bytes" is created under resctrl file system, it contains DDR bandwidth utilization in terms of bytes transferred. #:/sys/fs/resctrl/p80$ tree tree . cpus cpus_list id mode mon_data mon_L3_00 llc_occupancy mon_MB_00 mbm_total_bytes mon_groups schemata size tasks 4 directories, 9 files Also, run lmbench's bw_mem (read and write) , and compared the content of "mbm_total_bytes" with raw counters read using devmem that is kind of matching. #:/lmbench$ cat /sys/fs/resctrl/mon_data/mon_MB_00/mbm_total_bytes 4426496 -> with 4 DDR Channel enabled odyssey:/lmbench$ devmem 0x87E1B0240880 32 0x00115B40 --> 1137472*4 = 4549888 TODO: * Test these bandwidth monitors with perf utility with different partID's * Test with PMG other than default. * Test the counters overflow condition. * Test it on numa multisocket platform. Amit Singh Tomar (2): arm_mpam: resctrl: Add support for mbm total arm_mpam: add support for MSMON_MBWU_L/CAPTURE drivers/perf/resctrl_pmu.c | 1 + drivers/platform/mpam/mpam_devices.c | 54 +++++++++++++++++++++++---- drivers/platform/mpam/mpam_internal.h | 15 ++++++-- drivers/platform/mpam/mpam_resctrl.c | 35 ++++++++++++++++- fs/resctrl/monitor.c | 28 ++++++++------ include/linux/arm_mpam.h | 7 +--- 6 files changed, 112 insertions(+), 28 deletions(-)