Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3234261pxb; Tue, 20 Apr 2021 03:51:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhB88WctAzUyOsmmZzcosQcvlLrh22/RfZ3e+kDumfNL1fSyvxqdkMWkM81jMKob3uZZA5 X-Received: by 2002:a17:906:c787:: with SMTP id cw7mr21152902ejb.157.1618915868861; Tue, 20 Apr 2021 03:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618915868; cv=none; d=google.com; s=arc-20160816; b=bjE8xp6WriYvXve+VvKEW/YhMFM3ICsB4e/fkUD9kZ6BT2yKJUBSrdOao0/E3Mv8n4 4IvF6HsrsGq+4m0c/TN12FSpdOe25OCf9XCreWwDFaAEbx/C3oMvrP8ZaziASJMGydr7 xG3SGyHSnm9O0JoyE0xpJc12MbCyiW8G6EQictz22HOg4wB7StaTI6qaLhcV6nOeQNO5 mt1RiGLN2EfVVad6nTofmtpF9AhovSuZjaSuHJjsAaIsqKFEeRCExappYxXuSnXuBFGA 8Rs0FGp/iZkEmDxE5WJW3bIaKKGKj/mHRyv0olzwdNY2mlAPBq0HnE48C9yUleV1xj+i op4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=86ocYL+cFiq2XEAwR2VApdH1KWaxEoRJ6aYjoKjFXog=; b=X5GfK6C8Ls89eAmVmw4q+46EjDprEJQymDXSJhoWiGI1pk6Z0fh4WywIZRx+onqo/F J7VU9wJg0giVyhfyAuHjn6yj8XPoRd1BEk60tIvWWXzyZecpPO6ZAFz4EgKpKWMmXo9l o3Dje2osVoXIwea++aDfT+5YDq5mqjgYklTa5xvpeP0Nhkda4VSftFiD13NsKXSD2m9Y OhF1TGS4PYhtIJp3RiYZfY6556llbd9OBHbPOjdsME3YYFn63V3d5pc+2Sb2XfyAJ+iq ApkDc3ZyLFhrRXbbGHDhYuZarwoWa8o7NCnTORbRvPrhD4e7DzOmrnEYfT5mf4vEYAsw kemA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gBcUhqmC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha1si7927644ejb.743.2021.04.20.03.50.45; Tue, 20 Apr 2021 03:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gBcUhqmC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231837AbhDTKrr (ORCPT + 99 others); Tue, 20 Apr 2021 06:47:47 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51708 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231673AbhDTKrR (ORCPT ); Tue, 20 Apr 2021 06:47:17 -0400 Date: Tue, 20 Apr 2021 10:46:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1618915605; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=86ocYL+cFiq2XEAwR2VApdH1KWaxEoRJ6aYjoKjFXog=; b=gBcUhqmCti5/5S6QYaNEzT2fQ7luR692EJkX6qwHngRY5NITBKk9UG7xb+AHdfINWnRejl 4yZnKmgRRatODK+jCLrRIx6xI7EkVjN7RUp127Wj1AEgDZPGzoL3MbJimcTlSBLkiKrlTY Dq0lG96oeh9SQ4z3QszyQfzsZ6bIVVnOMeoKuT3J2q9vRXMKMcMutJVKLNcNj5dYleseQ0 LJ2Gi9lg0wr1Jo2khjdrnlDefM8Cbnxp2pCy7GQi2TG4t3IB8+SwZzik562hyJlbhpk+ll f8XsAcXDUBn/TjnMFyP9RQeKA/Nt2Dy5c1IuFSpmBOsFpO4OM0B0xrVbg+/NcQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1618915605; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=86ocYL+cFiq2XEAwR2VApdH1KWaxEoRJ6aYjoKjFXog=; b=qduRoQGtYRwa3Dooh9S3qEaA8mHkxcYUpD0YzkcSMvKGkkwFuydMS/MHLVzSAETKNRFd2D t/LgquX8XdjSy3Bg== From: "tip-bot2 for Kan Liang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86: Remove temporary pmu assignment in event_init Cc: Kan Liang , "Peter Zijlstra (Intel)" , Andi Kleen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1618237865-33448-15-git-send-email-kan.liang@linux.intel.com> References: <1618237865-33448-15-git-send-email-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <161891560505.29796.6034093386968004555.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: b98567298bad891774054113690b30bd90d5738d Gitweb: https://git.kernel.org/tip/b98567298bad891774054113690b30bd90d5738d Author: Kan Liang AuthorDate: Mon, 12 Apr 2021 07:30:54 -07:00 Committer: Peter Zijlstra CommitterDate: Mon, 19 Apr 2021 20:03:27 +02:00 perf/x86: Remove temporary pmu assignment in event_init The temporary pmu assignment in event_init is unnecessary. The assignment was introduced by commit 8113070d6639 ("perf_events: Add fast-path to the rescheduling code"). At that time, event->pmu is not assigned yet when initializing an event. The assignment is required. However, from commit 7e5b2a01d2ca ("perf: provide PMU when initing events"), the event->pmu is provided before event_init is invoked. The temporary pmu assignment in event_init should be removed. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lkml.kernel.org/r/1618237865-33448-15-git-send-email-kan.liang@linux.intel.com --- arch/x86/events/core.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 57d3fe1..ed8dcfb 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2291,7 +2291,6 @@ out: static int x86_pmu_event_init(struct perf_event *event) { - struct pmu *tmp; int err; switch (event->attr.type) { @@ -2306,20 +2305,10 @@ static int x86_pmu_event_init(struct perf_event *event) err = __x86_pmu_event_init(event); if (!err) { - /* - * we temporarily connect event to its pmu - * such that validate_group() can classify - * it as an x86 event using is_x86_event() - */ - tmp = event->pmu; - event->pmu = &pmu; - if (event->group_leader != event) err = validate_group(event); else err = validate_event(event); - - event->pmu = tmp; } if (err) { if (event->destroy)