From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BF4B27D781; Fri, 16 May 2025 18:29:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420163; cv=none; b=BzmhfP43iysd67cUOn9WsyalM7F8GAgumcJLtrFyNMLK3Z9IZWb++kf3Rz+ErGmz2HZgFjGFNgQb1GJGckE6EcFQPXvIJdiMQmkkhVOSvD9PoRLrZYbB5fvwu6rPmEC43UDeUuJOrXBPxFHcr0Be2Ic9gfkK/P+VXqqsL0vjPkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420163; c=relaxed/simple; bh=aBznW+kb4PCda6hhX4PByAqMfcQG6U6QJyqTE4hQTSk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sk8ArBPVc6Xb4X2QwshJhPih4ICuehlPbfmNTrxqbfMiw3MIkpv3o9FI9yu3TOcb9QwGLpQF5hRFnqk2B7kbNcy/W8KVcKe1AJq90Yg+jK/uRg9W7ro9frU1qFXf1C/DwN9fkQkIqONq63NRN5Bs8VF1t0mcdlbBVYG31fhkC8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZJ8uMbsf; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZJ8uMbsf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420162; x=1778956162; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aBznW+kb4PCda6hhX4PByAqMfcQG6U6QJyqTE4hQTSk=; b=ZJ8uMbsfe1OXCII4eSBVoqNk8zRQLTOKsQVaAOJbombob2tAKf8yKlX2 nDS1sXjlsJcQXZlswisqJj32oHyb3m70v9L0q7P9wQy6imrFwL4es/R0V qbms9xSMZG73BqHFLxE4cTaR7Qtnqp8GtChwT24/5P3JfjCjlyXkJ8Pii U/TNK1Ltq8fTmB4uQQfmiQvAvWUP9BEgk3nkSOdrZvZExBxmNxR87dDi3 T6eQJ1qcF7AmLz9W532liiBJ/HIKRk/uk+r9K85PXqUuydQTmIZNjKJE8 fHpWc36S+JIQ5dYTx08EJDPGyA3bLL2xI/9Mu7bE8OGusiA5VL6XA79Hc Q==; X-CSE-ConnectionGUID: iZ+SjU3TT96Ze1MohHtLJQ== X-CSE-MsgGUID: KfACV4j/S+ORLcg1bbzjdA== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328795" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328795" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:20 -0700 X-CSE-ConnectionGUID: WipQ0unySySNlA1LKuP6iA== X-CSE-MsgGUID: 2715bz6/Tdqhu4zaYARP+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802596" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:19 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang Subject: [PATCH V3 01/16] perf: Clean up event in freq mode check Date: Fri, 16 May 2025 11:28:38 -0700 Message-Id: <20250516182853.2610284-2-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang Add a helper to check if an event is in freq mode to improve the readability. No functional change. Signed-off-by: Kan Liang --- kernel/events/core.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index a84abc2b7f20..af78ec118e8f 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2442,6 +2442,11 @@ event_filter_match(struct perf_event *event) perf_cgroup_match(event); } =20 +static inline bool is_event_in_freq_mode(struct perf_event *event) +{ + return event->attr.freq && event->attr.sample_freq; +} + static void event_sched_out(struct perf_event *event, struct perf_event_context *ctx) { @@ -2479,7 +2484,7 @@ event_sched_out(struct perf_event *event, struct perf= _event_context *ctx) =20 if (!is_software_event(event)) cpc->active_oncpu--; - if (event->attr.freq && event->attr.sample_freq) { + if (is_event_in_freq_mode(event)) { ctx->nr_freq--; epc->nr_freq--; } @@ -2780,7 +2785,7 @@ event_sched_in(struct perf_event *event, struct perf_= event_context *ctx) =20 if (!is_software_event(event)) cpc->active_oncpu++; - if (event->attr.freq && event->attr.sample_freq) { + if (is_event_in_freq_mode(event)) { ctx->nr_freq++; epc->nr_freq++; } @@ -4391,11 +4396,11 @@ static void perf_adjust_freq_unthr_events(struct li= st_head *event_list) if (hwc->interrupts =3D=3D MAX_INTERRUPTS) { hwc->interrupts =3D 0; perf_log_throttle(event, 1); - if (!event->attr.freq || !event->attr.sample_freq) + if (!is_event_in_freq_mode(event)) event->pmu->start(event, 0); } =20 - if (!event->attr.freq || !event->attr.sample_freq) + if (!is_event_in_freq_mode(event)) continue; =20 /* @@ -13129,7 +13134,7 @@ perf_event_alloc(struct perf_event_attr *attr, int = cpu, =20 hwc =3D &event->hw; hwc->sample_period =3D attr->sample_period; - if (attr->freq && attr->sample_freq) + if (is_event_in_freq_mode(event)) hwc->sample_period =3D 1; hwc->last_period =3D hwc->sample_period; =20 --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BCC927D786; Fri, 16 May 2025 18:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420164; cv=none; b=Il/LIzaWvIk9Fen4eX6/1TakniMdM8sdXdTnHFaumGpKuqhQ4qAZaDacvylHFZkydhVSm3/ezKz5uOh9Er5Wp6Vyd1u8CByIyts7wY7KuUplKmE2QQn7IrsN/JugFq2nQfxvc6HXQScHaQezy3b4J6jTKleeVFH78SyNFcaMw3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420164; c=relaxed/simple; bh=0BVLWtvpQmnFXnkbc8d3Yph+omB7Q5I1MyklljtDLIE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NZPZ1jblwvNbTnqBuNi9jBA6DkQz/A4WozGuO8ywaHk0sDpisjJEhssnxrcZH5MbYbMtXvyVLGAFNLPGJeh/SGq8oaZxdbsp1qDLWUwUtGfKVGs5NxhICE0u0mBYuV4TliwTcBe7VPeLX3irXoLLxAjKuXnwqTIKgPoY9SWXUTs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=e7dTmY+p; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="e7dTmY+p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420162; x=1778956162; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0BVLWtvpQmnFXnkbc8d3Yph+omB7Q5I1MyklljtDLIE=; b=e7dTmY+pxFQYbMnfMfo5Z3jACvSgcz67JkWLaxPACagPhE4w/AIwX8eb 9cB6jVwhdlUuHd1QDkigqRyTNyPkAswmKZqgpNqPnnfucBNL1VEBy4rJO tRmMPV19Xv7dXKPJklncCVeBWWU+WWwsnjQrACEEC07QmQhcebhsPHd2b carv7VsVfYSujFmqHH/prJw6btKQhgl9BfdnOIs4MCtKkvNs2mZB1CljQ 66V3sBtDvqxJZwkplLQItkO40/ZzygHrhaLQv8utx1P7K3ixlbW7dSkOO l0G4ioHoG6uH8c5mUFZp0vrYvnasaggRGx8OuppxatAnNC/rEilJdmYO2 g==; X-CSE-ConnectionGUID: vc9Kx7KET52mcDbOEjXrjw== X-CSE-MsgGUID: ALkajP4VTouLDI3ojeba/A== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328802" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328802" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:20 -0700 X-CSE-ConnectionGUID: igw3vf2uQoOs4GmXzuZA+g== X-CSE-MsgGUID: dHK39doxQKyoLmcvsveTwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802597" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:20 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang Subject: [PATCH V3 02/16] perf: Fix the throttle logic for a group Date: Fri, 16 May 2025 11:28:39 -0700 Message-Id: <20250516182853.2610284-3-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The current throttle logic doesn't work well with a group, e.g., the following sampling-read case. $ perf record -e "{cycles,cycles}:S" ... $ perf report -D | grep THROTTLE | tail -2 THROTTLE events: 426 ( 9.0%) UNTHROTTLE events: 425 ( 9.0%) $ perf report -D | grep PERF_RECORD_SAMPLE -a4 | tail -n 5 0 1020120874009167 0x74970 [0x68]: PERF_RECORD_SAMPLE(IP, 0x1): ... sample_read: .... group nr 2 ..... id 0000000000000327, value 000000000cbb993a, lost 0 ..... id 0000000000000328, value 00000002211c26df, lost 0 The second cycles event has a much larger value than the first cycles event in the same group. The current throttle logic in the generic code only logs the THROTTLE event. It relies on the specific driver implementation to disable events. For all ARCHs, the implementation is similar. Only the event is disabled, rather than the group. The logic to disable the group should be generic for all ARCHs. Add the logic in the generic code. The following patch will remove the buggy driver-specific implementation. The throttle only happens when an event is overflowed. Stop the entire group when any event in the group triggers the throttle. The MAX_INTERRUPTS is set to all throttle events. The unthrottled could happen in 3 places. - event/group sched. All events in the group are scheduled one by one. All of them will be unthrottled eventually. Nothing needs to be changed. - The perf_adjust_freq_unthr_events for each tick. Needs to restart the group altogether. - The __perf_event_period(). The whole group needs to be restarted altogether as well. With the fix, $ sudo perf report -D | grep PERF_RECORD_SAMPLE -a4 | tail -n 5 0 3573470770332 0x12f5f8 [0x70]: PERF_RECORD_SAMPLE(IP, 0x2): ... sample_read: .... group nr 2 ..... id 0000000000000a28, value 00000004fd3dfd8f, lost 0 ..... id 0000000000000a29, value 00000004fd3dfd8f, lost 0 Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Kan Liang --- kernel/events/core.c | 60 ++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index af78ec118e8f..52490c2ce45b 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2739,6 +2739,39 @@ void perf_event_disable_inatomic(struct perf_event *= event) static void perf_log_throttle(struct perf_event *event, int enable); static void perf_log_itrace_start(struct perf_event *event); =20 +static void perf_event_unthrottle(struct perf_event *event, bool start) +{ + event->hw.interrupts =3D 0; + if (start) + event->pmu->start(event, 0); + perf_log_throttle(event, 1); +} + +static void perf_event_throttle(struct perf_event *event) +{ + event->pmu->stop(event, 0); + event->hw.interrupts =3D MAX_INTERRUPTS; + perf_log_throttle(event, 0); +} + +static void perf_event_unthrottle_group(struct perf_event *event, bool ski= p_start_event) +{ + struct perf_event *sibling, *leader =3D event->group_leader; + + perf_event_unthrottle(leader, skip_start_event ? leader !=3D event : true= ); + for_each_sibling_event(sibling, leader) + perf_event_unthrottle(sibling, skip_start_event ? sibling !=3D event : t= rue); +} + +static void perf_event_throttle_group(struct perf_event *event) +{ + struct perf_event *sibling, *leader =3D event->group_leader; + + perf_event_throttle(leader); + for_each_sibling_event(sibling, leader) + perf_event_throttle(sibling); +} + static int event_sched_in(struct perf_event *event, struct perf_event_context *ctx) { @@ -4393,12 +4426,8 @@ static void perf_adjust_freq_unthr_events(struct lis= t_head *event_list) =20 hwc =3D &event->hw; =20 - if (hwc->interrupts =3D=3D MAX_INTERRUPTS) { - hwc->interrupts =3D 0; - perf_log_throttle(event, 1); - if (!is_event_in_freq_mode(event)) - event->pmu->start(event, 0); - } + if (hwc->interrupts =3D=3D MAX_INTERRUPTS) + perf_event_unthrottle_group(event, is_event_in_freq_mode(event)); =20 if (!is_event_in_freq_mode(event)) continue; @@ -6426,14 +6455,6 @@ static void __perf_event_period(struct perf_event *e= vent, active =3D (event->state =3D=3D PERF_EVENT_STATE_ACTIVE); if (active) { perf_pmu_disable(event->pmu); - /* - * We could be throttled; unthrottle now to avoid the tick - * trying to unthrottle while we already re-started the event. - */ - if (event->hw.interrupts =3D=3D MAX_INTERRUPTS) { - event->hw.interrupts =3D 0; - perf_log_throttle(event, 1); - } event->pmu->stop(event, PERF_EF_UPDATE); } =20 @@ -6441,6 +6462,14 @@ static void __perf_event_period(struct perf_event *e= vent, =20 if (active) { event->pmu->start(event, PERF_EF_RELOAD); + /* + * Once the period is force-reset, the event starts immediately. + * But the event/group could be throttled. Unthrottle the + * event/group now to avoid the next tick trying to unthrottle + * while we already re-started the event/group. + */ + if (event->hw.interrupts =3D=3D MAX_INTERRUPTS) + perf_event_unthrottle_group(event, true); perf_pmu_enable(event->pmu); } } @@ -10331,8 +10360,7 @@ __perf_event_account_interrupt(struct perf_event *e= vent, int throttle) if (unlikely(throttle && hwc->interrupts >=3D max_samples_per_tick)) { __this_cpu_inc(perf_throttled_count); tick_dep_set_cpu(smp_processor_id(), TICK_DEP_BIT_PERF_EVENTS); - hwc->interrupts =3D MAX_INTERRUPTS; - perf_log_throttle(event, 0); + perf_event_throttle_group(event); ret =3D 1; } =20 --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9FE927E1AC; Fri, 16 May 2025 18:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420164; cv=none; b=YvUA0M7TWUfyWdTUjE4x4bKbpntxGULtjG0b0m/xqDAZG9K22uaCgxYbVKxZUWH5vmeG863efRThmLMp9oo8yQFOIXxPFYmL0XMjIGkZzFbyH0uQrrHQ1Bi0SNkwdTiOGU/NTDMcqUnsWr4Z5OZdCYA6WD2CbOkF1+Y7wdXEGjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420164; c=relaxed/simple; bh=25j5vFEsBU7YPCN2sAyzRM/ZIyTaWwct8v5PeU7SHZk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=O+cShUdSlXMR6ihoRV/tJcvfpsKoL6BmAD2ghNkWi7SDR1K6eQTBFRWUY6dPVU/c3+8AtMKHGxJviGUn3OYNzP7gJruv3R7h0p8IGTVS1Qe3Dz6PrObjcTQZ9hFNstIkvzJDPDdoqYX4xbMjq6Ramb2qSFIWbomz7PQKQeooezQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ckwNm2Du; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ckwNm2Du" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420163; x=1778956163; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=25j5vFEsBU7YPCN2sAyzRM/ZIyTaWwct8v5PeU7SHZk=; b=ckwNm2DuCU3pbSJJ/h+MJbAC8p7l4e+RL9hK8qiara8of33TBFwVinf0 YzP+NKi+vZo3WwIYrbhZ3LQYosjuTUG2NkPQg3dOuj3oBR7CX9JO/jDl2 BAOvds6aY8lcp04pziragq2fhhiSvoxjaBa/Io/yF3yaBdprxj8VUL26C XGvGPtQpMvc+azwt58cRDBC5z0tr7gI72r7r5K7OWb0AvOAqEKnd4F8J2 0hY3iVffxcgqrGWz034tSx6ZrTF+TYw2kDeITN0Xv8s6VCVlO62EmpROl lanBC8LBVVLaBFXNGCP1SCTtK28yOFOSY/B43qZ66W67Crr1OZLVuQb7L Q==; X-CSE-ConnectionGUID: RIXGIwmLQ7+wzeqthzMeBw== X-CSE-MsgGUID: EKeJer3CRqelpWvgYgx1gA== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328809" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328809" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:21 -0700 X-CSE-ConnectionGUID: Ga5hlcp5RIe6iRFCYiYwHw== X-CSE-MsgGUID: hB0MF+2gTyyV8cz6RZ5a7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802599" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:20 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang Subject: [PATCH V3 03/16] perf/x86/intel: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:40 -0700 Message-Id: <20250516182853.2610284-4-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang --- arch/x86/events/core.c | 3 +-- arch/x86/events/intel/core.c | 6 ++---- arch/x86/events/intel/ds.c | 7 +++---- arch/x86/events/intel/knc.c | 3 +-- arch/x86/events/intel/p4.c | 3 +-- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 186e31cd0c14..8a2f73333a50 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1730,8 +1730,7 @@ int x86_pmu_handle_irq(struct pt_regs *regs) =20 perf_sample_save_brstack(&data, event, &cpuc->lbr_stack, NULL); =20 - if (perf_event_overflow(event, &data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 if (handled) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index b7562d66c6ea..a8309a67693e 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3138,8 +3138,7 @@ static void x86_pmu_handle_guest_pebs(struct pt_regs = *regs, continue; =20 perf_sample_data_init(data, 0, event->hw.last_period); - if (perf_event_overflow(event, data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, data, regs); =20 /* Inject one fake event is enough. */ break; @@ -3282,8 +3281,7 @@ static int handle_pmi_common(struct pt_regs *regs, u6= 4 status) if (has_branch_stack(event)) intel_pmu_lbr_save_brstack(&data, cpuc, event); =20 - if (perf_event_overflow(event, &data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 return handled; diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index 58c054fa56b5..f8610f7196f0 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c @@ -2368,8 +2368,7 @@ __intel_pmu_pebs_last_event(struct perf_event *event, * All but the last records are processed. * The last one is left to be able to call the overflow handler. */ - if (perf_event_overflow(event, data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, data, regs); } =20 if (hwc->flags & PERF_X86_EVENT_AUTO_RELOAD) { @@ -2597,8 +2596,8 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *= iregs, struct perf_sample_d if (error[bit]) { perf_log_lost_samples(event, error[bit]); =20 - if (iregs && perf_event_account_interrupt(event)) - x86_pmu_stop(event, 0); + if (iregs) + perf_event_account_interrupt(event); } =20 if (counts[bit]) { diff --git a/arch/x86/events/intel/knc.c b/arch/x86/events/intel/knc.c index 3e8ec049b46d..384589168c1a 100644 --- a/arch/x86/events/intel/knc.c +++ b/arch/x86/events/intel/knc.c @@ -254,8 +254,7 @@ static int knc_pmu_handle_irq(struct pt_regs *regs) =20 perf_sample_data_init(&data, 0, last_period); =20 - if (perf_event_overflow(event, &data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 /* diff --git a/arch/x86/events/intel/p4.c b/arch/x86/events/intel/p4.c index c85a9fc44355..126d5ae264cb 100644 --- a/arch/x86/events/intel/p4.c +++ b/arch/x86/events/intel/p4.c @@ -1072,8 +1072,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) continue; =20 =20 - if (perf_event_overflow(event, &data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 if (handled) --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B24C27D770; Fri, 16 May 2025 18:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420164; cv=none; b=jHVB2i514LSnhqlngh0KWT5hK76HPwyUvhOQUcD3lkDSB4VJ0vmK7KyE0iS/hLdBj4Q0vA868kvQwVQ9fUWqlrmOAN0s6BtRpKlh8A8oBeG1KU8OoRARj5mre61EafZnPBxDyQjlvnmSLm6iXMD3VlLbkv+/vKjeOSQlxM51ek4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420164; c=relaxed/simple; bh=mmZ9nbgB5fwwHNOO/FW7dHFDnAhM6aTO/E4japeEfI4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TFcT1pLJidHBHTTfIcTrqRsnx4K/FYUoVX0NDNxTvnwyApVW7Ok/vPKTSnultNhSi9y7ylG7ppNKeOp+jgfhByKivZLREz67z7pFNgYgvHj8BzKsHT2wCKCQSiAykdgapY0awlc3ccDutrQVEto8UvEu9D5Wlt2kngK6kLGAesc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dxVSa2KK; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dxVSa2KK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420163; x=1778956163; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mmZ9nbgB5fwwHNOO/FW7dHFDnAhM6aTO/E4japeEfI4=; b=dxVSa2KKRHLH/LEDryGwMsgbwfb2Jfo+WfcPkVloiqw2F2mSfEuFK/W7 rQEnUVGS85P45pyagL3MOulRI27/mJWsiLokHXq6twsJR2Zqf0l8Eqe/h 1yTObTGFDbbmfB/T6jlgE5l15Mawuo/+WxvoX4OAv5XbkyOMi4zgy2WSq dOCZVcCBwudZdNzZ/s1JXaO8jvScbzWtEs2W/01Cf6+YMJQzm9g2xmv6P YwzhVbwOTq52ImgIlstDM5vxcbysu0n2gNFZ/CBgzTaU5X3Uh1QBIo351 9xMnRb2/7bGqFZWUFI8z01ZbQ0MnKwZfSNFUK+G2gyu9Jsp6W8LFqR69z w==; X-CSE-ConnectionGUID: EEl7ojkJRwmmUnm162SzVw== X-CSE-MsgGUID: ShBs62X/SOaQCV2e21y8bg== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328816" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328816" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:21 -0700 X-CSE-ConnectionGUID: vslG2EC7SwWo9ImaBWdTQw== X-CSE-MsgGUID: uPzGL08mTTWhWlT6wVgjWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802603" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:21 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Ravi Bangoria , Sandipan Das Subject: [PATCH V3 04/16] perf/x86/amd: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:41 -0700 Message-Id: <20250516182853.2610284-5-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Reviewed-by: Ravi Bangoria Signed-off-by: Kan Liang Cc: Sandipan Das Cc: Ravi Bangoria --- arch/x86/events/amd/core.c | 3 +-- arch/x86/events/amd/ibs.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index 30d6ceb4c8ad..5e64283b9bf2 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -1003,8 +1003,7 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs) =20 perf_sample_save_brstack(&data, event, &cpuc->lbr_stack, NULL); =20 - if (perf_event_overflow(event, &data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 /* diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 0252b7ea8bca..4bbbca02aeb1 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -1373,9 +1373,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_= ibs, struct pt_regs *iregs) hwc->sample_period =3D perf_ibs->min_period; =20 out: - if (throttle) { - perf_ibs_stop(event, 0); - } else { + if (!throttle) { if (perf_ibs =3D=3D &perf_ibs_op) { if (ibs_caps & IBS_CAPS_OPCNTEXT) { new_config =3D period & IBS_OP_MAX_CNT_EXT_MASK; --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F4BA27F18F; Fri, 16 May 2025 18:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420166; cv=none; b=m1ymSxSKWBqafen9XEhzICARLEUVxMGe1gXfA2BNeyuVREUZ9ZFyLzi85hripIwwWd7vYQA9TGv2rigxv3ms+cBg6tIaLUgA7LLz0egbiewcrrnew0Lxj5m4orFaMHG4+xTuH0RafcqcaOw81PEySP/i1Au6/SD4G3xfAOyC1+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420166; c=relaxed/simple; bh=eftPXZUtS7TWj+fyRnjgJB01av2QQsqnM0j4qbjXMQk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ICFMLOmkkceNw4frSRHpRpScR2fugnXet/uoB+gKbvQgxEvXpmZtYdFNZDGyMBnAC7RbLg4Wyasu1y4fv2Cni9soNBVQ0sUrvfVD/i/eeanh+foSeaSZ/kyj6fTRvl3Dh9p7XH2p6PrBAMhOj5nvBtFSkIgptIODSIgUefeO5k0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Sahfkd0H; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Sahfkd0H" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420164; x=1778956164; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eftPXZUtS7TWj+fyRnjgJB01av2QQsqnM0j4qbjXMQk=; b=Sahfkd0HHiA2sFks7AOwLsyEfeLJp9heVmc27soUhp6xFds7rsDLLybH SA7u2o3SsGnFzOhJgnM2ShASXjEquThRoECOfaQUiVh6v1WkenpxswuVZ wwVWmuSTBsIov6zISr1DkUlGcw934zVWi2Z+bnEcQEY8yIxEtJicpSjV1 Ef2sPW5Nw9nPmN3+1FK16WGIjHLFXvYsosS7OrGstqVHRe2I8faqIYzal Tdj5EcYjlC1uGLq+RhlXiT8MYDlEpzkhI0237MVwP/HMO6bumqO0+aU6M tq8IOSPdz8YJTaKDpn09ZCG/TcMa8P3yMmVJis+8IULN3R/ZRlpoSxkA4 g==; X-CSE-ConnectionGUID: Qz4eYZWuQFSBZVd2piz2kA== X-CSE-MsgGUID: aRZvGTAuSYiMyuvYppffAw== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328825" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328825" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:21 -0700 X-CSE-ConnectionGUID: pssoVBvOROmS2NGrVCVxXA== X-CSE-MsgGUID: aYFUfRG1S4+jxhI3msdw0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802607" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:21 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , silviazhao , CodyYao-oc Subject: [PATCH V3 05/16] perf/x86/zhaoxin: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:42 -0700 Message-Id: <20250516182853.2610284-6-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: silviazhao Cc: CodyYao-oc --- arch/x86/events/zhaoxin/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/events/zhaoxin/core.c b/arch/x86/events/zhaoxin/core.c index 2fd9b0cf9a5e..49a5944fac63 100644 --- a/arch/x86/events/zhaoxin/core.c +++ b/arch/x86/events/zhaoxin/core.c @@ -397,8 +397,7 @@ static int zhaoxin_pmu_handle_irq(struct pt_regs *regs) if (!x86_perf_event_set_period(event)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - x86_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 /* --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B3B727F73A; Fri, 16 May 2025 18:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420167; cv=none; b=lUY1YlSTMPlZCH/Iz4mCvv/hJKRHRg9I257y4YovnKkgMU72YyBYje2sP4zViiWPwgU/oGCT4BU8eBb6ViAxtJ8M4dZ3ttxDCZGGX/xMZYJ0ZlzWkxYjFwPYaIDgjR3isFliob0kVEkj8rz2et49Oq0VlBwnqhnG52dXk6KKaQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420167; c=relaxed/simple; bh=s+EyXjLUXo0M2dfj157AL5fvrY36sWvSBJ2tuImTWtk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WeZELLkWy2JtNFPoZF2F6v9gcAcC6Ial7B2UNghjDjGuJcBUmvhPZsoLiV2B/RplLQfccQAWO8+RTz1p8mLAkYHhhPptKbr7GcWoQdoPks+iVcoBxWx3W2T7KIPTN6qprI4F2yn3CikH0YqUa7LRirmxOP5nOl7mAEI1ZY8TJ+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=n/3FQJvy; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n/3FQJvy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420165; x=1778956165; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s+EyXjLUXo0M2dfj157AL5fvrY36sWvSBJ2tuImTWtk=; b=n/3FQJvyXnu8zaiuhSLIuksR+gMgqxXx7Jf9XIQWVB1je+r3+QQgpCL6 rzqZEcduVP8bzbuhgm61fs+7jyLqG/qV4vfBPGU5e7aZDxxmUPs4sWfsV Wosyct8gBZYUutrS4tWyoJVMIH/zeSFMHbFeCBL/odG7Kw6oUkhmiCGsn Qb+CEly4mUIPhqUlIHrrcwIEEe0ldjxtCGE5mkMxT4KqfSrWH4yE+8Agp Hmq9/9gGiadgsCw42nxrInP6qCeEuuWx7YHoXJn7adgNvD1iBLe2E2Pid LS+47Vw7HX2czC4VQDuawJnKIGlMlcDpz3FU68Qt3RWxdbsoU0mPi3nE0 g==; X-CSE-ConnectionGUID: 7QQPApb2SEyTa8y/GpK4OQ== X-CSE-MsgGUID: JGQKBhMsQBuBUdixCbvmZw== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328833" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328833" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:22 -0700 X-CSE-ConnectionGUID: JhatOYD3R/aJuVTali1oXA== X-CSE-MsgGUID: PJZxwUZ2Qo+BlYBDLBCcQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802609" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:21 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Athira Rajeev , Madhavan Srinivasan , linuxppc-dev@lists.ozlabs.org Subject: [PATCH V3 06/16] powerpc/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:43 -0700 Message-Id: <20250516182853.2610284-7-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: Athira Rajeev Cc: Madhavan Srinivasan Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/perf/core-book3s.c | 6 ++---- arch/powerpc/perf/core-fsl-emb.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3= s.c index 42ff4d167acc..8b0081441f85 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -2344,12 +2344,10 @@ static void record_and_restart(struct perf_event *e= vent, unsigned long val, ppmu->get_mem_weight(&data.weight.full, event->attr.sample_type); data.sample_flags |=3D PERF_SAMPLE_WEIGHT_TYPE; } - if (perf_event_overflow(event, &data, regs)) - power_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } else if (period) { /* Account for interrupt in case of invalid SIAR */ - if (perf_event_account_interrupt(event)) - power_pmu_stop(event, 0); + perf_event_account_interrupt(event); } } =20 diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-= emb.c index d2ffcc7021c5..7120ab20cbfe 100644 --- a/arch/powerpc/perf/core-fsl-emb.c +++ b/arch/powerpc/perf/core-fsl-emb.c @@ -635,8 +635,7 @@ static void record_and_restart(struct perf_event *event= , unsigned long val, =20 perf_sample_data_init(&data, 0, last_period); =20 - if (perf_event_overflow(event, &data, regs)) - fsl_emb_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } } =20 --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1684C27FB09; Fri, 16 May 2025 18:29:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420166; cv=none; b=Vsmdzlm5FKwAnHcEGbIsQWjIQaFOziNFomMLSvcX5fw5pC2oFdlx7K+F5hZfuOJJHM4+/bFj3IgIoF9bbgturi+gP8Lo5mW6HjRK3Koo9rS4M+q8IZTvhlJmsqRoHmn/EsMdvENTJtmO70Nn7VXKD3P2zU3c2eraJLNF7uPqACc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420166; c=relaxed/simple; bh=JYonQVJrRjxKJDpe7nXWSwniUE7wi5IkJhEj5Hcl77E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WbbwXY5vuYUvyUSLOv7Q7J1xTo01/2aBQN6zeIPaKNMiO5ihluQRpuf8XlxQ0drVbtiK6piKlCqn4N7EgpG1PVoUxLy3h3Pm3/+PiCsTuXqdgqrMjAeBw+ore+zqRu4OAfqn7UT/RKY32JqKHict8tbZY9yGmpNdCLhTi6RmG7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LJCWZ5Cc; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LJCWZ5Cc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420165; x=1778956165; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JYonQVJrRjxKJDpe7nXWSwniUE7wi5IkJhEj5Hcl77E=; b=LJCWZ5CcO8CA0o8AuwueA35xewanGVCnCJtgrvE1+P7jOrrvrgaTkTwz TzWT8NTbfCKQbCAiUFfag0PC4SnNKIyyQ2FT9g2wKCaUo1pQdAj616f6i lvc6cfUrUbK7vah58KUvTBhOZ03owS+YpwmTgwUJAp9shJakdEyXwFJGn 1zYs3Kn7+EyOHqGLPsfieGyxnG4z3XAB/naXE9L7CfF7yYQqtnQbKLtnF NCVJS+aF0zU89aAGvGID3hbNteDxHltFZ4B91mtvusP9uH1PLKlUeNtox cH3dtUNRfp98AwGtV7Vqcw/qLt6eH1Qyg6pUFT46jzmj2WEH//s0febNf Q==; X-CSE-ConnectionGUID: fcoy2zGISzig+w8RjM7KdQ== X-CSE-MsgGUID: XHELI8iKRPeECbd6OPH2bg== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328842" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328842" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:22 -0700 X-CSE-ConnectionGUID: 4V+UjDLzRzCpwocAtIrbrA== X-CSE-MsgGUID: BNyDIG5iTf+vs6e7Kc/TgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802612" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:22 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , linux-s390@vger.kernel.org Subject: [PATCH V3 07/16] s390/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:44 -0700 Message-Id: <20250516182853.2610284-8-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Tested-by: Thomas Richter Signed-off-by: Kan Liang Cc: Thomas Richter Cc: linux-s390@vger.kernel.org --- arch/s390/kernel/perf_cpum_cf.c | 2 -- arch/s390/kernel/perf_cpum_sf.c | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_c= f.c index e657fad7e376..6a262e198e35 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -980,8 +980,6 @@ static int cfdiag_push_sample(struct perf_event *event, } =20 overflow =3D perf_event_overflow(event, &data, ®s); - if (overflow) - event->pmu->stop(event, 0); =20 perf_event_update_userpage(event); return overflow; diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_s= f.c index ad22799d8a7d..91469401f2c9 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c @@ -1072,10 +1072,7 @@ static int perf_push_sample(struct perf_event *event, overflow =3D 0; if (perf_event_exclude(event, ®s, sde_regs)) goto out; - if (perf_event_overflow(event, &data, ®s)) { - overflow =3D 1; - event->pmu->stop(event, 0); - } + overflow =3D perf_event_overflow(event, &data, ®s); perf_event_update_userpage(event); out: return overflow; --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82A5127FD5D; Fri, 16 May 2025 18:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420168; cv=none; b=MRSeEXiAakOUUxw520ujXfdPjO7UuqQO5uFfO5X73gfrO0XD1l8yI4u7laBGh7M2TWYQSA27lOD8V7ZwUnSe1esPqZ6vFkT/rGt22COX9cG9lJVrtcBs3HcUGJX34XZzcKuHip0tRMRdsJcScR27rkzR90x2oBS7UoMB50HMRmI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420168; c=relaxed/simple; bh=h551J25h8XFy68PU1OOtFou2mqDGDS+8kG2qd49H3XQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aUsQ/qRIjsb9LpnQLgLqDALL4CcEu5TpQOPwX/jfYqa3TQj0TXajsS5s0q+j5QzLw1DA6dFrCxWDaiwRhxKXCbbjjJwre6MGf0BGqvyyUWKvuMgv0gQSYQHq1nWI8jkNAFMK8CetSnFwFEKt4oBaZkutr3RiDTVhMBHvjaOeMs4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=g+sNjhe1; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="g+sNjhe1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420166; x=1778956166; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h551J25h8XFy68PU1OOtFou2mqDGDS+8kG2qd49H3XQ=; b=g+sNjhe1vxSbWmeMwqTvvD4Xkez4rbYBKPraduon+bd2AoXHK7G4z+Xf DgT8UZZJgnfb+JCtKFkHvpn83MW0XCZ6Hbnybt0Tg1RxXwInPkZDa+1xv 1HAfOjD4jwTLP/BRcbISbTZxcGmP4WMhEPM9e9sWFTHdzDKzy4sxb4Pdt dlEnjPLWyywKiVJ83YuRUcWSsFUcFJJS0PRliJSwUEBuwmiY3Z45VQTCd 3op0H2Y8k2A87FWKSOKLS1IcTFhkdIKzGYo1TZdE3SmSuj0o+YKix7N7p q+7zm+9sqY/QY8m5i94puTGmFyQGA4DDJrewfBQDt+G0lsiCZ2G4NkzMx w==; X-CSE-ConnectionGUID: m2uGIzIfTk6jslczo1OrtA== X-CSE-MsgGUID: qyPTBzewRFWIDeY9Pfrjbw== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328850" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328850" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:23 -0700 X-CSE-ConnectionGUID: YpKgUdNOSKafc5QR5vOhTw== X-CSE-MsgGUID: 0OYYXZ76RIKEXecUK816yg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802613" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:22 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Rob Herring , Vincenzo Frascino , Will Deacon Subject: [PATCH V3 08/16] perf/arm: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:45 -0700 Message-Id: <20250516182853.2610284-9-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Tested-by: Leo Yan Signed-off-by: Kan Liang Cc: Mark Rutland Cc: Rob Herring (Arm) Cc: Vincenzo Frascino Cc: Will Deacon Cc: Leo Yan --- drivers/perf/arm_pmuv3.c | 3 +-- drivers/perf/arm_v6_pmu.c | 3 +-- drivers/perf/arm_v7_pmu.c | 3 +-- drivers/perf/arm_xscale_pmu.c | 6 ++---- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c index e506d59654e7..3db9f4ed17e8 100644 --- a/drivers/perf/arm_pmuv3.c +++ b/drivers/perf/arm_pmuv3.c @@ -887,8 +887,7 @@ static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *= cpu_pmu) * an irq_work which will be taken care of in the handling of * IPI_IRQ_WORK. */ - if (perf_event_overflow(event, &data, regs)) - cpu_pmu->disable(event); + perf_event_overflow(event, &data, regs); } armv8pmu_start(cpu_pmu); =20 diff --git a/drivers/perf/arm_v6_pmu.c b/drivers/perf/arm_v6_pmu.c index b09615bb2bb2..7cb12c8e06c7 100644 --- a/drivers/perf/arm_v6_pmu.c +++ b/drivers/perf/arm_v6_pmu.c @@ -276,8 +276,7 @@ armv6pmu_handle_irq(struct arm_pmu *cpu_pmu) if (!armpmu_event_set_period(event)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - cpu_pmu->disable(event); + perf_event_overflow(event, &data, regs); } =20 /* diff --git a/drivers/perf/arm_v7_pmu.c b/drivers/perf/arm_v7_pmu.c index 17831e1920bd..a1e438101114 100644 --- a/drivers/perf/arm_v7_pmu.c +++ b/drivers/perf/arm_v7_pmu.c @@ -930,8 +930,7 @@ static irqreturn_t armv7pmu_handle_irq(struct arm_pmu *= cpu_pmu) if (!armpmu_event_set_period(event)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - cpu_pmu->disable(event); + perf_event_overflow(event, &data, regs); } =20 /* diff --git a/drivers/perf/arm_xscale_pmu.c b/drivers/perf/arm_xscale_pmu.c index 638fea9b1263..c2ac41dd9e19 100644 --- a/drivers/perf/arm_xscale_pmu.c +++ b/drivers/perf/arm_xscale_pmu.c @@ -186,8 +186,7 @@ xscale1pmu_handle_irq(struct arm_pmu *cpu_pmu) if (!armpmu_event_set_period(event)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - cpu_pmu->disable(event); + perf_event_overflow(event, &data, regs); } =20 irq_work_run(); @@ -519,8 +518,7 @@ xscale2pmu_handle_irq(struct arm_pmu *cpu_pmu) if (!armpmu_event_set_period(event)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - cpu_pmu->disable(event); + perf_event_overflow(event, &data, regs); } =20 irq_work_run(); --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07A7727FD7A; Fri, 16 May 2025 18:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420168; cv=none; b=TvIyDFMAS7cJUPDreg6ot/+UrkIqn68uC6Bs6BnigBfgATNuIy4SXYOQK7GzFwkLfH52oCdgdhz4WBD2wWisYXtU1d2kceD65jSw5zgDQKdgfV530tzGrfwvwS950GDDzeu7TRhuBVL1W85acwtXu7XxUxwndxiazJVvYeqz1qA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420168; c=relaxed/simple; bh=jtzi1Dswis+7E8s5xuD4Q5RcegCZpv4/8lL3qUWjHa0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mbkEOY/FjbK7vFWp/mU1Sd2PlB+PjL/Wm501sfaDTYNXuH9iBKyavBnk2+3VU9N/BzjcMayzrvQasmcqSTDWD43h/xRz3OHkBoUPnkVH+7jE9IWpUGyIHdh+0q1QZ09Ue3rgOUkzHWOk2iCI+9uHYYMBEj0lis5DGEa7O+0GJA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=W1BcsYkf; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="W1BcsYkf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420167; x=1778956167; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jtzi1Dswis+7E8s5xuD4Q5RcegCZpv4/8lL3qUWjHa0=; b=W1BcsYkfkbaZcbacrC0tdtgBmw/6YQxzlwbakcZHzP+qwJinLRj+2Iis seL8MMdZR7KEaAgCmYM6A2PnLgaqui2YqfrZOvqj4GvJCeNZq8zV71Kts rX01Wc3JYTjUNNo3wOKL76TnNzP3HQflnr4/3GDi4gg0F81G/rkjtL1ar bYYmKj4UaCfgKwMciJiAsw9DM60G5j2Lkk2aLWy4JnFqzlgrTxQzyN+OT qTJdCfqStfbeA0E4331oy+EDL8zKiOFolbXVDr+BxO6ijQbikCQWoQXwM 8LaPYU2BhvNDRDy+d45w6m5WbrhLnx6rHqEy7hAMRsRGPQwnVfDGBVISu Q==; X-CSE-ConnectionGUID: Vm17cjiERj2wEMAfcp7Qlw== X-CSE-MsgGUID: Er5nQ4VLSjmX7jqW3+K8Pg== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328858" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328858" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:23 -0700 X-CSE-ConnectionGUID: w4qC/1qGTh+TTYBtZ0KYHg== X-CSE-MsgGUID: iTIbMbSZQxu8WApuVIO/vg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802614" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:23 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Oliver Upton Subject: [PATCH V3 09/16] perf/apple_m1: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:46 -0700 Message-Id: <20250516182853.2610284-10-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: Oliver Upton --- drivers/perf/apple_m1_cpu_pmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pm= u.c index df9a28ba69dc..81b6f1a62349 100644 --- a/drivers/perf/apple_m1_cpu_pmu.c +++ b/drivers/perf/apple_m1_cpu_pmu.c @@ -474,8 +474,7 @@ static irqreturn_t m1_pmu_handle_irq(struct arm_pmu *cp= u_pmu) if (!armpmu_event_set_period(event)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - m1_pmu_disable_event(event); + perf_event_overflow(event, &data, regs); } =20 cpu_pmu->start(cpu_pmu); --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C20B428001A; Fri, 16 May 2025 18:29:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420169; cv=none; b=cPWRogs4alNswZZ5zzLWlBA/cC3D+mmq87i9NYtbcrpNEqFN1eFeljD2CDbR0agoyXEhnrX/yqy8FQWDkNNzpVpFF2xZJzLAMlkRHcSo2diLKL3fYqacCDAHu7yihctd0IUju+RQPBAIJOauvWWWLNJXS2X+qgdaMuKOL3A14jM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420169; c=relaxed/simple; bh=NhpvDIFF3RCGCMgFlua6GwCE5WabCIdXhqFSclRzhlI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OCebro64Qm+qYG0oh71MefdxU9DpupTF8bhOiCTAaLI5u3i1JIyUzzCBI+JORyrqHkfGkwK47owmy0Br/srM+6O+6PaWuY6fedNhh1A23vxqVLYWiPmUJnvniGKkBJqR/7NtuHa+ynatcVo45yrbwAHWEFZ53kaejeTGkbncGTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZTsHu32M; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZTsHu32M" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420168; x=1778956168; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NhpvDIFF3RCGCMgFlua6GwCE5WabCIdXhqFSclRzhlI=; b=ZTsHu32MakuoMjSWefbwXDRjrm+BTmvTQE7vYZxuHJ+Hsjuxfm5JzL33 NDkc846/fKXYhXWF7lS/YEv/LRg57B9DUsPIkfXn30v1WPK2nd4Cwdv9a V5BoA+A7QYuBlf7xsx48eI+iSsQR27OMrEoTIDdb0jKAUMagxi7/FGoCS DO9POy+DRgph0fFTbErPTtKIrxCqPmbQVJgFV7uJFV3T/6YitaPIcP5Ux uSlTBKX7/NzYNmMWcQT1nM4PThbx/Gd1LV1L7MCx6D30w/6Y2Az3gqhWH c4z7f2gwQH7WbezZEmDWk+tqN7LxoA5cKDnhTXlS0gbEv4fn2f4Ul0ihM g==; X-CSE-ConnectionGUID: jflZxhgEQDGcAnj1TC75WQ== X-CSE-MsgGUID: iN/dxF/WSOm4Z3MDwLI0Ew== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328866" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328866" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:23 -0700 X-CSE-ConnectionGUID: Sn8H+58qRoiqv15RcJK9eg== X-CSE-MsgGUID: UTh6VnOpSGKQDwwaF8/Anw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802617" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:23 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , linux-alpha@vger.kernel.org Subject: [PATCH V3 10/16] alpha/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:47 -0700 Message-Id: <20250516182853.2610284-11-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: linux-alpha@vger.kernel.org --- arch/alpha/kernel/perf_event.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 1f0eb4f25c0f..a3eaab094ece 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c @@ -852,14 +852,9 @@ static void alpha_perf_event_irq_handler(unsigned long= la_ptr, alpha_perf_event_update(event, hwc, idx, alpha_pmu->pmc_max_period[idx]+1= ); perf_sample_data_init(&data, 0, hwc->last_period); =20 - if (alpha_perf_event_set_period(event, hwc, idx)) { - if (perf_event_overflow(event, &data, regs)) { - /* Interrupts coming too quickly; "throttle" the - * counter, i.e., disable it for a little while. - */ - alpha_pmu_stop(event, 0); - } - } + if (alpha_perf_event_set_period(event, hwc, idx)) + perf_event_overflow(event, &data, regs); + wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); =20 return; --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B3A9280039; Fri, 16 May 2025 18:29:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420170; cv=none; b=iYRylZ54x93FKpWeoPkRM6fjd+xCAlRyvDe6Yls+I5Z7JGCYVcO2EKeM9IjOkex7nJ0FkxZEh/P+oI9pa1l6XtNmIhkNjOYMzvKVWrQyZmEsuVd2h9CMTcbcH8x/jqGF12kPt91izvRKYvGdDnMwS9zs/ubVzib/jiHU/IrY81A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420170; c=relaxed/simple; bh=F4Te9Lur/xFSTBMdpmhCbCj26jVQpoawEm3xShr4VJE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=us4gSFHKNk6bR7zeSVB8NPJSnb6d9a8755ue7IJ5q2HV5uF8Mcakcm1pHpgK260xkgkSB9VHH/SNPcL5x/Drp5SnyZ/A8mhrp355a098SC1yDtSjivBysVF0MHB8SbwVDxnCU9BUqqjI3ChWqSwcgZfoVJUbxxO76HLFlttxR58= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hXFpkhA0; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hXFpkhA0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420168; x=1778956168; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F4Te9Lur/xFSTBMdpmhCbCj26jVQpoawEm3xShr4VJE=; b=hXFpkhA0hlRzIM3NXe/XNc2YowFRz+qiRQbV1jG+/I9PJ1xxConSDkJ2 8ZLNIOgVdGAcM9HxGCAkC+2r/Oy4hnxlVOOW9dZakgBnshRVCHemMzLjO K+1Fd5Y7FjsSN0OMvjib3tlJZUEyiPGzJQw8CD5r0xOyvs+4qfJ+V+7Y/ C9GwdOAXjyOw5ZJKv1XGGdO5oIMWuDRGnF+c6MSeBkiQA8mpKQ6jD9ebj NCopKABNOwDOoOULKleXd0qK+1R/EdiQqVO/RppnshuGyEQvBQf1KOvLU z3cvPDSbVoXD9I8X8a4Lw8vxpvX4rp1ZiQnbVienRbNPxw6gpbsWEU/c6 g==; X-CSE-ConnectionGUID: N0alcjjMRlC3y+h/xNEgiQ== X-CSE-MsgGUID: jg5YishDSCW6ba2UBcsi7Q== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328874" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328874" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:24 -0700 X-CSE-ConnectionGUID: UBs/ihSUS9CKF92ke3GkYA== X-CSE-MsgGUID: jZ7zldPVSQqDVnoqwuidxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802618" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:23 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Vineet Gupta , linux-snps-arc@lists.infradead.org Subject: [PATCH V3 11/16] arc/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:48 -0700 Message-Id: <20250516182853.2610284-12-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Acked-by: Vineet Gupta --- arch/arc/kernel/perf_event.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index 6e5a651cd75c..ed6d4f0cd621 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c @@ -599,10 +599,8 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) =20 arc_perf_event_update(event, &event->hw, event->hw.idx); perf_sample_data_init(&data, 0, hwc->last_period); - if (arc_pmu_event_set_period(event)) { - if (perf_event_overflow(event, &data, regs)) - arc_pmu_stop(event, 0); - } + if (arc_pmu_event_set_period(event)) + perf_event_overflow(event, &data, regs); =20 active_ints &=3D ~BIT(idx); } while (active_ints); --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E867A27AC4D; Fri, 16 May 2025 18:29:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420171; cv=none; b=dEo/lb45YDKj/cE46BtycnaX1aoZ+Tl1J3TwqEAXhwB3A8dlmAh5ZuyLwS4dGTQgcQoOBfyB5k0ZJkDc2Y4I671VcU/8FZa+M8T7lKgn5J29gTbEdYwwEaKNM48vshKSYJdbMjvGLzD/D+SiLHlQ53QWMBUgM6SKCri5WkvGh8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420171; c=relaxed/simple; bh=rrfPQWQxUpl+1TbJT7SuB/unJ120m8U+rV6GjI5dzKk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sumlo0PW3LyZVohNJPK0PRqCS4e3Jg15LklScmB/HrdRfqzRbrp2GSHqTmAbX3N8HMmwZNr47YA0dUeNuRyJ87jkTJuoDaRB+QhRaJkGYq39K8UmZwpjLxRMR6aiGRyn9waaeHKVmpVgZMNcWly1BjswisIy5q98/2RvbMZVbz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YGJ5sR8w; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YGJ5sR8w" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420169; x=1778956169; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rrfPQWQxUpl+1TbJT7SuB/unJ120m8U+rV6GjI5dzKk=; b=YGJ5sR8wF/UzJ9iCWR9ltnypemNTkBkqJ9FBfCzsAIMC5uNTdZ+qk3Yd t0gkqH37tXsdY2XFK0ox8SKDSSrUw1tbS6Ws7k5aua3yCdkyKcqtnWS3h 7fJDDh5gsW/2ob8K8kBe2HsD4F5EEoY4kSRjctuSlniXZpS0t1x8jBZXG IM7RK0VrIg+BcfNRmG/BEc749Vbt/Iwv6CHBDZFusCBQvu81TtaEUAlkZ ccJoEPFsLjCEygUa2hS8IxtbtBBPpcJDYx89/LIn1QHbYq5ten93+xTI/ UwqnpZApEIjAfLcHCN7tBFDMZYjCuVpvediph3NG7RqTOqGEZHE9018bz g==; X-CSE-ConnectionGUID: Kd8ALGHrTZWLRwyh095PCw== X-CSE-MsgGUID: EapHDjHVTZq6peo+QpUNBQ== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328884" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328884" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:24 -0700 X-CSE-ConnectionGUID: b9INNUNXTxm5M/F446xQug== X-CSE-MsgGUID: HTzrRv8lTLa9qlfqYLfWLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802619" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:24 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Guo Ren , Mao Han , Guo Ren , linux-csky@vger.kernel.org Subject: [PATCH V3 12/16] csky/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:49 -0700 Message-Id: <20250516182853.2610284-13-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Acked-by: Guo Ren Signed-off-by: Kan Liang Cc: Mao Han Cc: Guo Ren Cc: linux-csky@vger.kernel.org --- arch/csky/kernel/perf_event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index e5f18420ce64..e0a36acd265b 100644 --- a/arch/csky/kernel/perf_event.c +++ b/arch/csky/kernel/perf_event.c @@ -1139,8 +1139,7 @@ static irqreturn_t csky_pmu_handle_irq(int irq_num, v= oid *dev) perf_sample_data_init(&data, 0, hwc->last_period); csky_pmu_event_set_period(event); =20 - if (perf_event_overflow(event, &data, regs)) - csky_pmu_stop_event(event); + perf_event_overflow(event, &data, regs); } =20 csky_pmu_enable(&csky_pmu.pmu); --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8DFD280A2E; Fri, 16 May 2025 18:29:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420171; cv=none; b=tnvUzM0TmCz5JF/p+g59WFJ0QaMbI0wC6OrEl1KhkhtlaBoCdwWMLeaiL9C983VlBq0xcrDLmly5QjMDN/3BVU3zPCI0j35Xyoe2VwDGQAB6Vp63ieHYSH1CiOxkcoUNXYGUAxF+omnyt7m96u1efkQvx1ITPBl7NjPDz4t0kqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420171; c=relaxed/simple; bh=dbXx+MD2QCNjSXPlgp390XJDfrTSi22QXjpUAVmjpNs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lo6yS67T+iYxZGtHl8N6+VRG8p4X3G020F5sKHkbjqiJM6S+i4YVdTvKhVNiZT/jufsZ7aJw+EoT/x7CsF8JYNP9EYMN2O2mj2vCMgvSuUW4zBsnE+aSmoCCg5dZJqlcRtGRCRl9dALv1J6fK2XjQTzZrHngjJV1ClsRAEKcGLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SYfNRJW1; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SYfNRJW1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420170; x=1778956170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dbXx+MD2QCNjSXPlgp390XJDfrTSi22QXjpUAVmjpNs=; b=SYfNRJW1aYriORB6kuTI/9NibzAJHMNX1TD/o1ZxSqjcGnAnX+O939su TrDcBSQFdZ4qqrzaXC8L974NpV4MIWPCC6qTR1pJtrfR7rG+tyuro7pG+ aphCNFtPej02BSlx7AZAsRX8GTa/1jfMgHjSicSIgyH/qvB2dGACOPKKd Vrj1iN6Mfat64MuO5w97Iy5OfyQC48dyaTweFbBPlrmKFaMGj0ibB7cH0 JElVuJ/mBMDV7dQdjWbrYv4oBvo+7B1E2gixnp4QJklmNknpgF07wlxJa 4/lp01fK3FHPFV2eEJr/Vcks8wanW1PZwDMQG8zWPmeAZO/y+LuxXfRp3 w==; X-CSE-ConnectionGUID: p1PG1uWhQEKJL4W9o1syvw== X-CSE-MsgGUID: KHOKhgQkRy+GXnF+c9+Caw== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328892" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328892" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:25 -0700 X-CSE-ConnectionGUID: 2mfqUfHSQ9WU4ftQ6Yo07Q== X-CSE-MsgGUID: HyEO6Qh3TJu/Eqdx6PeuxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802623" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:24 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Bibo Mao , Huacai Chen , loongarch@lists.linux.dev Subject: [PATCH V3 13/16] loongarch/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:50 -0700 Message-Id: <20250516182853.2610284-14-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: Bibo Mao Cc: Huacai Chen Cc: loongarch@lists.linux.dev --- arch/loongarch/kernel/perf_event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/loongarch/kernel/perf_event.c b/arch/loongarch/kernel/per= f_event.c index f86a4b838dd7..8ad098703488 100644 --- a/arch/loongarch/kernel/perf_event.c +++ b/arch/loongarch/kernel/perf_event.c @@ -479,8 +479,7 @@ static void handle_associated_event(struct cpu_hw_event= s *cpuc, int idx, if (!loongarch_pmu_event_set_period(event, hwc, idx)) return; =20 - if (perf_event_overflow(event, data, regs)) - loongarch_pmu_disable_event(idx); + perf_event_overflow(event, data, regs); } =20 static irqreturn_t pmu_handle_irq(int irq, void *dev) --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53B1E280CC9; Fri, 16 May 2025 18:29:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420172; cv=none; b=AVNN1bNt9eqTX3u3hehYpXTt49iwpxsc1T+OdEqlTJfpR87GSxPaJswSUORBMgogWSLg1zCn53Pd4z9PGlNTk547voTNFw/S8GOWRbNnKH85Drgr747yuia4je676rrhkjhK2zmqr9baqST1oclC7tirJXbHcNu0h4+sxBecW0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420172; c=relaxed/simple; bh=+LerS4ypY2xtEwvIwpQb+1sereJGijuBSIcL0NVDkSQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pSqHs8W5zZXEf7XWexfu/3aT6ob56O/E9cLaZYsPouxA88ZHJJqHhx1YXTnjAbMnrzHUjn8zf7dfEcG7hlQNkmdl1PuTW5+Yhp4ux9tfWFbKE64zsNhyemqRb8aBZ741ROMnmtuXSsBngSWdBhye00SgB7rh0672a7XYHmiAq+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Bkx4cxBv; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Bkx4cxBv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420170; x=1778956170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+LerS4ypY2xtEwvIwpQb+1sereJGijuBSIcL0NVDkSQ=; b=Bkx4cxBvhzsiV7eeXNQoDcycvGoagaR/N+PTLZIrb8vlFTfOATUyxdeN rgbSfRohCPCMXOspwwhxR818FWVSOgNIgza0SNu6e1ib1gvrTrSOBQlfN oFIRfs/mdH4GQ6TpYVmMv4Op/p51OytoVIQdgowQK5E1VV8iw3qvoCK1M ntZTsPsbZj43y9nqmrE2KwfGm+IGQfHq4Xunp1xerfE2PktAXbnOw4eYJ pQoAkTleEHs0V+Iw6ib1STBM8pRi+dHK3W7Gpkwp0TXtBxjqFp4+Z4slf ixlEyts7DFUEf5CjOA+IloIMMd/yOS8yVSaKq9HpesdXzJrsPnZivBL61 Q==; X-CSE-ConnectionGUID: hLumWh4FQAalSkvXHv4Rmg== X-CSE-MsgGUID: nic3fV/1R+qsvEId3Mz1kw== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328903" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328903" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:25 -0700 X-CSE-ConnectionGUID: 8iG35NzeRb+9isGxoDwI7w== X-CSE-MsgGUID: y2Qoh7c9QyK8MUp/LBJhww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802625" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:25 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , "David S . Miller" , sparclinux@vger.kernel.org Subject: [PATCH V3 14/16] sparc/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:51 -0700 Message-Id: <20250516182853.2610284-15-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: David S. Miller Cc: sparclinux@vger.kernel.org --- arch/sparc/kernel/perf_event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index f02a283a8e8f..cae4d33002a5 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c @@ -1668,8 +1668,7 @@ static int __kprobes perf_event_nmi_handler(struct no= tifier_block *self, if (!sparc_perf_event_set_period(event, hwc, idx)) continue; =20 - if (perf_event_overflow(event, &data, regs)) - sparc_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 finish_clock =3D sched_clock(); --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F24D281357; Fri, 16 May 2025 18:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420173; cv=none; b=HOkMNhPwkkz6yq9iAnLK4kN/bBFIL7/V5Ws58+g6LcbKcTyxCYh9o6LvWhxmv6NX37Tlk7SI6HlKZNyLVSDEDqkodeBNP1J7JzlrKKG9mrvAOL+XWMS8zYe3ssgt+8otXSozq5Ui4IUF9d9amS5GNkvkGBI4iZcD3kpoOoCpI18= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420173; c=relaxed/simple; bh=NOF3NytMVQIJq/xAjPCxlMah7ql+VhgMWECiQmo4kho=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pHYenEbQCBBwbh3Mvo8JQtNgYJh4480TVxmkMm7XVCrElzO2VvCNAg51bZkS3We6akgC9tMfwPT/YD941PZafbw+gOO9BaxYfB0I8AduRluuksMolAQDpWUjsp0DUSh4/7+2wyU9IVe+0szxerxEG2nBSw/yCnXjM6+jxlZW/7A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=efgOvHrO; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="efgOvHrO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420171; x=1778956171; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NOF3NytMVQIJq/xAjPCxlMah7ql+VhgMWECiQmo4kho=; b=efgOvHrOBKrR7+oXEx/FxLh01T1US29sY0EsNQOt5rcxIvw0k5r/pnZx IZx9qTUqqwZ+g8jIKnFZbR2S+Qn4FJVn2vB4cBNbI58bYEYdjjYOBLRCl 6g0shnws3nmp8Zib2NNy5svCRc0AZWkj5ssSXXBS1S+qaXTIe5hFnHUOS fvwoybtFtz/iig0PWglJh8xUBgZafK/leCnCxGSHhn8sjjK1T5CdoKR+v iTPHGCyGJoyGx/cD1Zg+P2k9QGcDfx9J+BxV4quWsIlEk08mSchSVui04 XtGojNos7BSFzuQ4uUXhsexQqb7nxSMX16MZgN7QrjiWyYgs1Xuf3WER3 g==; X-CSE-ConnectionGUID: oInPfugZTjaBzrioztxFcw== X-CSE-MsgGUID: PDhVRxpuRQG7qvLHmXf/Wg== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328911" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328911" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:25 -0700 X-CSE-ConnectionGUID: x2noIWp5S3K8I9LViob1CA== X-CSE-MsgGUID: kBEGDkyFR6uJrDXQsAnDpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802626" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:25 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Max Filippov Subject: [PATCH V3 15/16] xtensa/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:52 -0700 Message-Id: <20250516182853.2610284-16-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Reviewed-by: Max Filippov Signed-off-by: Kan Liang Cc: Max Filippov --- arch/xtensa/kernel/perf_event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/xtensa/kernel/perf_event.c b/arch/xtensa/kernel/perf_even= t.c index 183618090d05..223f1d452310 100644 --- a/arch/xtensa/kernel/perf_event.c +++ b/arch/xtensa/kernel/perf_event.c @@ -388,8 +388,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_i= d) struct pt_regs *regs =3D get_irq_regs(); =20 perf_sample_data_init(&data, 0, last_period); - if (perf_event_overflow(event, &data, regs)) - xtensa_pmu_stop(event, 0); + perf_event_overflow(event, &data, regs); } =20 rc =3D IRQ_HANDLED; --=20 2.38.1 From nobody Fri Dec 19 18:58:14 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB62728137A; Fri, 16 May 2025 18:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420173; cv=none; b=rpEjHbIqHC32+Obq0YCsVwbTfnXlox9Is2oZLuEaLNQr3ySZfarQlWcfYtv/Z3Fo1wbfVqBr9eN5ihG8Y40vqY5R+gnWBoQacII9TsBCSdteJAhVLWoPCJda3upb386n6Do+WqfbRd57tAiicB/1h7Xzgr1ZF7NUV1IhHkggdRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747420173; c=relaxed/simple; bh=W83BuCBEGVgUrqk/CNpFhmFYGiaT4zNHiSxidabkeh4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Lwz5aJa1grgz+6OXt1jN7tuQsGz2FA/6kyeFuGwNA2gCTRlM0sW46XVMN+XuMOA0Ms9jEgA9c0OxXuMsAPgxyrEdf0bcvl0cNjGUUqHsKuMfKq0BiVU8bGh2av7aujo6FJ9/eJL5wfGnEc4ORO52kAGzvBwtFmYf0F87LGXDLuQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Zzyadty/; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Zzyadty/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747420172; x=1778956172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W83BuCBEGVgUrqk/CNpFhmFYGiaT4zNHiSxidabkeh4=; b=Zzyadty/ag4goQKn25udEESyhwObFVCJA07RNE+J+7syeJZUeN7ieMkt 6+Gm/dErxEe9uy2Jzu38t4JO6g/U3spRW2WnRj1herevMbRZoIgg+8XQY 1z+aploUOi5sUte431G9n5ybGI/ophh/tZxVsXhN2fbUzQyEmHM7JM4mb ftOIH/4uWfruqb2Jd7xRFxmCy0qlj+vZsU2zsY+yqPFgqTTAAa7/ZpC8B N2De6C7f1hf/xy6FGA8LArNbHFZuMRYgLcukuD285JuYn8NjaVGf2fwzT I6IAbD1akN2rjwi/R5IYIrbWq9yUsjswhd0J0oQg7uYzBqS7eEX6Uw2/X A==; X-CSE-ConnectionGUID: Hm1TOsNEQuygO/raj41f1A== X-CSE-MsgGUID: dLIykaq/QKqhhkmKiYit/w== X-IronPort-AV: E=McAfee;i="6700,10204,11435"; a="49328919" X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="49328919" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2025 11:29:26 -0700 X-CSE-ConnectionGUID: 45kEMhpORqi9xmyQRIxyyg== X-CSE-MsgGUID: u0tF4969TS+ewt2PfEmthQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,294,1739865600"; d="scan'208";a="169802628" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by fmviesa001.fm.intel.com with ESMTP; 16 May 2025 11:29:25 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, irogers@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com, leo.yan@arm.com, Kan Liang , Thomas Bogendoerfer , linux-mips@vger.kernel.org Subject: [PATCH V3 16/16] mips/perf: Remove driver-specific throttle support Date: Fri, 16 May 2025 11:28:53 -0700 Message-Id: <20250516182853.2610284-17-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250516182853.2610284-1-kan.liang@linux.intel.com> References: <20250516182853.2610284-1-kan.liang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kan Liang The throttle support has been added in the generic code. Remove the driver-specific throttle support. Besides the throttle, perf_event_overflow may return true because of event_limit. It already does an inatomic event disable. The pmu->stop is not required either. Signed-off-by: Kan Liang Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org --- arch/mips/kernel/perf_event_mipsxx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_e= vent_mipsxx.c index c4d6b09136b1..196a070349b0 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c @@ -791,8 +791,7 @@ static void handle_associated_event(struct cpu_hw_event= s *cpuc, if (!mipspmu_event_set_period(event, hwc, idx)) return; =20 - if (perf_event_overflow(event, data, regs)) - mipsxx_pmu_disable_event(idx); + perf_event_overflow(event, data, regs); } =20 =20 --=20 2.38.1