Skip to content

Commit 9d9a6eb

Browse files
Davidlohr Buesobonzini
authored andcommitted
rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken
Propagating the return value of wake_up_process() back to the caller can come in handy for future users, such as for statistics or accounting purposes. Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Message-Id: <20200424054837.5138-3-dave@stgolabs.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent c9d64a1 commit 9d9a6eb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎include/linux/rcuwait.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static inline void rcuwait_init(struct rcuwait *w)
2525
w->task = NULL;
2626
}
2727

28-
extern void rcuwait_wake_up(struct rcuwait *w);
28+
extern int rcuwait_wake_up(struct rcuwait *w);
2929

3030
/*
3131
* The caller is responsible for locking around rcuwait_wait_event(),

‎kernel/exit.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,9 @@ void release_task(struct task_struct *p)
227227
goto repeat;
228228
}
229229

230-
void rcuwait_wake_up(struct rcuwait *w)
230+
int rcuwait_wake_up(struct rcuwait *w)
231231
{
232+
int ret = 0;
232233
struct task_struct *task;
233234

234235
rcu_read_lock();
@@ -248,8 +249,10 @@ void rcuwait_wake_up(struct rcuwait *w)
248249

249250
task = rcu_dereference(w->task);
250251
if (task)
251-
wake_up_process(task);
252+
ret = wake_up_process(task);
252253
rcu_read_unlock();
254+
255+
return ret;
253256
}
254257
EXPORT_SYMBOL_GPL(rcuwait_wake_up);
255258

0 commit comments

Comments
 (0)