[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e8bd5814989b994cf1b0cb179e1c777e40c0f02c@git.kernel.org>
Date: Sun, 28 Apr 2019 23:39:03 -0700
From: tip-bot for Peter Zijlstra <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: ast@...nel.org, rostedt@...dmis.org, tim.c.chen@...ux.intel.com,
dave@...olabs.net, hpa@...or.com, peterz@...radead.org,
guro@...com, linux-kernel@...r.kernel.org, mingo@...nel.org,
tglx@...utronix.de, daniel@...earbox.net,
huang.ying.caritas@...il.com, will.deacon@....com,
longman@...hat.com, torvalds@...ux-foundation.org
Subject: [tip:sched/core] trace: Fix preempt_enable_no_resched() abuse
Commit-ID: e8bd5814989b994cf1b0cb179e1c777e40c0f02c
Gitweb: https://git.kernel.org/tip/e8bd5814989b994cf1b0cb179e1c777e40c0f02c
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Tue, 23 Apr 2019 22:03:18 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 29 Apr 2019 08:27:09 +0200
trace: Fix preempt_enable_no_resched() abuse
Unless there is a call into schedule() in the immediate
(deterministic) future, one must not use preempt_enable_no_resched().
It can cause a preemption to go missing and thereby cause arbitrary
delays, breaking the PREEMPT=y invariant.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Davidlohr Bueso <dave@...olabs.net>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Roman Gushchin <guro@...com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tim Chen <tim.c.chen@...ux.intel.com>
Cc: Waiman Long <longman@...hat.com>
Cc: Will Deacon <will.deacon@....com>
Cc: huang ying <huang.ying.caritas@...il.com>
Fixes: 2c2d7329d8af ("tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp()")
Link: https://lkml.kernel.org/r/20190423200318.GY14281@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/trace/ring_buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 41b6f96e5366..4ee8d8aa3d0f 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -762,7 +762,7 @@ u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu)
preempt_disable_notrace();
time = rb_time_stamp(buffer);
- preempt_enable_no_resched_notrace();
+ preempt_enable_notrace();
return time;
}
Powered by blists - more mailing lists