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=-9.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 036B7C4727F for ; Tue, 29 Sep 2020 12:24:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 740562075F for ; Tue, 29 Sep 2020 12:24:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZN5LjK5F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732524AbgI2MYG (ORCPT ); Tue, 29 Sep 2020 08:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729777AbgI2LfJ (ORCPT ); Tue, 29 Sep 2020 07:35:09 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20518C0613DF for ; Tue, 29 Sep 2020 04:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=DjU0La5QsoHHU3N/iP5NR7BNOKT7gs7FCGIaZPbhNwc=; b=ZN5LjK5F3woZOpGU9pQh/O2ve3 JWUzoZJgYu4GzSvyFV4D18VOaTMJ3ROWWJkCwtngwCfJoFeDFN4rPd9Z9yzy3L44HtX7+Jd86Ivh1 HEaMAOwjb33cJHF0IGOqdzvfAsFaFetyp8sVi1ys5NVI7VGmqrajlzzgovz4rtzfay7nDMgLkbtnq fJ18GtkTZNVEMGC8J8rL3skVJazmvD/xwQnBASZFMPamFaLpK4yBlmSxfX6RG29kMJoH/hUm5JbK2 OIwbbG0QTD0LbYNOMERsmkf5Y26/nchkZPEe9fosepwVCVpr4DOI2YpyGMRC/XsKyDKiaa9eSy7iY 08IFsEYg==; 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 1kNDtA-00020q-IP; Tue, 29 Sep 2020 11:33:44 +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 C97B23062BA; Tue, 29 Sep 2020 13:33:40 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 81EF6200D4C48; Tue, 29 Sep 2020 13:33:40 +0200 (CEST) Date: Tue, 29 Sep 2020 13:33:40 +0200 From: Peter Zijlstra To: Paul McKenney Cc: linux-kernel@vger.kernel.org, Steven Rostedt , Thomas Gleixner , Ingo Molnar , kim.phillips@amd.com Subject: [PATCH] rcu,ftrace: Fix ftrace recursion Message-ID: <20200929113340.GN2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kim reported that perf-ftrace made his box unhappy. It turns out that commit: ff5c4f5cad33 ("rcu/tree: Mark the idle relevant functions noinstr") removed one too many notrace. Probably due to there not being a helpful comment. Reinstate the notrace and add a comment to avoid loosing it again. Fixes: ff5c4f5cad33 ("rcu/tree: Mark the idle relevant functions noinstr") Reported-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) --- kernel/rcu/tree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index ee5e595501e8..33020d84ec6b 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1098,8 +1098,11 @@ noinstr bool __rcu_is_watching(void) * CPU can safely enter RCU read-side critical sections. In other words, * if the current CPU is not in its idle loop or is in an interrupt or * NMI handler, return true. + * + * Must be notrace because __ftrace_ops_list_func() / ftrace_ops_assist_func() + * will call this (for every function) outside of recursion protection. */ -bool rcu_is_watching(void) +notrace bool rcu_is_watching(void) { bool ret;