@@ -110,8 +110,17 @@ signed long __sched schedule_timeout(signed long timeout)
110
110
EXPORT_SYMBOL (schedule_timeout );
111
111
112
112
/*
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.
115
124
*/
116
125
signed long __sched schedule_timeout_interruptible (signed long timeout )
117
126
{
@@ -120,23 +129,45 @@ signed long __sched schedule_timeout_interruptible(signed long timeout)
120
129
}
121
130
EXPORT_SYMBOL (schedule_timeout_interruptible );
122
131
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
+ */
123
140
signed long __sched schedule_timeout_killable (signed long timeout )
124
141
{
125
142
__set_current_state (TASK_KILLABLE );
126
143
return schedule_timeout (timeout );
127
144
}
128
145
EXPORT_SYMBOL (schedule_timeout_killable );
129
146
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
+ */
130
155
signed long __sched schedule_timeout_uninterruptible (signed long timeout )
131
156
{
132
157
__set_current_state (TASK_UNINTERRUPTIBLE );
133
158
return schedule_timeout (timeout );
134
159
}
135
160
EXPORT_SYMBOL (schedule_timeout_uninterruptible );
136
161
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.
140
171
*/
141
172
signed long __sched schedule_timeout_idle (signed long timeout )
142
173
{
@@ -151,6 +182,9 @@ EXPORT_SYMBOL(schedule_timeout_idle);
151
182
* @delta: slack in expires timeout (ktime_t)
152
183
* @mode: timer mode
153
184
* @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.
154
188
*/
155
189
int __sched schedule_hrtimeout_range_clock (ktime_t * expires , u64 delta ,
156
190
const enum hrtimer_mode mode , clockid_t clock_id )
@@ -236,26 +270,8 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_range);
236
270
* @expires: timeout value (ktime_t)
237
271
* @mode: timer mode
238
272
*
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.
259
275
*/
260
276
int __sched schedule_hrtimeout (ktime_t * expires , const enum hrtimer_mode mode )
261
277
{
0 commit comments