From 2b47e2bee09fceb942875acaba830141da1b5c87 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 17:47:30 +0000 Subject: [PATCH] Revert "wait: Return number of exclusive waiters awaken" This reverts commit d710b1e91bc0b054bebc525d01c644fde1900e50. It breaks the ABI right now, but will be brought back at the next ABI break as it will be needed for Android systems. Bug: 161946584 Change-Id: I1dcf1f311ce25059466d000543b020fb33d237b4 Signed-off-by: Greg Kroah-Hartman --- include/linux/wait.h | 2 +- kernel/sched/wait.c | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/linux/wait.h b/include/linux/wait.h index 40dbc01cecb8..2eae4fc9b459 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -209,7 +209,7 @@ __remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq list_del(&wq_entry->entry); } -int __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key); +void __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key); void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key); void __wake_up_locked_key_bookmark(struct wait_queue_head *wq_head, unsigned int mode, void *key, wait_queue_entry_t *bookmark); diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 596b19afbf14..ba93b6cba096 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -122,12 +122,11 @@ static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode, return nr_exclusive; } -static int __wake_up_common_lock(struct wait_queue_head *wq_head, unsigned int mode, +static void __wake_up_common_lock(struct wait_queue_head *wq_head, unsigned int mode, int nr_exclusive, int wake_flags, void *key) { unsigned long flags; wait_queue_entry_t bookmark; - int remaining = nr_exclusive; bookmark.flags = 0; bookmark.private = NULL; @@ -136,12 +135,10 @@ static int __wake_up_common_lock(struct wait_queue_head *wq_head, unsigned int m do { spin_lock_irqsave(&wq_head->lock, flags); - remaining = __wake_up_common(wq_head, mode, remaining, + nr_exclusive = __wake_up_common(wq_head, mode, nr_exclusive, wake_flags, key, &bookmark); spin_unlock_irqrestore(&wq_head->lock, flags); } while (bookmark.flags & WQ_FLAG_BOOKMARK); - - return nr_exclusive - remaining; } /** @@ -151,14 +148,13 @@ static int __wake_up_common_lock(struct wait_queue_head *wq_head, unsigned int m * @nr_exclusive: how many wake-one or wake-many threads to wake up * @key: is directly passed to the wakeup function * - * If this function wakes up a task, it executes a full memory barrier - * before accessing the task state. Returns the number of exclusive - * tasks that were awaken. + * If this function wakes up a task, it executes a full memory barrier before + * accessing the task state. */ -int __wake_up(struct wait_queue_head *wq_head, unsigned int mode, - int nr_exclusive, void *key) +void __wake_up(struct wait_queue_head *wq_head, unsigned int mode, + int nr_exclusive, void *key) { - return __wake_up_common_lock(wq_head, mode, nr_exclusive, 0, key); + __wake_up_common_lock(wq_head, mode, nr_exclusive, 0, key); } EXPORT_SYMBOL(__wake_up);