Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2596551pxy; Tue, 3 Aug 2021 10:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx9a8VwBMSWVE7mi3aH7QmoT4uBrIx0LCtmjFO1buAP6tjpkr9YFEc532eL/VIcC4p0csd X-Received: by 2002:a6b:4f16:: with SMTP id d22mr37829iob.15.1628010286742; Tue, 03 Aug 2021 10:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628010286; cv=none; d=google.com; s=arc-20160816; b=ee2F15sp55ZI1oYHYWObfkNgYTabKTxt7jDpslDX/f0hogwjVPZdxGDf46tPOvCf7T 6S2kVIiO/hJgRmUdG1MbCxgMcu/mmhUsoEDFzm+50GkTAzLwwpPRQxgRo5rT0HtJcoz7 oGnzE0VwQeqMtzRDjokDsIhmLKR558G16uMejMO09uvCsXsKj5CuZlYllSHUTJYNAvUL 2jPtZpsqmd2bb4lglFUVu06vWkbD5SX5SnI6fwc/zC/57d983mkQi7Bu9gOwJ0qsow1u 3pyCdcvLudQK2sCQQ8ApdYZDdFamvN7zcdcRFIyNWUE4vtAJgAja1h/kFL+DyFlvI79c G3MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=G14sTjYO+IIgbVKg4uLMhLvRIcWyxvTknYCXRHpAn3k=; b=o3ieeyPM4M0vEfPxc9SDBxkGim8R3zG1wGzyFUUcVezEuPoKpObZWiUjn3aZGE+Q9Y QAIbvLr/geDb1iYeLkwXRGqs9eDnT7UQ4ivHmzPdTePzFF7w0XlqnhOeDYxkun5WEmSS mnTSyt+EJCiRnKeCzlekiPuJMQ5xVkXJSNClqO2Z8eEjhMSqS1O2GnXYsku/juV0nhF7 mJWU+9+2Sn9q7eOymxW2zXgTJqz3vW61WYifmyOQitbOUezw5brqsDu6gGnunWN4is+8 7NUjqa1Qe6N0X/CkXBud5xR2yuTJ+xMVpxu/sFihXX3QXtu8mBnnqbVzx/M/Eu9PzsPZ beRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si15872169ilx.122.2021.08.03.10.04.33; Tue, 03 Aug 2021 10:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237594AbhHCRBz (ORCPT + 99 others); Tue, 3 Aug 2021 13:01:55 -0400 Received: from mga06.intel.com ([134.134.136.31]:48522 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237666AbhHCRBM (ORCPT ); Tue, 3 Aug 2021 13:01:12 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10065"; a="274790378" X-IronPort-AV: E=Sophos;i="5.84,292,1620716400"; d="scan'208";a="274790378" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 10:00:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,292,1620716400"; d="scan'208";a="479596495" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP; 03 Aug 2021 10:00:40 -0700 Received: from [10.212.187.158] (kliang2-MOBL.ccr.corp.intel.com [10.212.187.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 8D65658093B; Tue, 3 Aug 2021 10:00:39 -0700 (PDT) Subject: Re: [PATCH V2] perf/x86/intel: Apply mid ACK for small core To: Peter Zijlstra Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, ak@linux.intel.com, stable@vger.kernel.org References: <1627997128-57891-1-git-send-email-kan.liang@linux.intel.com> <9b0cb4ec-e8b8-3739-7b8d-e1c05785023a@linux.intel.com> From: "Liang, Kan" Message-ID: <20f884f0-bf32-a8a0-1636-674d1b3a4715@linux.intel.com> Date: Tue, 3 Aug 2021 13:00:38 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/2021 12:17 PM, Peter Zijlstra wrote: > On Tue, Aug 03, 2021 at 11:20:20AM -0400, Liang, Kan wrote: >> >> >> On 8/3/2021 10:55 AM, Peter Zijlstra wrote: >>> On Tue, Aug 03, 2021 at 06:25:28AM -0700, kan.liang@linux.intel.com wrote: >>>> From: Kan Liang >>>> >>>> A warning as below may be occasionally triggered in an ADL machine when >>>> these conditions occur, >>>> - Two perf record commands run one by one. Both record a PEBS event. >>>> - Both runs on small cores. >>>> - They have different adaptive PEBS configuration (PEBS_DATA_CFG). >>>> >>>> [ 673.663291] WARNING: CPU: 4 PID: 9874 at >>>> arch/x86/events/intel/ds.c:1743 >>>> setup_pebs_adaptive_sample_data+0x55e/0x5b0 >>>> [ 673.663348] RIP: 0010:setup_pebs_adaptive_sample_data+0x55e/0x5b0 >>>> [ 673.663357] Call Trace: >>>> [ 673.663357] >>>> [ 673.663357] intel_pmu_drain_pebs_icl+0x48b/0x810 >>>> [ 673.663360] perf_event_nmi_handler+0x41/0x80 >>>> [ 673.663368] >>>> [ 673.663370] __perf_event_task_sched_in+0x2c2/0x3a0 >>>> >>>> Different from the big core, the small core requires the ACK right >>>> before re-enabling counters in the NMI handler, otherwise a stale PEBS >>>> record may be dumped into the later NMI handler, which trigger the >>>> warning. >>>> >>>> Add a new mid_ack flag to track the case. Add all PMI handler bits in >>>> the struct x86_hybrid_pmu to track the bits for different types of PMUs. >>>> Apply mid ACK for the small cores on an Alder Lake machine. >>> >>> Why do we need a new option? Why isn't early (as in not late) good >>> enough? >>> >> >> The early ACK can fix this issue, however it triggers a spurious NMI during >> the stress test. I'm told to do the ACK right before re-enabling counters >> for small cores. That indeed fixes all the issues. > > Any chance that would also work for the chips that now use late_ack? > Let me check and do some tests. Thanks, Kan