From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2851BC34047 for ; Wed, 19 Feb 2020 15:15:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E75FC24671 for ; Wed, 19 Feb 2020 15:15:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dAee2viG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbgBSPO7 (ORCPT ); Wed, 19 Feb 2020 10:14:59 -0500 Received: from merlin.infradead.org ([205.233.59.134]:52030 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbgBSPOh (ORCPT ); Wed, 19 Feb 2020 10:14:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=MtLsQLaXADO+AZHxVktK/gN+oXBYn0ymRHkx9dI1F3k=; b=dAee2viGKUPinOkHIrCwCqm7B3 v38yVsk3EWRFafzTrq43mIqvG+K9i6ORzJSM5SP/Fu2ZwcbY/groEWWJEZjNtoC6cqZYJX+m61FMC bltilBVE4iY4I8+k3IgR3+D6nWql/3YNNfS38GBRCQWi6/Hvzq63gJI5PvVOlIv9LuA4cPDHwsxEd 56cvdOmhWecrj/37sXyIMIUalKseh6sbWtLanm5t+bGaYXfdo31wpRv0NFtoe+hvLUDDA/oXpWcjS NkLeiOXozKRX03zbiZKXSJlDv6fImndVzG2eX8jqGoSdP1bwH1vuNHCI2hbDN5ESPw0nifodYRWeZ fPUfsqgw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4R39-0007fM-Nc; Wed, 19 Feb 2020 15:14:07 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EFAD23077E0; Wed, 19 Feb 2020 16:12:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 8BEC32B4D7B82; Wed, 19 Feb 2020 16:14:03 +0100 (CET) Message-Id: <20200219150745.003368327@infradead.org> User-Agent: quilt/0.65 Date: Wed, 19 Feb 2020 15:47:35 +0100 From: Peter Zijlstra To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, rostedt@goodmis.org Cc: peterz@infradead.org, mingo@kernel.org, joel@joelfernandes.org, gregkh@linuxfoundation.org, gustavo@embeddedor.com, tglx@linutronix.de, paulmck@kernel.org, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, luto@kernel.org, tony.luck@intel.com, frederic@kernel.org, dan.carpenter@oracle.com, mhiramat@kernel.org, "Steven Rostedt (VMware)" Subject: [PATCH v3 11/22] perf,tracing: Prepare the perf-trace interface for RCU changes References: <20200219144724.800607165@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The tracepoint interface will stop providing regular RCU context; make sure we do it ourselves, since perf makes use of regular RCU protected data. Suggested-by: Steven Rostedt (VMware) Suggested-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) --- kernel/events/core.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -8950,6 +8950,7 @@ void perf_tp_event(u16 event_type, u64 c { struct perf_sample_data data; struct perf_event *event; + unsigned long rcu_flags; struct perf_raw_record raw = { .frag = { @@ -8961,6 +8962,8 @@ void perf_tp_event(u16 event_type, u64 c perf_sample_data_init(&data, 0, 0); data.raw = &raw; + rcu_flags = trace_rcu_enter(); + perf_trace_buf_update(record, event_type); hlist_for_each_entry_rcu(event, head, hlist_entry) { @@ -8996,6 +8999,8 @@ void perf_tp_event(u16 event_type, u64 c } perf_swevent_put_recursion_context(rctx); + + trace_rcu_exit(rcu_flags); } EXPORT_SYMBOL_GPL(perf_tp_event);