Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp647892ima; Fri, 15 Mar 2019 10:48:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHSb7cTwVXBesTxetfzFKhaQQfDGRBzsF0tJWpRkUPx2AZHKrFRWLwH8MSOdWzzVy0GP28 X-Received: by 2002:aa7:8102:: with SMTP id b2mr2103815pfi.69.1552672131534; Fri, 15 Mar 2019 10:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552672131; cv=none; d=google.com; s=arc-20160816; b=oEIDqYJSGp4x0pof9G3AJqCPK7FiICWdqPgk/hMcV/NKVzHqgVpUF6G6ObDXMZFiFi b5gMq0vpV6aTbj8EqDmE7G+iVvnWr+zkD9sdv+hQe/hg7kHJtAchG77msfkDXYbmODPy ZHrLqBJxjbsx3WOo6O1j2/QKRS0+AmeAtrZcws0VCfXL9ijWMIgzIAkwJpt9/hcl7LmP 8RRu2HdvMWwTBVd58JdYekKid66JIcMhum7ZY4GUzLwh+NONE+qVP/DJyaaL7t2NYBlP 06+FT8sSyywXp4iibeD7g6e/RM3orj6cJxZ60Kt2nPsGaHkzO3uG6HTSULGyRs6xuZzR W5/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=XdIoXcfXbKYENjFGXP36CvwcywO/KZFEYQKE/qoI1XI=; b=1K2LumUD8FUozh2P9WJgataz3D9/RLQWQihjgK7GtXVRdIGPf7rCJ6T8vJMRft/cFs 8lvCSqdK9DM8uorDLpgH5sl4NSq5eVsuXP3oAlq0SIpDs4VgOZ19Z8LyvAHi65UqYx7A ImNvKsVp2iPOTPMXiyT+NP58ZyIPPzpoz1+9WqV2cePAw34oPUMP+yEUMRd9nHZ+JkO9 zGXpxLBriaSVYMKvaYsujfW8+IwWgWZMXr8B5Y7uifJqwg6v7NAUIX8Ms4YDvQWS13Zp 3heeWh/lPxWhPeV1YNcgetMNw2QrQqSIyrxo2yy0MN9X9Pezj3cuKywNTu1Vhrl4MC9X KbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=FUUgQZiG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si1705006pff.30.2019.03.15.10.48.36; Fri, 15 Mar 2019 10:48:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=FUUgQZiG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726697AbfCORrg (ORCPT + 99 others); Fri, 15 Mar 2019 13:47:36 -0400 Received: from mail-eopbgr750074.outbound.protection.outlook.com ([40.107.75.74]:38530 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725956AbfCORre (ORCPT ); Fri, 15 Mar 2019 13:47:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XdIoXcfXbKYENjFGXP36CvwcywO/KZFEYQKE/qoI1XI=; b=FUUgQZiGAi317I9Grhm+rvssQetYeL+D6CIX+AirGckXatvO6WYYRSsnCODf+49UN2atUQglEKZJFL10CSMzs/VMoHFd6J9blxUtjNhY+OGQ5GLPZ2zkrW9/Qwi1AKpZaq+TgfeGVifz9VUQnGSVlP+GPKZdx6luqjWIs75oIR0= Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.104.150) by DM6PR12MB2603.namprd12.prod.outlook.com (20.176.116.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Fri, 15 Mar 2019 17:47:31 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::a8aa:c9af:1f69:2a89]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::a8aa:c9af:1f69:2a89%6]) with mapi id 15.20.1709.011; Fri, 15 Mar 2019 17:47:31 +0000 From: "Lendacky, Thomas" To: Peter Zijlstra CC: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , Alexander Shishkin , Ingo Molnar , Borislav Petkov , Namhyung Kim , Thomas Gleixner , Jiri Olsa Subject: Re: [RFC PATCH 2/2] x86/perf/amd: Resolve NMI latency issues when multiple PMCs are active Thread-Topic: [RFC PATCH 2/2] x86/perf/amd: Resolve NMI latency issues when multiple PMCs are active Thread-Index: AQHU2CpOuC8N+vFHqESTwWx3yJMr4aYMncqAgAAtDoCAAAd0gIAACteAgAAg1QA= Date: Fri, 15 Mar 2019 17:47:31 +0000 Message-ID: <42852d76-b178-8df8-e1ab-8daf6dc31de6@amd.com> References: <155232291547.21417.2499429555505085131.stgit@tlendack-t1.amdoffice.net> <155232292961.21417.3665243457569518550.stgit@tlendack-t1.amdoffice.net> <20190315120311.GX5996@hirez.programming.kicks-ass.net> <20190315151107.GG6058@hirez.programming.kicks-ass.net> <40b3c397-0d21-b8e2-c80f-14e3fe850cb2@amd.com> In-Reply-To: <40b3c397-0d21-b8e2-c80f-14e3fe850cb2@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0501CA0075.namprd05.prod.outlook.com (2603:10b6:803:22::13) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:182::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.84.11] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 29e8f697-9552-43ea-189f-08d6a96e4c11 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:DM6PR12MB2603; x-ms-traffictypediagnostic: DM6PR12MB2603: x-microsoft-antispam-prvs: x-forefront-prvs: 09778E995A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(396003)(346002)(39860400002)(366004)(376002)(136003)(54094003)(52314003)(189003)(199004)(486006)(106356001)(316002)(31686004)(53936002)(6246003)(6486002)(186003)(26005)(71190400001)(6436002)(5660300002)(229853002)(99286004)(6512007)(71200400001)(6506007)(102836004)(2906002)(4326008)(53546011)(25786009)(54906003)(93886005)(478600001)(14454004)(72206003)(97736004)(52116002)(386003)(76176011)(2616005)(36756003)(446003)(14444005)(6116002)(3846002)(7736002)(8676002)(305945005)(66066001)(68736007)(7416002)(256004)(105586002)(81166006)(81156014)(476003)(86362001)(8936002)(6916009)(31696002)(11346002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB2603;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: M9JDvYY5Gi49/yz2AbfG+TQzqNggJyRqyFcP2QQkHr08w+h7Lf5qRYd1wf0WzvUTVoWr8fzCS+Aa5qNIiq9EjWhiPjaHli7HE8g5Mt1YshkMxx+lBR4u9Cddkxo7cPgpyEVq3scpLtJ0Kf13SCHLDy+ng97zn8ECFxa/BaPb+xAvylTrSuQ/JbqG/Hs8b/nPJoxDHRnRg3Y9ez6zkRoxkVDH5eqZrkIDiq65H4MbdSNvF5MeZwS8HmEIeB457fqfVsTb7R4b9kQuRBo2Zz4EaOPzJcf50INEMoldAbk1rNBDMIED836JRla9s8bAGVxoWjJ+Fwnzh0AHmVQHTKQp6TjJvYirkFgq7we0RCkpreCZRKkdZkLbjp6uwqSrNt8fR+Fgg0zilpj5wxVWwJL5cgXaRhq9D1eVx6VOkBh4pPk= Content-Type: text/plain; charset="utf-8" Content-ID: <042F1A38B5EF834A9D2601B9FD1E0932@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29e8f697-9552-43ea-189f-08d6a96e4c11 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2019 17:47:31.2873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2603 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMy8xNS8xOSAxMDo0OSBBTSwgVG9tIExlbmRhY2t5IHdyb3RlOg0KPiBPbiAzLzE1LzE5IDEw OjExIEFNLCBQZXRlciBaaWpsc3RyYSB3cm90ZToNCj4+IE9uIEZyaSwgTWFyIDE1LCAyMDE5IGF0 IDAyOjQ0OjMyUE0gKzAwMDAsIExlbmRhY2t5LCBUaG9tYXMgd3JvdGU6DQo+Pg0KPj4+Pj4gQEAg LTY4OSw2ICs3MzEsNyB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