mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
sched/swait: Rename to exclusive
Since swait basically implemented exclusive waits only, make sure the API reflects that. $ git grep -l -e "\<swake_up\>" -e "\<swait_event[^ (]*" -e "\<prepare_to_swait\>" | while read file; do sed -i -e 's/\<swake_up\>/&_one/g' -e 's/\<swait_event[^ (]*/&_exclusive/g' -e 's/\<prepare_to_swait\>/&_exclusive/g' $file; done With a few manual touch-ups. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: bigeasy@linutronix.de Cc: oleg@redhat.com Cc: paulmck@linux.vnet.ibm.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180612083909.261946548@infradead.org
This commit is contained in:
parent
0abf17bc77
commit
b3dae109fa
16 changed files with 48 additions and 48 deletions
|
@ -16,7 +16,7 @@
|
|||
* wait-queues, but the semantics are actually completely different, and
|
||||
* every single user we have ever had has been buggy (or pointless).
|
||||
*
|
||||
* A "swake_up()" only wakes up _one_ waiter, which is not at all what
|
||||
* A "swake_up_one()" only wakes up _one_ waiter, which is not at all what
|
||||
* "wake_up()" does, and has led to problems. In other cases, it has
|
||||
* been fine, because there's only ever one waiter (kvm), but in that
|
||||
* case gthe whole "simple" wait-queue is just pointless to begin with,
|
||||
|
@ -115,7 +115,7 @@ extern void __init_swait_queue_head(struct swait_queue_head *q, const char *name
|
|||
* CPU0 - waker CPU1 - waiter
|
||||
*
|
||||
* for (;;) {
|
||||
* @cond = true; prepare_to_swait(&wq_head, &wait, state);
|
||||
* @cond = true; prepare_to_swait_exclusive(&wq_head, &wait, state);
|
||||
* smp_mb(); // smp_mb() from set_current_state()
|
||||
* if (swait_active(wq_head)) if (@cond)
|
||||
* wake_up(wq_head); break;
|
||||
|
@ -157,11 +157,11 @@ static inline bool swq_has_sleeper(struct swait_queue_head *wq)
|
|||
return swait_active(wq);
|
||||
}
|
||||
|
||||
extern void swake_up(struct swait_queue_head *q);
|
||||
extern void swake_up_one(struct swait_queue_head *q);
|
||||
extern void swake_up_all(struct swait_queue_head *q);
|
||||
extern void swake_up_locked(struct swait_queue_head *q);
|
||||
|
||||
extern void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state);
|
||||
extern void prepare_to_swait_exclusive(struct swait_queue_head *q, struct swait_queue *wait, int state);
|
||||
extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state);
|
||||
|
||||
extern void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
||||
|
@ -196,7 +196,7 @@ __out: __ret; \
|
|||
(void)___swait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, \
|
||||
schedule())
|
||||
|
||||
#define swait_event(wq, condition) \
|
||||
#define swait_event_exclusive(wq, condition) \
|
||||
do { \
|
||||
if (condition) \
|
||||
break; \
|
||||
|
@ -208,7 +208,7 @@ do { \
|
|||
TASK_UNINTERRUPTIBLE, timeout, \
|
||||
__ret = schedule_timeout(__ret))
|
||||
|
||||
#define swait_event_timeout(wq, condition, timeout) \
|
||||
#define swait_event_timeout_exclusive(wq, condition, timeout) \
|
||||
({ \
|
||||
long __ret = timeout; \
|
||||
if (!___wait_cond_timeout(condition)) \
|
||||
|
@ -220,7 +220,7 @@ do { \
|
|||
___swait_event(wq, condition, TASK_INTERRUPTIBLE, 0, \
|
||||
schedule())
|
||||
|
||||
#define swait_event_interruptible(wq, condition) \
|
||||
#define swait_event_interruptible_exclusive(wq, condition) \
|
||||
({ \
|
||||
int __ret = 0; \
|
||||
if (!(condition)) \
|
||||
|
@ -233,7 +233,7 @@ do { \
|
|||
TASK_INTERRUPTIBLE, timeout, \
|
||||
__ret = schedule_timeout(__ret))
|
||||
|
||||
#define swait_event_interruptible_timeout(wq, condition, timeout) \
|
||||
#define swait_event_interruptible_timeout_exclusive(wq, condition, timeout)\
|
||||
({ \
|
||||
long __ret = timeout; \
|
||||
if (!___wait_cond_timeout(condition)) \
|
||||
|
@ -246,7 +246,7 @@ do { \
|
|||
(void)___swait_event(wq, condition, TASK_IDLE, 0, schedule())
|
||||
|
||||
/**
|
||||
* swait_event_idle - wait without system load contribution
|
||||
* swait_event_idle_exclusive - wait without system load contribution
|
||||
* @wq: the waitqueue to wait on
|
||||
* @condition: a C expression for the event to wait for
|
||||
*
|
||||
|
@ -257,7 +257,7 @@ do { \
|
|||
* condition and doesn't want to contribute to system load. Signals are
|
||||
* ignored.
|
||||
*/
|
||||
#define swait_event_idle(wq, condition) \
|
||||
#define swait_event_idle_exclusive(wq, condition) \
|
||||
do { \
|
||||
if (condition) \
|
||||
break; \
|
||||
|
@ -270,7 +270,7 @@ do { \
|
|||
__ret = schedule_timeout(__ret))
|
||||
|
||||
/**
|
||||
* swait_event_idle_timeout - wait up to timeout without load contribution
|
||||
* swait_event_idle_timeout_exclusive - wait up to timeout without load contribution
|
||||
* @wq: the waitqueue to wait on
|
||||
* @condition: a C expression for the event to wait for
|
||||
* @timeout: timeout at which we'll give up in jiffies
|
||||
|
@ -288,7 +288,7 @@ do { \
|
|||
* or the remaining jiffies (at least 1) if the @condition evaluated
|
||||
* to %true before the @timeout elapsed.
|
||||
*/
|
||||
#define swait_event_idle_timeout(wq, condition, timeout) \
|
||||
#define swait_event_idle_timeout_exclusive(wq, condition, timeout) \
|
||||
({ \
|
||||
long __ret = timeout; \
|
||||
if (!___wait_cond_timeout(condition)) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue