Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2701765iob; Mon, 16 May 2022 04:29:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU0DcQHrd0PWHbKuk2wgMza9uAYuYUKHMafWwuZtwsp/mr9/2zEXxvE0bNXqGGxD7pX1Fy X-Received: by 2002:aa7:dcc1:0:b0:427:e1ae:d822 with SMTP id w1-20020aa7dcc1000000b00427e1aed822mr12718460edu.353.1652700547369; Mon, 16 May 2022 04:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652700547; cv=none; d=google.com; s=arc-20160816; b=Ezem+u4+M31etDLkS44dh0d2tzTHuTIvwQerprOrg37k8MLT9vRf+9pVuiPwcov0Ng Ayaa61WgzTvEjpfvtgy2yj4Wi/c3ov15UsxJUVvKACv8gnYTPctIEIvvd3TPFStRNVy6 dBU6w6kY0losA/H/3WcHmIDflnAgNBrRFl/s5uLMqNoe1OwFbBaszrBkBTGjc/qYdqp7 3s2T1ndIFbPvJ4iITBpIzrZpYawmsHgOZ6WScTNqrH+VIxvkQxLfFsyUrXCnhlQEVrGY gV4vXzk+DOV4idzH8t7Wm0bkAbocv0YZh1G14hLBerygE4klA+WmbTPU8sD2yVNUNccr G3YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Te9ScvBOoMX9CEAJZ5SVcwvViti6J0N+jxfcmen7pg0=; b=Fe8JpKmL+ACL7efOk5DKA1+YiEfJF1A+kWRi8KW6AfBxHcPmuguh7oUXIu3s0XWsAI sA3Hs7a0XhuO1c6HWPAutXQ/UYBZi087DtXMTJWOEJHNMiqzq++skMCWwDfHX0B8858w 3XBUz2FbOryyfzCXFg3L2RWhNR5aXiQfdTK7ePniLJNq9UihfRdkH/ENJqS7JzZQCz0d 21R0VCME/fotq3nEWjxogjYfNvUSdAoOtzyxShFXndGx/uem6GowOod9lnU7s5mstuMF Hag2tDPdYBOcbUoAa7OdN4pwnk2Gf6RDYd388IGf3pNdXs+QXT627DSb40kCIccQ5fh7 yiGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EQ3ICpYy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb11-20020a0564020d0b00b0042991a96ddesi11225734edb.603.2022.05.16.04.28.41; Mon, 16 May 2022 04:29:07 -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=@kernel.org header.s=k20201202 header.b=EQ3ICpYy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238636AbiEOUhN (ORCPT + 99 others); Sun, 15 May 2022 16:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbiEOUhF (ORCPT ); Sun, 15 May 2022 16:37:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEF211C31; Sun, 15 May 2022 13:37:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 16B5CB80E11; Sun, 15 May 2022 20:37:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38A05C385B8; Sun, 15 May 2022 20:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652647019; bh=GrCoDmkEGZhrFkRwhSQwfYPPWhwhCDYMWQ8Z6at6QAI=; h=From:To:Cc:Subject:Date:From; b=EQ3ICpYy6jfWgWmBpV4ItsGmja6AVNh1JNSf7Vb+tTCCYV3NO20oXIo5sQQ8lnBrQ 0Ww9D62uD8n/jh6QR+M86Nql6+e2twSa//3MkdaJDF3XfmAjdI5hhS9zBWWPeLOZTW dZImeLoqFQbBm8PBlG9TyTM1G0dQEN3L8KUrqD5mM5bq/U+pgwH7UllN/DriFHnWOl b1bghyhM9ZoKnWee1E9yTDOy5uEWMcmlk9ZPMR8VOYWlQqweU627zKXF/C0OOphqr5 LbWflqpT5UW1TOjEopiiUPHYQjQDuRDn9T00f29o2x/RYyZLIFey/a4TkGm/Fxlg1I cTDBRbTqfOJhg== From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , "Paul E. McKenney" Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt Subject: [PATCH bpf-next 1/2] cpuidle/rcu: Making arch_cpu_idle and rcu_idle_exit noinstr Date: Sun, 15 May 2022 22:36:52 +0200 Message-Id: <20220515203653.4039075-1-jolsa@kernel.org> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Making arch_cpu_idle and rcu_idle_exit noinstr. Both functions run in rcu 'not watching' context and if there's tracer attached to them, which uses rcu (e.g. kprobe multi interface) it will hit RCU warning like: [ 3.017540] WARNING: suspicious RCU usage ... [ 3.018363] kprobe_multi_link_handler+0x68/0x1c0 [ 3.018364] ? kprobe_multi_link_handler+0x3e/0x1c0 [ 3.018366] ? arch_cpu_idle_dead+0x10/0x10 [ 3.018367] ? arch_cpu_idle_dead+0x10/0x10 [ 3.018371] fprobe_handler.part.0+0xab/0x150 [ 3.018374] 0xffffffffa00080c8 [ 3.018393] ? arch_cpu_idle+0x5/0x10 [ 3.018398] arch_cpu_idle+0x5/0x10 [ 3.018399] default_idle_call+0x59/0x90 [ 3.018401] do_idle+0x1c3/0x1d0 The call path is following: default_idle_call rcu_idle_enter arch_cpu_idle rcu_idle_exit The arch_cpu_idle and rcu_idle_exit are the only ones from above path that are traceble and cause this problem on my setup. Signed-off-by: Jiri Olsa --- arch/x86/kernel/process.c | 2 +- kernel/rcu/tree.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b370767f5b19..1345cb0124a6 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -720,7 +720,7 @@ void arch_cpu_idle_dead(void) /* * Called from the generic idle code. */ -void arch_cpu_idle(void) +void noinstr arch_cpu_idle(void) { x86_idle(); } diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index a4b8189455d5..20d529722f51 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -896,7 +896,7 @@ static void noinstr rcu_eqs_exit(bool user) * If you add or remove a call to rcu_idle_exit(), be sure to test with * CONFIG_RCU_EQS_DEBUG=y. */ -void rcu_idle_exit(void) +void noinstr rcu_idle_exit(void) { unsigned long flags; -- 2.35.3