Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp587079img; Mon, 18 Mar 2019 09:43:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnnMwiIxx4nwIbSKKcJx9TYQzDt3AqZLma1X6LirlA4t6ce01djLQ5wNt/V2VjshpOJkn4 X-Received: by 2002:a62:41dc:: with SMTP id g89mr12601765pfd.109.1552927390464; Mon, 18 Mar 2019 09:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552927390; cv=none; d=google.com; s=arc-20160816; b=F3yeAqjiBz2Z8UhN5CLhPEk+i1pZcCFJ18DdQpq0r9XswBGM37FAWlRiQ+gSPXnjBw XDfakFAnpLnOW2tJmKOmQni2SRII6EgLcTs5OWDOc+qdZmIOGEhMUiFm3IUg1XN7MJWC JFJicYy4EyXmEJH/rG3HJSdrZU4q2D6pvoDjHrgVxCWvS2nOq4CgITAt5f95M7GOJCwJ /Wmhtmax2uleSh3BWTqig0cdCnhkO+/+BU41EWy/9cljsWJFiS4Ei0PnsO5vIZVGxLuP /hleepzn8FHdzMV1y44cjtE0zV5+hhlWngHMyacafgdR0ULGGgCq9zIEDwPpRnjn+Tgw v6Dw== 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=NRkQ1WlTUcCzubi5oqsiSJ+R90JvRunTXivgil+iXJY=; b=TOev6Q07aLW6Fl62kY0nMG1FdEYOm7xtbKAyGFsM2R0a8YGU1QZ7Fwh5gD8Kmb6rRd oiaBIvxmaOdNpc6N0w4Y3n+YD1Ihm2Xf8R/OVjURzF1YqyTH+Jz0xojqitqc3K0+2USi d3Af5GaKvBf8kfk9eTTIlPBgH45Im6AiAuHDlq5SKWZ5XMDa/RZgCFDEV2fKFeVjDkwN MFo29ngyJ8X+WPFVOTKzVsEUmFh873x/YMybcCcQB+8Q75Oa2ZSbWE1lKDh6lDlxDyUh HwzI5+pe20t2/i32UGujfyezoc7DVY/XY6cEbZMazfZeunQSaoAy8JTGo01Vc3DFEuNs EIvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=yVNcMTaK; 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 be11si9306921plb.355.2019.03.18.09.42.55; Mon, 18 Mar 2019 09:43:10 -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=yVNcMTaK; 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 S1727481AbfCRQkx (ORCPT + 99 others); Mon, 18 Mar 2019 12:40:53 -0400 Received: from mail-eopbgr690049.outbound.protection.outlook.com ([40.107.69.49]:40398 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726806AbfCRQkx (ORCPT ); Mon, 18 Mar 2019 12:40:53 -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=NRkQ1WlTUcCzubi5oqsiSJ+R90JvRunTXivgil+iXJY=; b=yVNcMTaK84d/gwmLPcniRe2Xg3TS86KRiIKgq3l+GfHmxOn0+ttQFwFbz9pouOFLWyZkV37aSp8QBPn/Rz+ZeHYgxXTwio627+CGq9DWMmQly0PuYy9yxRCMvoDHojDzSOEpanTeHZP2XfT7TQvfWNxihz0XzEFixBTW0Qssj9s= Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.104.150) by DM6PR12MB2907.namprd12.prod.outlook.com (20.179.71.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Mon, 18 Mar 2019 16:40:09 +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.015; Mon, 18 Mar 2019 16:40:09 +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 v2 2/2] x86/perf/amd: Resolve NMI latency issues when multiple PMCs are active Thread-Topic: [RFC PATCH v2 2/2] x86/perf/amd: Resolve NMI latency issues when multiple PMCs are active Thread-Index: AQHU229mIvha5pwXckCqUIpBYzaKP6YRNwuAgABkkgA= Date: Mon, 18 Mar 2019 16:40:09 +0000 Message-ID: <37b024a1-5b6b-9302-5fd8-3735980f933c@amd.com> References: <155268244291.14761.3432013617741218607.stgit@tlendack-t1.amdoffice.net> <155268245818.14761.10443012194152751116.stgit@tlendack-t1.amdoffice.net> <20190318104009.GK6058@hirez.programming.kicks-ass.net> In-Reply-To: <20190318104009.GK6058@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) 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.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 96a42b8f-8f80-46cc-f08c-08d6abc06248 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:DM6PR12MB2907; x-ms-traffictypediagnostic: DM6PR12MB2907: x-microsoft-antispam-prvs: x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(346002)(376002)(136003)(396003)(199004)(189003)(7416002)(6436002)(2906002)(71200400001)(86362001)(6486002)(66066001)(8676002)(25786009)(229853002)(26005)(71190400001)(14444005)(76176011)(52116002)(102836004)(31696002)(31686004)(53546011)(386003)(36756003)(316002)(6506007)(256004)(446003)(6246003)(4326008)(6916009)(8936002)(54906003)(3846002)(6116002)(6512007)(478600001)(72206003)(14454004)(97736004)(5660300002)(11346002)(486006)(99286004)(186003)(68736007)(81156014)(106356001)(105586002)(53936002)(81166006)(7736002)(305945005)(2616005)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB2907;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: YpibiVPFNPUVzFBuwqbJgtyn9XK/gQMZZ8NRmrw7KIWepAbEh+pQsbo8NqGBoxrXH14NrN+K1oM6fseaFP640POTQvbhXcD26pK2O1HgfOknReruSXkfI2+KV094ou+PtSQtEul5yU3vzElmjlnV3SOcHWo5lWzKDwcFRGd9NL/7dA1S/XheXp2S36fyIR/qPLOUiYzUOk1oLY+Jlh+YxzG/VCWTuiM0o2XoHiUvUPEo798ZU7JiIM9ibGXq0Id4V5DG119kamBM8QafAZlLrOxtHTmc0+uT2ns/h8bHieCRqRIWfpW2YPCe5if5tZLvRmXhyEIvuyGa8CTm9bRBJJ45w+cyyqWlBk0e1yTlg0FIlDGzqfJ6z8qIK1NeKCOna6lf350YP16DDmTuO3TxEjqD2QAfwGcf8ZcEyfgVxic= Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96a42b8f-8f80-46cc-f08c-08d6abc06248 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 16:40:09.8487 (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: DM6PR12MB2907 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMy8xOC8xOSA1OjQwIEFNLCBQZXRlciBaaWpsc3RyYSB3cm90ZToNCj4gT24gRnJpLCBNYXIg MTUsIDIwMTkgYXQgMDg6NDE6MDBQTSArMDAwMCwgTGVuZGFja3ksIFRob21hcyB3cm90ZToNCj4+ IFRoaXMgaXNzdWUgaXMgZGlmZmVyZW50IGZyb20gYSBwcmV2aW91cyBpc3N1ZSByZWxhdGVkIHRv IHBlcmYgTk1JcyB0aGF0DQo+PiB3YXMgZml4ZWQgaW4gY29tbWl0Og0KPj4gICA2M2U2YmU2ZDk4 ZTEgKCJwZXJmLCB4ODY6IENhdGNoIHNwdXJpb3VzIGludGVycnVwdHMgYWZ0ZXIgZGlzYWJsaW5n IGNvdW50ZXJzIikNCj4+DQo+PiBUaGUgZGlmZmVyZW5jZSBoZX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