Skip to content

Commit cf5b6ef

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
timers: Update schedule_[hr]timeout*() related function descriptions
schedule_timeout*() functions do not have proper kernel-doc formatted function descriptions. schedule_hrtimeout() and schedule_hrtimeout_range() have a almost identical description. Add missing function descriptions. Remove copy of function description and add a pointer to the existing description instead. Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/all/20241014-devel-anna-maria-b4-timers-flseep-v3-3-dc8b907cb62f@linutronix.de
1 parent da7bd0a commit cf5b6ef

File tree

1 file changed

+41
-25
lines changed

1 file changed

+41
-25
lines changed

kernel/time/sleep_timeout.c

+41-25
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,17 @@ signed long __sched schedule_timeout(signed long timeout)
110110
EXPORT_SYMBOL(schedule_timeout);
111111

112112
/*
113-
* We can use __set_current_state() here because schedule_timeout() calls
114-
* schedule() unconditionally.
113+
* __set_current_state() can be used in schedule_timeout_*() functions, because
114+
* schedule_timeout() calls schedule() unconditionally.
115+
*/
116+
117+
/**
118+
* schedule_timeout_interruptible - sleep until timeout (interruptible)
119+
* @timeout: timeout value in jiffies
120+
*
121+
* See schedule_timeout() for details.
122+
*
123+
* Task state is set to TASK_INTERRUPTIBLE before starting the timeout.
115124
*/
116125
signed long __sched schedule_timeout_interruptible(signed long timeout)
117126
{
@@ -120,23 +129,45 @@ signed long __sched schedule_timeout_interruptible(signed long timeout)
120129
}
121130
EXPORT_SYMBOL(schedule_timeout_interruptible);
122131

132+
/**
133+
* schedule_timeout_killable - sleep until timeout (killable)
134+
* @timeout: timeout value in jiffies
135+
*
136+
* See schedule_timeout() for details.
137+
*
138+
* Task state is set to TASK_KILLABLE before starting the timeout.
139+
*/
123140
signed long __sched schedule_timeout_killable(signed long timeout)
124141
{
125142
__set_current_state(TASK_KILLABLE);
126143
return schedule_timeout(timeout);
127144
}
128145
EXPORT_SYMBOL(schedule_timeout_killable);
129146

147+
/**
148+
* schedule_timeout_uninterruptible - sleep until timeout (uninterruptible)
149+
* @timeout: timeout value in jiffies
150+
*
151+
* See schedule_timeout() for details.
152+
*
153+
* Task state is set to TASK_UNINTERRUPTIBLE before starting the timeout.
154+
*/
130155
signed long __sched schedule_timeout_uninterruptible(signed long timeout)
131156
{
132157
__set_current_state(TASK_UNINTERRUPTIBLE);
133158
return schedule_timeout(timeout);
134159
}
135160
EXPORT_SYMBOL(schedule_timeout_uninterruptible);
136161

137-
/*
138-
* Like schedule_timeout_uninterruptible(), except this task will not contribute
139-
* to load average.
162+
/**
163+
* schedule_timeout_idle - sleep until timeout (idle)
164+
* @timeout: timeout value in jiffies
165+
*
166+
* See schedule_timeout() for details.
167+
*
168+
* Task state is set to TASK_IDLE before starting the timeout. It is similar to
169+
* schedule_timeout_uninterruptible(), except this task will not contribute to
170+
* load average.
140171
*/
141172
signed long __sched schedule_timeout_idle(signed long timeout)
142173
{
@@ -151,6 +182,9 @@ EXPORT_SYMBOL(schedule_timeout_idle);
151182
* @delta: slack in expires timeout (ktime_t)
152183
* @mode: timer mode
153184
* @clock_id: timer clock to be used
185+
*
186+
* Details are explained in schedule_hrtimeout_range() function description as
187+
* this function is commonly used.
154188
*/
155189
int __sched schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta,
156190
const enum hrtimer_mode mode, clockid_t clock_id)
@@ -236,26 +270,8 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_range);
236270
* @expires: timeout value (ktime_t)
237271
* @mode: timer mode
238272
*
239-
* Make the current task sleep until the given expiry time has
240-
* elapsed. The routine will return immediately unless
241-
* the current task state has been set (see set_current_state()).
242-
*
243-
* You can set the task state as follows -
244-
*
245-
* %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
246-
* pass before the routine returns unless the current task is explicitly
247-
* woken up, (e.g. by wake_up_process()).
248-
*
249-
* %TASK_INTERRUPTIBLE - the routine may return early if a signal is
250-
* delivered to the current task or the current task is explicitly woken
251-
* up.
252-
*
253-
* The current task state is guaranteed to be TASK_RUNNING when this
254-
* routine returns.
255-
*
256-
* Returns: 0 when the timer has expired. If the task was woken before the
257-
* timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
258-
* by an explicit wakeup, it returns -EINTR.
273+
* See schedule_hrtimeout_range() for details. @delta argument of
274+
* schedule_hrtimeout_range() is set to 0 and has therefore no impact.
259275
*/
260276
int __sched schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode)
261277
{

0 commit comments

Comments
 (0)