sched/completion: Expose wait_for_common*() to drivers
Allow drivers to wait with a custom task state specified by exposing the raw wait_for_common*() functions. This allows code to wait for completions that are invariant with respect to CPU performance *without* contributing to load avg, without requiring the wait to be interruptible. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
parent
15898055b7
commit
669f8aa664
2 changed files with 4 additions and 2 deletions
|
@ -100,6 +100,8 @@ static inline void reinit_completion(struct completion *x)
|
|||
x->done = 0;
|
||||
}
|
||||
|
||||
extern long wait_for_common(struct completion *x, long timeout, int state);
|
||||
extern long wait_for_common_io(struct completion *x, long timeout, int state);
|
||||
extern void wait_for_completion(struct completion *);
|
||||
extern void wait_for_completion_io(struct completion *);
|
||||
extern int wait_for_completion_interruptible(struct completion *x);
|
||||
|
|
|
@ -111,13 +111,13 @@ __wait_for_common(struct completion *x,
|
|||
return timeout;
|
||||
}
|
||||
|
||||
static long __sched
|
||||
long __sched
|
||||
wait_for_common(struct completion *x, long timeout, int state)
|
||||
{
|
||||
return __wait_for_common(x, schedule_timeout, timeout, state);
|
||||
}
|
||||
|
||||
static long __sched
|
||||
long __sched
|
||||
wait_for_common_io(struct completion *x, long timeout, int state)
|
||||
{
|
||||
return __wait_for_common(x, io_schedule_timeout, timeout, state);
|
||||
|
|
Loading…
Reference in a new issue