lkml.org 
[lkml]   [2020]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] timer: Warn about schedule_timeout() called for tasks in TASK_RUNNING state
On Thu, 16 Jan 2020 09:52:20 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> > --- a/kernel/time/timer.c
> > +++ b/kernel/time/timer.c
> > @@ -1887,6 +1887,11 @@ signed long __sched schedule_timeout(signed long timeout)
> > }
> > }
> >
> > +#ifdef CONFIG_SCHED_DEBUG
> > + WARN_ONCE(current->state == TASK_RUNNING,
> > + "schedule_timeout for TASK_RUNNING\n");
> > +#endif
> > +
>
> But this can trigger false warnings. For example, if we are waiting on
> an event with a timeout:


Also, there are helpers here that you can use:

schedule_timeout_interruptible(signed long timeout);
schedule_timeout_uninterruptible(signed long timeout)

-- Steve

\
 
 \ /
  Last update: 2020-01-16 15:55    [W:0.036 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site