Skip to content

Commit 4cd2bb1

Browse files
wqyoungKAGA-KOKO
authored andcommitted
time/sched_clock: Mark sched_clock_read_begin/retry() as notrace
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: 1b86abc ("sched_clock: Expose struct clock_read_data") Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200929082027.16787-1-quanyang.wang@windriver.com
1 parent 3650b22 commit 4cd2bb1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/time/sched_clock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
6868
return (cyc * mult) >> shift;
6969
}
7070

71-
struct clock_read_data *sched_clock_read_begin(unsigned int *seq)
71+
notrace struct clock_read_data *sched_clock_read_begin(unsigned int *seq)
7272
{
7373
*seq = raw_read_seqcount_latch(&cd.seq);
7474
return cd.read_data + (*seq & 1);
7575
}
7676

77-
int sched_clock_read_retry(unsigned int seq)
77+
notrace int sched_clock_read_retry(unsigned int seq)
7878
{
7979
return read_seqcount_latch_retry(&cd.seq, seq);
8080
}

0 commit comments

Comments
 (0)