Re: [PATCH 17/15] rcuwait: Inform rcuwait_wake_up() users if a wakeup was attempted

Peter Zijlstra
2020-03-20T10:45:09Z

On Fri, Mar 20, 2020 at 01:55:25AM -0700, Davidlohr Bueso wrote:

> diff --git a/kernel/exit.c b/kernel/exit.c
> index 6cc6cc485d07..b0bb0a8ec4b1 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -234,9 +234,10 @@ void release_task(struct task_struct *p)
> goto repeat;
> }
>
> -void rcuwait_wake_up(struct rcuwait *w)
> +bool rcuwait_wake_up(struct rcuwait *w)
> {
> struct task_struct *task;
> + bool ret = false;
>
> rcu_read_lock();
>
> @@ -254,10 +255,15 @@ void rcuwait_wake_up(struct rcuwait *w)
> smp_mb(); /* (B) */
>
> task = rcu_dereference(w->task);
> - if (task)
> + if (task) {
> wake_up_process(task);
> + ret = true;

ret = wake_up_process(task); ?

> + }
> rcu_read_unlock();
> +
> + return ret;
> }
> +EXPORT_SYMBOL_GPL(rcuwait_wake_up);