Skip to content

Commit

Permalink
ftrace: add UNINTERRUPTIBLE state for kftraced on disable
Browse files Browse the repository at this point in the history
When dynamic ftrace fails and sets itself disabled, the ftraced daemon
will go back to sleep everytime it wakes up. The setting of the
ftraced state to UNINTERRUPTIBLE is skipped in this process, and the
daemon takes up 100% of the CPU.  This patch makes sure the ftraced daemon
sets itself to UNINTERRUPTIBLE in that loop.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Steven Rostedt authored and Thomas Gleixner committed May 23, 2008
1 parent c1d2327 commit 07a267c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,10 @@ static int ftraced(void *ignore)
{
unsigned long usecs;

set_current_state(TASK_INTERRUPTIBLE);

while (!kthread_should_stop()) {

set_current_state(TASK_INTERRUPTIBLE);

/* check once a second */
schedule_timeout(HZ);

Expand Down Expand Up @@ -667,8 +667,6 @@ static int ftraced(void *ignore)
wake_up_interruptible(&ftraced_waiters);

ftrace_shutdown_replenish();

set_current_state(TASK_INTERRUPTIBLE);
}
__set_current_state(TASK_RUNNING);
return 0;
Expand Down

0 comments on commit 07a267c

Please sign in to comment.