From: Peter Zijlstra <peterz@infradead.org>
To: lkp@lists.01.org
Subject: [PATCH] trace: Robustify wait loop
Date: Wed, 08 Oct 2014 18:51:10 +0200 [thread overview]
Message-ID: <20141008165110.GA14547@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20141008163657.GN10832@worktop.programming.kicks-ass.net>
[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]
On Wed, Oct 08, 2014 at 06:36:57PM +0200, Peter Zijlstra wrote:
>
> Right, I'll send the patch.
---
Subject: trace: Robustify wait loop
From: Peter Zijlstra (Intel) <peterz@infradead.org>
Date: Wed Oct 8 18:44:26 CEST 2014
The pending nested sleep debugging triggered on the potential stale
TASK_INTERRUPTIBLE in this code.
While there, fix the loop such that we won't revert to a while(1)
yield() 'spin' loop if we ever get a spurious wakeup.
And fix the actual issue by properly terminating the 'wait' loop by
setting TASK_RUNNING.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/trace/trace_events.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2513,8 +2513,11 @@ static __init int event_test_thread(void
kfree(test_malloc);
set_current_state(TASK_INTERRUPTIBLE);
- while (!kthread_should_stop())
+ while (!kthread_should_stop()) {
schedule();
+ set_current_state(TASK_INTERRUPTIBLE);
+ }
+ __set_current_state(TASK_RUNNING);
return 0;
}
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
Jet Chen <jet.chen@intel.com>, Su Tao <tao.su@intel.com>,
Yuanhan Liu <yuanhan.liu@intel.com>, LKP <lkp@01.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] trace: Robustify wait loop
Date: Wed, 8 Oct 2014 18:51:10 +0200 [thread overview]
Message-ID: <20141008165110.GA14547@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20141008163657.GN10832@worktop.programming.kicks-ass.net>
On Wed, Oct 08, 2014 at 06:36:57PM +0200, Peter Zijlstra wrote:
>
> Right, I'll send the patch.
---
Subject: trace: Robustify wait loop
From: Peter Zijlstra (Intel) <peterz@infradead.org>
Date: Wed Oct 8 18:44:26 CEST 2014
The pending nested sleep debugging triggered on the potential stale
TASK_INTERRUPTIBLE in this code.
While there, fix the loop such that we won't revert to a while(1)
yield() 'spin' loop if we ever get a spurious wakeup.
And fix the actual issue by properly terminating the 'wait' loop by
setting TASK_RUNNING.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/trace/trace_events.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2513,8 +2513,11 @@ static __init int event_test_thread(void
kfree(test_malloc);
set_current_state(TASK_INTERRUPTIBLE);
- while (!kthread_should_stop())
+ while (!kthread_should_stop()) {
schedule();
+ set_current_state(TASK_INTERRUPTIBLE);
+ }
+ __set_current_state(TASK_RUNNING);
return 0;
}
next prev parent reply other threads:[~2014-10-08 16:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 10:07 [trace events] WARNING: CPU: 0 PID: 91 at kernel/sched/core.c:7253 __might_sleep() Fengguang Wu
2014-10-08 10:41 ` Peter Zijlstra
2014-10-08 10:41 ` Peter Zijlstra
2014-10-08 15:08 ` Steven Rostedt
2014-10-08 15:08 ` Steven Rostedt
2014-10-08 15:48 ` Peter Zijlstra
2014-10-08 15:48 ` Peter Zijlstra
2014-10-08 16:17 ` Steven Rostedt
2014-10-08 16:17 ` Steven Rostedt
2014-10-08 16:36 ` Peter Zijlstra
2014-10-08 16:36 ` Peter Zijlstra
2014-10-08 16:51 ` Peter Zijlstra [this message]
2014-10-08 16:51 ` [PATCH] trace: Robustify wait loop Peter Zijlstra
2014-10-08 17:52 ` Steven Rostedt
2014-10-08 17:52 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141008165110.GA14547@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=lkp@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.