From: Juan Quintela <quintela@redhat.com>
To: Chuang Xu <xuchuangxclwt@bytedance.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com,
pbonzini@redhat.com, peterx@redhat.com, david@redhat.com,
philmd@linaro.org, zhouyibo@bytedance.com
Subject: Re: [RFC v5 1/3] rcu: introduce rcu_read_is_locked()
Date: Thu, 02 Feb 2023 11:59:05 +0100 [thread overview]
Message-ID: <87r0v8s58m.fsf@secure.mitica> (raw)
In-Reply-To: <20230117115511.3215273-2-xuchuangxclwt@bytedance.com> (Chuang Xu's message of "Tue, 17 Jan 2023 19:55:09 +0800")
Chuang Xu <xuchuangxclwt@bytedance.com> wrote:
> add rcu_read_is_locked() to detect holding of rcu lock.
>
> Signed-off-by: Chuang Xu <xuchuangxclwt@bytedance.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Althought I think that petting a review from Paolo or anyone that knows
more than RCU could be a good idea.
> ---
> include/qemu/rcu.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h
> index b063c6fde8..719916d9d3 100644
> --- a/include/qemu/rcu.h
> +++ b/include/qemu/rcu.h
> @@ -119,6 +119,13 @@ static inline void rcu_read_unlock(void)
> }
> }
>
> +static inline bool rcu_read_is_locked(void)
> +{
> + struct rcu_reader_data *p_rcu_reader = get_ptr_rcu_reader();
> +
> + return p_rcu_reader->depth > 0;
> +}
> +
> extern void synchronize_rcu(void);
>
> /*
next prev parent reply other threads:[~2023-02-02 10:59 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 11:55 [RFC v5 0/3] migration: reduce time of loading non-iterable vmstate Chuang Xu
2023-01-17 11:55 ` [RFC v5 1/3] rcu: introduce rcu_read_is_locked() Chuang Xu
2023-02-02 10:59 ` Juan Quintela [this message]
2023-02-14 7:57 ` Chuang Xu
2023-01-17 11:55 ` [RFC v5 2/3] memory: add depth assert in address_space_to_flatview Chuang Xu
2023-02-08 19:31 ` Juan Quintela
2023-01-17 11:55 ` [RFC v5 3/3] migration: reduce time of loading non-iterable vmstate Chuang Xu
2023-02-02 11:01 ` Juan Quintela
2023-01-17 15:41 ` [RFC v5 0/3] " Peter Xu
2023-02-02 11:07 ` Juan Quintela
2023-02-15 17:00 ` Juan Quintela
2023-02-15 17:06 ` Claudio Fontana
2023-02-15 19:10 ` Juan Quintela
2023-02-16 15:41 ` Chuang Xu
[not found] ` <a555b989-27be-006e-0d00-9f1688c5be4e@bytedance.com>
2023-02-17 8:11 ` Chuang Xu
2023-02-17 15:52 ` Peter Xu
2023-02-20 13:36 ` Chuang Xu
2023-02-21 3:38 ` Chuang Xu
2023-02-21 8:57 ` Chuang Xu
2023-02-21 20:36 ` Peter Xu
2023-02-22 6:27 ` Chuang Xu
2023-02-22 15:57 ` Peter Xu
2023-02-23 3:28 ` Chuang Xu
2023-02-25 15:32 ` Peter Xu
2023-02-27 13:19 ` Chuang Xu
2023-02-27 20:56 ` Peter Xu
2023-02-20 9:53 ` Chuang Xu
2023-02-20 12:07 ` Juan Quintela
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=87r0v8s58m.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=xuchuangxclwt@bytedance.com \
--cc=zhouyibo@bytedance.com \
/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;
as well as URLs for NNTP newsgroup(s).