From patchwork Fri Nov 4 20:00:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 15767 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp609220wru; Fri, 4 Nov 2022 13:01:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Qh2trU4HQXrp7KBxlP8LnHZtJnaq3sSoZbHFEl9DechyVQJpInN1WwsoefRhRQzRfxAOJ X-Received: by 2002:a05:6a00:80d:b0:56d:93d8:f42f with SMTP id m13-20020a056a00080d00b0056d93d8f42fmr25321001pfk.14.1667592101657; Fri, 04 Nov 2022 13:01:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667592101; cv=pass; d=google.com; s=arc-20160816; b=CQvoihAR+tLOVWr6QDmjVhy8wWRSskTjgRWt5WJbDZU2bZz7HgzYcjqxifq9PHX8Lp Ofn+yyYRtlnwcCjsJRYJH/Hz9JZgDA4kKLGEGuvnOWSAfSsipDYbDtgj6G5B5SsRGwyH JM1grOMg91LCr0EltP0opvo7LYqNWOpTiHZaUXHh+RYOjtArBLMfba/CznLNpCbBmMVW VhrvN+/zPjpHXqGdtUueDr6t6J9ePMHwbwCvImQ1swFKLeF5DXRFEldoTeyiNBM0mZu3 ST/D/5N9PSXWsZeAYVORVAtQRndCjcJWRZbP2CMYpFqZEko7Y3tJWgnGzcONTXeWgPfV BP+Q== 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=HjDnqO29sOEgSFMiVrU5p1hyybZIQ5Vf8NR6Gv9ZDXk=; b=OwBJmN4UJb/INEPoLc/b/Dsy88Yf9YEFnXWMtqFD8Q/0/f0NI/bXlVn4epH5fJjxbH ibiXdaPOfiyEAIhyYsynnUyndEDgHvKsZCiVOUfRWIzPCSuJfPLDvhFUMGbUyvrDrZP7 E9lQTlhyX2n4BZbi73pL2SZZbx2dl1Xb+v69BBM9yqADSqlg5/APEwmTr/Ay9VvWb6qV Za9AZFDZCUwRPH7l+e5oo1vrOO/YAUpNfKwHkpxsqBVih5tpXdwIFyQzxxFbmK4ee1oX pUZqGIT4UQPjEt/PWl1ujkq3FiA6BuTv1RjeUOY+0s5SwRDyR4eXE3Pc9oau1sL6yFNb 7Lqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=CXyRNXtJ; 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 m11-20020a17090a858b00b002135e1f5a7bsi4080822pjn.155.2022.11.04.13.01.28; Fri, 04 Nov 2022 13:01:41 -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=CXyRNXtJ; 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 S229792AbiKDUAV (ORCPT + 99 others); Fri, 4 Nov 2022 16:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbiKDUAR (ORCPT ); Fri, 4 Nov 2022 16:00:17 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31CAF45A20; Fri, 4 Nov 2022 13:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lepj2GiQifyEKbt3sHT3oSpY2x0lvvXzDgk6NWyBtZrwye/wZF5MayBRUIR7CN8hanGrMuiKW/JaVSLzIX0Pf3w0kJu4dTUsXyM0B9Hx1VfM2bYkGytq8hFoGzYfuIOjR00RsmBzUJpd1HhAeghyi5ZCdooYtGss+zazZDA6Vwuk/wvZFKfRSo2vB8H+aqAzLIURvpq4/2VUflsuvntELw5xhKLlUHdA5vxIuSH1IAyY/WXxwTvDZzPhfDRB0RMWgjJY8Izc2Qsu4k+v8tqR/mM7HSxI7m9E8A9vpAcWIFCEdCLlYvj9plgIy0Hc2S7WX0fYY8ykw/nxyftCxMhuQA== 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=HjDnqO29sOEgSFMiVrU5p1hyybZIQ5Vf8NR6Gv9ZDXk=; b=Q7osxiZHFvV6E4AsEtlkLsgZnuxGOjvnhiaB04O1YysYRAmI/y7gQnzrxwwxsQF0F14nY1yYT9FkAldnJYZDrT43WL7zcRceKVsd71uvpB1V9BRIey6BanIZwMii3s/a5im7WraY5e4wzpxQNsDhgqcewzUvkUfW4O+Z+t3AbrNKNZKtjdeGpNIMKmY8v9zlTVB8Dp7eB0TSgZ9x7NIuU7UPNH/39I4Oqii78nA05TxAJT7ZlKU3JG5LZ9Q7nZhbCqTwSLIOreLFpP0s1ny2ug7q3YBpvFNWMSF7+pX0w6wmeNK3UbRIF5ymZoTTu1dQDBiYkL3TyGiJkIav/HW96Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=quicinc.com 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=HjDnqO29sOEgSFMiVrU5p1hyybZIQ5Vf8NR6Gv9ZDXk=; b=CXyRNXtJoQSrdWNcQ6BtYEN5vaGHvSAm5ddiIiqrQNdXCyXrxbUs3XfQcKlsACtYxzP2iAU0yswjsDqps306Er4soQfd3LabtORBHyVBCwd0aqOKI9EdVcVZx+/UMmrebHGkZfLXzPO4N7UF7aBGF8F1qq/bQqWuewzkBYyfwJ4= Received: from DM6PR05CA0063.namprd05.prod.outlook.com (2603:10b6:5:335::32) by PH7PR12MB6634.namprd12.prod.outlook.com (2603:10b6:510:211::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Fri, 4 Nov 2022 20:00:06 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:335:cafe::7e) by DM6PR05CA0063.outlook.office365.com (2603:10b6:5:335::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.8 via Frontend Transport; Fri, 4 Nov 2022 20:00:06 +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 DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5791.20 via Frontend Transport; Fri, 4 Nov 2022 20:00:05 +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; Fri, 4 Nov 2022 15:00:03 -0500 Subject: [PATCH v8 02/13] x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , Date: Fri, 4 Nov 2022 15:00:03 -0500 Message-ID: <166759200326.3281208.5387897092180999498.stgit@bmoger-ubuntu> In-Reply-To: <166759188265.3281208.11769277079826754455.stgit@bmoger-ubuntu> References: <166759188265.3281208.11769277079826754455.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|PH7PR12MB6634:EE_ X-MS-Office365-Filtering-Correlation-Id: 831d8c16-8701-4405-2141-08dabe9f2b15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tGfMb3MdCHsaTi0EBbnmVFVPO6gjp93qEYIgW6NnijDg/qMEoJjsExGmzrdbmtlSJrmjSn9XPYCFxnIihDdPKdT7VIxNX1EfYe9utgK7NjlltQZt+MtQLuyB8ovMp7sQcePDqV93cQVbod0n4n9bjBbSjT7JJkCSwOrt6yjZVWHTdq1Zy9sn79lzfhMFuxGdyR9Syoe91ScVYgQtYcDQC0y0zn0gYEuUgw/UI/AnbeNrd2rxWFNnxfhnAMCNzK2KeB0dDBzNjUq9KNOY5qM7VDjCZ9vpwH7K5EMnd9tYvDDojGo9sQ+vfTqfSLwK5zKIUP7Wm4QVPoQUTOBLg6uaRPXAt+625C0d48d575yXUlxPrwH19buG1Dqh8LN8u+Ik12ZxRVKf/nptXI4/ZKQGSLhd+tyvhmtBNz48AuUgvXPGlAyzfgEUBML0Sc2Wv2pgtsNIVSaBF4W8dsj39LSRtPJPkS+nH5qW8LbhGJ6QTIninU4aXsNst18TsmTtVfy/iGnNrIrRTw98KXxG0yx42+V3jnhu3wGqVEhYEzDKzZRgInAfC+/9mgcfDCej1N2yxX7xeP+yK2rn1nZdPzlbXsfsRTS8swfLSjCEBXwCcQy9iD27LJjrVYoTQTaqxQ9rhHpZAO+hR19/8JGwFArBdwlnZ9xmQzH6c4R8vcqJ2jp4A4kmtXXNXBxjWVt73uu6uH3Frqzn1gW0YkstX4dNaFHrp1k28mhcy+uv6pMNBB1yuOyo+s3KzlCqFmLGVNMRZRC1SxbEzSv+u49fPcTy7dUud3k5xC6rMVRbSsRJsQS+AC3ci0vfows3fmXfOClIsUJ/kek16cbDn49ZplOwHQ== 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)(396003)(346002)(39860400002)(376002)(136003)(451199015)(36840700001)(40470700004)(46966006)(478600001)(86362001)(356005)(7416002)(82740400003)(2906002)(5660300002)(36860700001)(426003)(40480700001)(103116003)(336012)(47076005)(40460700003)(186003)(110136005)(16526019)(26005)(16576012)(9686003)(54906003)(44832011)(316002)(81166007)(70586007)(41300700001)(8676002)(8936002)(4326008)(70206006)(33716001)(82310400005)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 20:00:05.7447 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 831d8c16-8701-4405-2141-08dabe9f2b15 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: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6634 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?1748597055473976163?= X-GMAIL-MSGID: =?utf-8?q?1748597055473976163?= 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 03cfbf0fe000..4b970e7192e8 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -100,6 +100,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,