From patchwork Mon Oct 17 22:26:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 3774 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1669469wrs; Mon, 17 Oct 2022 15:29:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Jl0sKU2GuFv+3cQWNW7W4BpjpA2n8gdE2uOMMCjEjkKUSOUXP3DTyt8NBMVIUNxseDkq5 X-Received: by 2002:a17:902:f693:b0:17f:6974:cf7f with SMTP id l19-20020a170902f69300b0017f6974cf7fmr13534131plg.60.1666045740867; Mon, 17 Oct 2022 15:29:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666045740; cv=pass; d=google.com; s=arc-20160816; b=U4S37OGC/oNxKa4bQ/n4jzpq2iWZrOrlp57yIfBq0nGx/04/plxJVGGAb9LTmLokZk bm/jOwA4SUZkVpHMLGbH06s65TKRw7Xd7IMI/xP0QpEoj0dJb6w7iDBrrxZiNVz7UyU2 JjIJqDWOnZsAGSSk2s4101xgamAYlnjt/0VDdF5p5zk5bqGgJh0gJb9ADfoi8P+OvMIJ WlyxxuaUJVbz5zG/rBl9ea5XXOAzi5/LlCkRFZbDt3CdCC2FOlzelmPtJ1ODsf5mjfRa hPRxU0pBNl+IVLr5R9PM/u2yM5y9HIeDw4Xr0L7ZMkO18xhxqw/L7BYvfnKufiR5Sj6v oAnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=eXUWND517tmbByaWEbc2CT2bAWf2K7vLcbL3Ozw2Fjc=; b=s6yg6zYRZcaoyp9Kv1+peFZiRa8Gt4zTPU2BeWFTpA5KcQoi66aGoe810vUADikGiz amJfOHpOonw4mohOmsEx2bqMfySLBpKzS2Y7D2Ehjj+5uLOc74NBRzo8pf5xwMKeQVAT D1wntXKRkqsrANHrMRhaWkT1z8P4/NvzwKL4jgz9NEu5xi2aIGhW/Se7/1tflNNL9N27 B5uI8YvQchTVJyes3/KSF0rYe/WS5eWn/UcCR8EgHLW+REb2G3s7Bwf9aiNt7OzgUu77 48oABNc7ruNFkoHLzYOBSI+IyqaipZJR7N2hQ233NQA446xU8X2FdWdV9S7hiQnJcYiR GyWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=0BF8Q8q6; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id px13-20020a17090b270d00b0020aaa5f4c89si12059624pjb.148.2022.10.17.15.28.47; Mon, 17 Oct 2022 15:29:00 -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=@amd.com header.s=selector1 header.b=0BF8Q8q6; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiJQW0h (ORCPT + 99 others); Mon, 17 Oct 2022 18:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiJQW0e (ORCPT ); Mon, 17 Oct 2022 18:26:34 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2044.outbound.protection.outlook.com [40.107.94.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A679A814D7; Mon, 17 Oct 2022 15:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYbB45TwOX+ssE4MP7RqpsmIFJICbbJnkDClATNiZQ5YrW7UoQWxau/HJL12WasVQmfPdyFSZBGb9vG/+80fo01dhGaIGZe44St3iBKaPxYZVmVbsx0kJ4ghGeyzCz6GN3VyAPHxvW8CNs0mVPrke8Gs1GqUKu5mjaqy4v6wq7a5G8qL0KnHGgga04QUlCspCh2Pv5vxflUQv6FnQmB6I/MHfw86LCK1KT96tW7PJ94EDxSM4drAVCXZ9GvVEH+M8M+L8uZLjvOQEraSmy7RkSJrbhl7ecb+ZYJQ+V7If/tYSy+lABvxN3WwdPU5Jd9RoO5hm4YWhi+jS5wznkCv1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eXUWND517tmbByaWEbc2CT2bAWf2K7vLcbL3Ozw2Fjc=; b=CIvBUJa9/brHSshNRjbqdn5cgnMiWTpi2thjIScq4pHsEGIZcPh77y5JrODAcZ6k0kShFoPaC/E9g7R1tLEcjYW66YE6SB2vAR5abIz2i6CIx++4L2Z440x0d5X1Ixq9lTHNx6ikGKBEK9pW5bscbd2CaBuPoAokLns2Y8TN71ktzYBvVDMly83RXxiCz047Wc6X8727xtZ3PWofxoG09pAjcIJQLls0nP9lWOHYTDAQcQ/5FhmNvqyCd3q6Q5aZuJdhowGR5JZ8RshxuRF0c0RFZ41sqae6SbWwNTQMoQyadv/ypRudkFISVG2PO4RchXK+hamp7BVdVAfQzd9qTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=alien8.de smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eXUWND517tmbByaWEbc2CT2bAWf2K7vLcbL3Ozw2Fjc=; b=0BF8Q8q6nGvQMgetz/F96O7Ny58BQkJUwQxUG52RA1/L3DxjQycYGRU9JeDNHRGSgn5Qu9BDN0mfoZdrIuUx9CfRu1WzIFh8ZA/i1JD8Mr0S1DaGMTxfTsJe1N433bAIKStAHaj8eC02y7N3OJFmR2ipVfeEYNpnkbDj6FUGREY= Received: from BN9P222CA0012.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::17) by CY8PR12MB7244.namprd12.prod.outlook.com (2603:10b6:930:57::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Mon, 17 Oct 2022 22:26:22 +0000 Received: from BN8NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::da) by BN9P222CA0012.outlook.office365.com (2603:10b6:408:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.31 via Frontend Transport; Mon, 17 Oct 2022 22:26:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT025.mail.protection.outlook.com (10.13.177.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5723.20 via Frontend Transport; Mon, 17 Oct 2022 22:26:20 +0000 Received: from [127.0.1.1] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 17:26:18 -0500 Subject: [PATCH v7 02/12] x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , Date: Mon, 17 Oct 2022 17:26:18 -0500 Message-ID: <166604557814.5345.10995820967282890535.stgit@bmoger-ubuntu> In-Reply-To: <166604543832.5345.9696970469830919982.stgit@bmoger-ubuntu> References: <166604543832.5345.9696970469830919982.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT025:EE_|CY8PR12MB7244:EE_ X-MS-Office365-Filtering-Correlation-Id: 48c85109-db11-4930-d2eb-08dab08e9dce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TzAZGozJII5MupL/0pJd6vCC2vPd4ZhggQDouLnJ196wqGN2AFTUiEFA8i97gN74dHq5SR6yTI1gJNStI+MsFzMuFbM3F9ZhOtGsTYZyA+0UMe4OfLVI/oYto47JzAy+2JS2EwTQBSxqrG/Q+4U2ZiauVZVt3AVpsI8dBL27snN+IQWVJV5Zhg8yaRtEYtfRWL7E4jazHxo53OfsCYVXIs7JeZRxxmgp6MaSVZMUYYfdQ5FSNJMPN6GjO8RydWJgGGK8FUHnYJBSPI5hzUTJY3SZIqa2FykS/+gl+48xeIEzA4b6g4PA0Nf0FmUtUyNMRwom6tip5SmZJpOOFFsRmNCVBc/4xeElaZPr7jDfrf6ywxKA2uUxfxn3P3/wOW3MH05XibS7OT2+qpX5FlUDstl5Lql4OdIHXJjD+3AGcOQTSoWjoUB3M4XwZ5lgJ4u3SQa1gNVykoKzjoDtxXZpS8PrCnutHN9wjpPpWosChlrlSsVEcT6BAlVPURWA0fADuQfmyuzFPEkWCeJrK9aXB/YqPWJhD3EX9uCm1NQZYVi4WkLTZoJC060zDBFMGyzG62kwQpli1VD5DLGbuX6J8wWqyH+QpEIblYsntDcPpDZKqgsL0AqziCF664+Xapf2s79BdZWDqBXevmnvyzb7oTYPw/zgeFaXjW3m7ztvwm2Hh2r/FZQ8SfIfpv1jXIiEQ6U+EZBOAbQODklyJIvZ0ZXeWr1PLzA2VSAsOUcyKvUJ4jUQwvh0U5RkyGab65U1woEHU95LivpNtqw9pGwfyra1vUGI+ogi/SbwRsJLmsg/mLSaQnsW9J96eaLhqOOGfHvfAgPlRtYfkphminMY3A== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(7916004)(136003)(396003)(346002)(39860400002)(376002)(451199015)(40470700004)(46966006)(36840700001)(47076005)(426003)(81166007)(82310400005)(82740400003)(33716001)(356005)(40480700001)(86362001)(103116003)(40460700003)(36860700001)(70206006)(70586007)(110136005)(316002)(16576012)(8676002)(7416002)(44832011)(54906003)(5660300002)(16526019)(186003)(336012)(2906002)(8936002)(4326008)(478600001)(9686003)(26005)(41300700001)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2022 22:26:20.5299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48c85109-db11-4930-d2eb-08dab08e9dce X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7244 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746975578797641610?= X-GMAIL-MSGID: =?utf-8?q?1746975578797641610?= Add a new resource type RDT_RESOURCE_SMBA to handle the QoS enforcement policies on the external slow memory. Signed-off-by: Babu Moger Reviewed-by: Ingo Molnar --- arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++++ arch/x86/kernel/cpu/resctrl/internal.h | 1 + 2 files changed, 13 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index de62b0b87ced..efffce716f3a 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -106,6 +106,18 @@ struct rdt_hw_resource rdt_resources_all[] = { .fflags = RFTYPE_RES_MB, }, }, + [RDT_RESOURCE_SMBA] = + { + .r_resctrl = { + .rid = RDT_RESOURCE_SMBA, + .name = "SMBA", + .cache_level = 3, + .domains = domain_init(RDT_RESOURCE_SMBA), + .parse_ctrlval = parse_bw, + .format_str = "%d=%*u", + .fflags = RFTYPE_RES_MB, + }, + }, }; /* diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 5f7128686cfd..43d9f6f5a931 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -419,6 +419,7 @@ enum resctrl_res_level { RDT_RESOURCE_L3, RDT_RESOURCE_L2, RDT_RESOURCE_MBA, + RDT_RESOURCE_SMBA, /* Must be the last */ RDT_NUM_RESOURCES,