* Re: schedule_timeout() called with state TASK_RUNNING from fs/select.c
@ 2007-07-08 11:16 Oleg Nesterov
2007-07-10 7:50 ` Robert P. J. Day
0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2007-07-08 11:16 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: Al Viro, linux-kernel
Robert P. J. Day wrote:
>
> as i understand it, schedule_timeout() should always be called with
> a current->state of TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE, no?
No.
Yes, it is pointless to call schedule() if it is known that ->state ==
TASK_RUNNING, but sometimes the task doesn't know its state when it
calls schedule/schedule_timeout, the state could be changed by
try_to_wake_up().
See wait_event_timeout() as an example.
Oleg.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: schedule_timeout() called with state TASK_RUNNING from fs/select.c
2007-07-08 11:16 schedule_timeout() called with state TASK_RUNNING from fs/select.c Oleg Nesterov
@ 2007-07-10 7:50 ` Robert P. J. Day
0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-07-10 7:50 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Al Viro, linux-kernel
On Sun, 8 Jul 2007, Oleg Nesterov wrote:
> Robert P. J. Day wrote:
> >
> > as i understand it, schedule_timeout() should always be called with
> > a current->state of TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE, no?
>
> No.
>
> Yes, it is pointless to call schedule() if it is known that ->state ==
> TASK_RUNNING, but sometimes the task doesn't know its state when it
> calls schedule/schedule_timeout, the state could be changed by
> try_to_wake_up().
>
> See wait_event_timeout() as an example.
fair enough. i already knew that, technically, it wasn't an error to
call schedule_timeout() with state == TASK_RUNNING. i was just
following up on something out of love's kernel book, and i got curious
as to whether the above ever happened. now i know.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* schedule_timeout() called with state TASK_RUNNING from fs/select.c
@ 2007-07-07 19:00 Robert P. J. Day
0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-07-07 19:00 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: Al Viro
as i understand it, schedule_timeout() should always be called with
a current->state of TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE, no?
based on a trivial check i added to kernel/timer.c, i can read this in
/var/log/messages:
...
Jul 7 14:48:40 localhost kernel: Bad schedule_timeout state: 0 from Xorg, c015eeb9
Jul 7 14:49:05 localhost kernel: Bad schedule_timeout state: 0 from gnome-terminal, c015ea47
Jul 7 14:50:19 localhost kernel: Bad schedule_timeout state: 0 from Xorg, c015eeb9
Jul 7 14:50:50 localhost kernel: Bad schedule_timeout state: 0 from Xorg, c015eeb9
...
those last values are __builtin_return_address(0), and here's the
snippet from /proc/kallsyms:
...
c015e7f2 T do_sys_poll
c015eb19 T sys_poll
c015eb50 T do_select
c015ef10 t core_sys_select
...
i'm guessing those addresses correspond to the calls to
schedule_timeout() in do_sys_poll() and do_select(), if anyone thinks
it's worth looking at.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-10 7:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-08 11:16 schedule_timeout() called with state TASK_RUNNING from fs/select.c Oleg Nesterov
2007-07-10 7:50 ` Robert P. J. Day
-- strict thread matches above, loose matches on Subject: below --
2007-07-07 19:00 Robert P. J. Day
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®