mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcuwait: Add might_sleep() annotations
Date: Tue, 25 Jul 2023 14:03:36 +0200	[thread overview]
Message-ID: <20230725120336.GG3765278@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230724160337.20851-1-dave@stgolabs.net>

On Mon, Jul 24, 2023 at 09:03:36AM -0700, Davidlohr Bueso wrote:
> ... as with regular waitqueues.

No immediate objection, but please, tell us more. What made you get up
this fine morning and write this patch?

> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
> ---
>  include/linux/rcuwait.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h
> index 27343424225c..c0fcac903d03 100644
> --- a/include/linux/rcuwait.h
> +++ b/include/linux/rcuwait.h
> @@ -74,7 +74,10 @@ extern void finish_rcuwait(struct rcuwait *w);
>  })
>  
>  #define rcuwait_wait_event(w, condition, state)				\
> -	___rcuwait_wait_event(w, condition, state, 0, schedule())
> +do {									\
> +	might_sleep();							\
> +	___rcuwait_wait_event(w, condition, state, 0, schedule());	\
> +} while (0)
>  
>  #define __rcuwait_wait_event_timeout(w, condition, state, timeout)	\
>  	___rcuwait_wait_event(w, ___wait_cond_timeout(condition),	\
> @@ -84,6 +87,7 @@ extern void finish_rcuwait(struct rcuwait *w);
>  #define rcuwait_wait_event_timeout(w, condition, state, timeout)	\
>  ({									\
>  	long __ret = timeout;						\
> +	might_sleep();							\
>  	if (!___wait_cond_timeout(condition))				\
>  		__ret = __rcuwait_wait_event_timeout(w, condition,	\
>  						     state, timeout);	\
> -- 
> 2.41.0
> 

  reply	other threads:[~2023-07-25 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 16:03 Davidlohr Bueso
2023-07-25 12:03 ` Peter Zijlstra [this message]
2023-07-25 14:27   ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230725120336.GG3765278@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dave@stgolabs.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®