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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 CF49DC388F7 for ; Tue, 3 Nov 2020 21:45:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BB3520786 for ; Tue, 3 Nov 2020 21:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604439933; bh=RAJY/o5wLsTD7a8m2ah2SQ32/iyA/FEWJLhEtrirAw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kx5oW3/rKzxhcpb5EyOg2dLzRgsxO5bPkTgSUvco4p5Z70vCxcul/DpEGuDrxE1Wz nqylAvd4jNGx4tuwkV+lHQHYgaw4oGE5JZXAQFzm/89oluUdZwSKmGYxbLNhy9nBBS aJIi57WdvwFZ9XFoMKrqBChadPsecd7DcEHd98sA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732299AbgKCVpc (ORCPT ); Tue, 3 Nov 2020 16:45:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:50230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732182AbgKCUwz (ORCPT ); Tue, 3 Nov 2020 15:52:55 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A203A2053B; Tue, 3 Nov 2020 20:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436775; bh=RAJY/o5wLsTD7a8m2ah2SQ32/iyA/FEWJLhEtrirAw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ndh8Tm4cDj6mgGzcKGAfxKQddumQxXQGcb0wPRxmsUQ4Prkg3OF+8Ybn/4TFx91XB D2gvRikRajjVDQVGXqRcuzCaImmUrjhcXgyNMeB1VBoodjanq8qY4iec7MWiASA58O FBQE+0IbuNqxXy5c61pZjuSGd5vocrOacpwe2G/E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quanyang Wang , Thomas Gleixner , "Peter Zijlstra (Intel)" Subject: [PATCH 5.9 390/391] time/sched_clock: Mark sched_clock_read_begin/retry() as notrace Date: Tue, 3 Nov 2020 21:37:21 +0100 Message-Id: <20201103203413.480694586@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203348.153465465@linuxfoundation.org> References: <20201103203348.153465465@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quanyang Wang commit 4cd2bb12981165f865d2b8ed92b446b52310ef74 upstream. Since sched_clock_read_begin() and sched_clock_read_retry() are called by notrace function sched_clock(), they shouldn't be traceable either, or else ftrace_graph_caller will run into a dead loop on the path as below (arm for instance): ftrace_graph_caller() prepare_ftrace_return() function_graph_enter() ftrace_push_return_trace() trace_clock_local() sched_clock() sched_clock_read_begin/retry() Fixes: 1b86abc1c645 ("sched_clock: Expose struct clock_read_data") Signed-off-by: Quanyang Wang Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200929082027.16787-1-quanyang.wang@windriver.com Signed-off-by: Greg Kroah-Hartman --- kernel/time/sched_clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -68,13 +68,13 @@ static inline u64 notrace cyc_to_ns(u64 return (cyc * mult) >> shift; } -struct clock_read_data *sched_clock_read_begin(unsigned int *seq) +notrace struct clock_read_data *sched_clock_read_begin(unsigned int *seq) { *seq = raw_read_seqcount_latch(&cd.seq); return cd.read_data + (*seq & 1); } -int sched_clock_read_retry(unsigned int seq) +notrace int sched_clock_read_retry(unsigned int seq) { return read_seqcount_retry(&cd.seq, seq); }