diff mbox series

[2/2] sunrpc/svc: use store_release_wake_up()

Message ID 20241206025723.3537777-3-neilb@suse.de (mailing list archive)
State New
Headers show
Series nfsd: use new wake_up_var interface | expand

Commit Message

NeilBrown Dec. 6, 2024, 2:55 a.m. UTC
svc_thread_init_status() contains an open-coded
store_release_wake_up().  It is cleaner to use that function directly
rather than needing to remember the barrier.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 include/linux/sunrpc/svc.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Jeff Layton Dec. 6, 2024, 5:41 a.m. UTC | #1
On Fri, 2024-12-06 at 13:55 +1100, NeilBrown wrote:
> svc_thread_init_status() contains an open-coded
> store_release_wake_up().  It is cleaner to use that function directly
> rather than needing to remember the barrier.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  include/linux/sunrpc/svc.h | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
> index e68fecf6eab5..e4f09f58d58c 100644
> --- a/include/linux/sunrpc/svc.h
> +++ b/include/linux/sunrpc/svc.h
> @@ -327,12 +327,7 @@ static inline bool svc_thread_should_stop(struct svc_rqst *rqstp)
>   */
>  static inline void svc_thread_init_status(struct svc_rqst *rqstp, int err)
>  {
> -	rqstp->rq_err = err;
> -	/* memory barrier ensures assignment to error above is visible before
> -	 * waitqueue_active() test below completes.
> -	 */
> -	smp_mb();
> -	wake_up_var(&rqstp->rq_err);
> +	store_release_wake_up(&rqstp->rq_err, err);
>  	if (err)
>  		kthread_exit(1);
>  }

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index e68fecf6eab5..e4f09f58d58c 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -327,12 +327,7 @@  static inline bool svc_thread_should_stop(struct svc_rqst *rqstp)
  */
 static inline void svc_thread_init_status(struct svc_rqst *rqstp, int err)
 {
-	rqstp->rq_err = err;
-	/* memory barrier ensures assignment to error above is visible before
-	 * waitqueue_active() test below completes.
-	 */
-	smp_mb();
-	wake_up_var(&rqstp->rq_err);
+	store_release_wake_up(&rqstp->rq_err, err);
 	if (err)
 		kthread_exit(1);
 }