Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp507236ima; Fri, 15 Mar 2019 07:45:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiW6RXfczf0RO0dupSITj0NDMelivh1+PiN3wYK49AORZlgmBpbT1AKVeew209741Yam3f X-Received: by 2002:aa7:9090:: with SMTP id i16mr4330489pfa.85.1552661137062; Fri, 15 Mar 2019 07:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552661137; cv=none; d=google.com; s=arc-20160816; b=fdTicR4Oa0AdvUdr04wEwyA6mRuxVTjAfa9JigGxTVYogY732iC9Yvuat50QYAb5lE uIPGLITPpJMoz/Ygg4rva5Zoh6uZgD01MOckrY8QDYTZtnv8TXKdRPA1tkYARfNhfTkQ I1E5w0GNt3oXqoRHj9zXwnv4g9vTw49FA5lpKG+ZZcfsFtwmsgqzdm4gXeY9fCXqBmIX Rcr4/aMfBGSZOZ8CVw7lr/kKJvDaQdkexXU1GUTQUE4qpTHRK5dn7dwYF2XLmmaNDo7F Kh4vuYxtIyrQa5gdUNjXlcW/OIxkesplEhtFPo6LTzgPHMxzue3QO4fp+ucAO0ufYf/Q NMMQ== 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=xxNtmQUxabNIouVgSIlnfkeZrkzVLAEldWTkQ9eeNS8=; b=fEklxcziEhg8lhx3AJIIKdbrq6IvTbYx8UvwZVVpw8MqdMapwVFArLmJdx0bwXx1Ho zjQvCN5jku3OfLHRJHLnSBATpc7LlbA1T0G/tipMOmQivdbndP+85PMNPbjoM6BjQPGX 7dZcGLFw0Ij0MhCMQVPYxC7fIc4UbG68f9dflv4Ql+pmyAsr4El+gtdlxCl7137eN1jF G4CsHrEdNqHAk0Y/3ThPlvAoaU1TC2Y4YYc0NY4etrdSdE8xyzwN6/1tHHXtVBe8K5CZ VnLNFheHkD+h5zYRx8MTOBO+GTJtzKavNpluZ+JY2V8JpmhQcvpNRP1coyngbcGfLIkC 50bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Ewlxq0Z4; 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 w16si1873661plq.173.2019.03.15.07.45.19; Fri, 15 Mar 2019 07:45:37 -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=Ewlxq0Z4; 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 S1729186AbfCOOoj (ORCPT + 99 others); Fri, 15 Mar 2019 10:44:39 -0400 Received: from mail-eopbgr680054.outbound.protection.outlook.com ([40.107.68.54]:3043 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727358AbfCOOoj (ORCPT ); Fri, 15 Mar 2019 10:44:39 -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=xxNtmQUxabNIouVgSIlnfkeZrkzVLAEldWTkQ9eeNS8=; b=Ewlxq0Z4RGVtoJLfTE1/pL5e5rj5CfH7Xb/meIO4z3tKtx+Sm6GOifKqIIFN7Ey91yjss8lpXxRxtrSGoXMmwHu3nLFwAqLcHWhALu4YI6YVW9h76BiZkg4Tp3QE8y2k7ShR/9Q/N2CC7aUwOny+kbh8nrPtgDRlzBFh12uNk/M= Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.104.150) by DM6PR12MB2874.namprd12.prod.outlook.com (20.179.71.83) 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 14:44:32 +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 14:44:32 +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+vFHqESTwWx3yJMr4aYMncqAgAAtDoA= Date: Fri, 15 Mar 2019 14:44:32 +0000 Message-ID: References: <155232291547.21417.2499429555505085131.stgit@tlendack-t1.amdoffice.net> <155232292961.21417.3665243457569518550.stgit@tlendack-t1.amdoffice.net> <20190315120311.GX5996@hirez.programming.kicks-ass.net> In-Reply-To: <20190315120311.GX5996@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN6PR16CA0067.namprd16.prod.outlook.com (2603:10b6:805:ca::44) 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: 0a77abb1-e356-4d90-1ece-08d6a954bc64 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:DM6PR12MB2874; x-ms-traffictypediagnostic: DM6PR12MB2874: x-microsoft-antispam-prvs: x-forefront-prvs: 09778E995A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(366004)(39860400002)(136003)(376002)(54094003)(52314003)(189003)(199004)(97736004)(72206003)(31686004)(76176011)(53936002)(316002)(53546011)(6506007)(54906003)(52116002)(26005)(3846002)(25786009)(14454004)(386003)(5660300002)(66066001)(6116002)(229853002)(6512007)(2906002)(6246003)(105586002)(7736002)(106356001)(446003)(71190400001)(6436002)(99286004)(102836004)(2616005)(71200400001)(476003)(68736007)(7416002)(6916009)(36756003)(8676002)(14444005)(6486002)(11346002)(81166006)(305945005)(478600001)(8936002)(486006)(186003)(86362001)(81156014)(31696002)(4326008)(256004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB2874;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: lNXEvFSzaJhXlvkHKOJIHiF1RTJjY7cXAkf8F9KiNSzWlClo6X8jIN7g1TEk9ZKJ/purXWZNfpr5NPf+Pf0mysGA9rbntQgD2gRtTzPswFcGAF5+/xErzJzQqU5y9nDbuH32qX65eWG1h4L7LlICkzGSXhqJB2KPnJ4c9x+r0MMFk2lrbgtlDNNGGk2sEJQ+jKOkN+Gn4ExSJwxsT2Na7jYrPsHf9Bqar/4Ny4yb4VpLkZ7vpR7DTKIV+Pq1wVLA44i3CQty5ZpfwzIQw5lZ/IMHlHiWQ9cX3vtXHp5e/H/6p1F57BQLJT+KEw9akgcQuf4XUEHOBWltgKA10VY5e5HLwv/UBiaK+3Rk1Ros2KThC+CHOraaSN2JWAO0tHtP+lHH0OknhsC7AcF8TkK04EcDncD5fRG7Php7a8X0GMY= Content-Type: text/plain; charset="utf-8" Content-ID: <13C23369F4253E41B96AFA20D2ED8325@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a77abb1-e356-4d90-1ece-08d6a954bc64 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2019 14:44:32.8143 (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: DM6PR12MB2874 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMy8xNS8xOSA3OjAzIEFNLCBQZXRlciBaaWpsc3RyYSB3cm90ZToNCj4gT24gTW9uLCBNYXIg MTEsIDIwMTkgYXQgMDQ6NDg6NTFQTSArMDAwMCwgTGVuZGFja3ksIFRob21hcyB3cm90ZToNCj4+ IEBAIC00NjcsNiArNDcwLDQ1IEBAIHN0YXRpYyB2b2lkIGFtZF9wbXVfd2FpdF9vbl9vdmVyZmxv dyhpbnQgaWR4LCB1NjQgY29uZmlnKQ0KPj4gICAJfQ0KPj4gICB9DQo+PiAgIA0KPj4gKy8qDQo+ PiArICogQmVjYXVzZSBvZiBOTUkgbGF0ZW5jeSwgaWYgbXVsdGlwbGUgUE1DIGNvdW50ZXJzIGFy ZSBhY3RpdmUgd2U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