]> git.baikalelectronics.ru Git - kernel.git/commit
timer: Improve the comment describing schedule_timeout()
authorAlexander Popov <alex.popov@linux.com>
Fri, 17 Jan 2020 22:59:00 +0000 (01:59 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 17 Feb 2020 19:12:19 +0000 (20:12 +0100)
commitff6c9271d1f4f742423f8e430cdb74e487945dd8
tree6c6170fd0ffa3b340c01085761d48be10eb4f5d1
parentf8da45f60fa8c04b3eb75ea70d5647dedd87ac8c
timer: Improve the comment describing schedule_timeout()

When working commit ad50acad5fc0413, a mistake was noticed by Linus:
schedule_timeout() was called without setting the task state to anything
particular.

It calls the scheduler, but doesn't delay anything, because the task stays
runnable. That happens because sched_submit_work() does nothing for tasks
in TASK_RUNNING state.

That turned out to be the intended behavior. Adding a WARN() is not useful
as the task could be woken up right after setting the state and before
reaching schedule_timeout().

Improve the comment about schedule_timeout() and describe that more
explicitly.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200117225900.16340-1-alex.popov@linux.com
kernel/time/timer.c