Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp544658rwe; Wed, 24 Aug 2022 05:31:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR77WpLVz/2Vu8tQ2qddzUdGGbNfwFYyV96SSrwbxeo+cMAXUHnNXkz0YTSTffCycdu6jXJ5 X-Received: by 2002:a17:90b:4f4e:b0:1f5:8a65:9192 with SMTP id pj14-20020a17090b4f4e00b001f58a659192mr7959666pjb.224.1661344299401; Wed, 24 Aug 2022 05:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661344299; cv=none; d=google.com; s=arc-20160816; b=crNBoO/lu1lgwit+7SnxMC7fM7mT7UX15Qd/2OYc7mvNA8f6A9EtaaknYOqgYNYR8m IuvfTghgnbAHmMv4wPm9FFGjGjhr/DgG5khqx7uDXaAjqvX4655sSLX8dt6L4SjuQLyh a8LD5QHadMpY7nu+FsVvEM9wS+nBLq7DNE8cQqlD8OV5l7+zrbQ8bnD8t+lPqg/HJaIN jMU75dt8iBSLN42p48SSR3nQGQj+c3TM76y/PGAkKNMm7xMufHOzKGVZnh4YvNEA9zN5 BNLPl1NFWvcxMLyc+Vvto/4Oe8scydCmkfAa1Jsrko5jDQB47/aVhqIhG5/uUHa0U+W3 oKaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e8nBv61PbcSsA9fWy+AThJ1QLoUmiWCYPfn45AeR6QE=; b=LGBYhgt1S6UoaNBPlvE1e5C2bIArwmmBtqm8B1EhxE/FvwhzUQJ5DKP3Rsfu4kaSqS KOxzAk8rPP0DDz903FN8ezX21momc9U3yw8DHhuH1wzjKf1iI4D/Zx4um4MINZft5Wlz YOEe74jMXZy+4aSZBTDv8oo7DtePpH6T/+OIeSTocJzpuid0iXJB4dvsaUG7AkQdMyPR Lj+9XsM+DNeteYyhRo4GntaULhUcStVr3LUS+2KpEJBWS1v42dy2WsMt8lcK4EI0cJB4 0SZX42Q2IL2iIUgc/AQFsRmlOsOH6bX2mkJyIWSbGOlkuR4kgsM8Tza2bxQr3OTk/cB9 TyRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="dPqukcO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a631043000000b0041c26691e57si12506501pgq.725.2022.08.24.05.31.27; Wed, 24 Aug 2022 05:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="dPqukcO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236921AbiHXMQI (ORCPT + 99 others); Wed, 24 Aug 2022 08:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237255AbiHXMQB (ORCPT ); Wed, 24 Aug 2022 08:16:01 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7037A6BD69 for ; Wed, 24 Aug 2022 05:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=e8nBv61PbcSsA9fWy+AThJ1QLoUmiWCYPfn45AeR6QE=; b=dPqukcO/lafAYDyLMVm1h82LSV wY1poJqdnEe8hnwXo+nlITwiA3ztJXSelBWCrj7t8LBs7FeHKnRBRyZ8gqo8NZXcbo3sDbOC9yZij ar1ofZwJ+aRdGlhFJKr2WlM/fCzbLMArr2eQMHzZm1YBmoIPE20uwUtLBU8f9xZMhMlHj0ocbhl58 Pkhlrq0PNZYRZFLCmKiDIA8E50GKQOPniY0KcPDDA0ycuINLYlX1JavMZIrDwb30iRK6mMexR0zXV +ax+pLfo3Mhm0arC4m1H4RSK+m3UjTL8tz8E9jdFj3jpNwTIUvPZgojCTFsnUZaSo/V/FxUKmszmf elnHAq1Q==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQpHw-00GJ8j-Ds; Wed, 24 Aug 2022 12:15:16 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id B3983980BE2; Wed, 24 Aug 2022 14:15:13 +0200 (CEST) Date: Wed, 24 Aug 2022 14:15:13 +0200 From: Peter Zijlstra To: Ravi Bangoria Cc: acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, songliubraving@fb.com, eranian@google.com, alexey.budankov@linux.intel.com, ak@linux.intel.com, mark.rutland@arm.com, megha.dey@intel.com, frederic@kernel.org, maddy@linux.ibm.com, irogers@google.com, kim.phillips@amd.com, linux-kernel@vger.kernel.org, santosh.shukla@amd.com Subject: Re: [RFC v2] perf: Rewrite core context handling Message-ID: References: <20220113134743.1292-1-ravi.bangoria@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2022 at 04:35:11PM +0200, Peter Zijlstra wrote: > void x86_pmu_update_cpu_context(struct pmu *pmu, int cpu) > { > - struct perf_cpu_context *cpuctx; > + /* XXX: Don't need this quirk anymore */ > + /*struct perf_cpu_context *cpuctx; > > if (!pmu->pmu_cpu_context) > return; > > cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu); > - cpuctx->ctx.pmu = pmu; > + cpuctx->ctx.pmu = pmu;*/ > } Confirmed; my ADL seems to work fine without all that. --- diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index fd043cd0e3c9..7a2d12ad6d1f 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2059,24 +2059,6 @@ void x86_pmu_show_pmu_cap(int num_counters, int num_counters_fixed, pr_info("... event mask: %016Lx\n", intel_ctrl); } -/* - * The generic code is not hybrid friendly. The hybrid_pmu->pmu - * of the first registered PMU is unconditionally assigned to - * each possible cpuctx->ctx.pmu. - * Update the correct hybrid PMU to the cpuctx->ctx.pmu. - */ -void x86_pmu_update_cpu_context(struct pmu *pmu, int cpu) -{ - /* XXX: Don't need this quirk anymore */ - /*struct perf_cpu_context *cpuctx; - - if (!pmu->pmu_cpu_context) - return; - - cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu); - cpuctx->ctx.pmu = pmu;*/ -} - static int __init init_hw_perf_events(void) { struct x86_pmu_quirk *quirk; @@ -2197,9 +2179,6 @@ static int __init init_hw_perf_events(void) (hybrid_pmu->cpu_type == hybrid_big) ? PERF_TYPE_RAW : -1); if (err) break; - - if (cpu_type == hybrid_pmu->cpu_type) - x86_pmu_update_cpu_context(&hybrid_pmu->pmu, raw_smp_processor_id()); } if (i < x86_pmu.num_hybrid_pmus) { diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 8a72e6fe27a5..768771e5e4e9 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4508,8 +4508,6 @@ static bool init_hybrid_pmu(int cpu) cpumask_set_cpu(cpu, &pmu->supported_cpus); cpuc->pmu = &pmu->pmu; - x86_pmu_update_cpu_context(&pmu->pmu, cpu); - return true; } diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index 94fb65d7b291..9c835ecb232e 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -1175,8 +1175,6 @@ int x86_pmu_handle_irq(struct pt_regs *regs); void x86_pmu_show_pmu_cap(int num_counters, int num_counters_fixed, u64 intel_ctrl); -void x86_pmu_update_cpu_context(struct pmu *pmu, int cpu); - extern struct event_constraint emptyconstraint; extern struct event_constraint unconstrained;