[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 2/6] rcu: Introduce rcu_read_is_locked()
From: |
Chuang Xu |
Subject: |
[PATCH v8 2/6] rcu: Introduce rcu_read_is_locked() |
Date: |
Fri, 17 Mar 2023 16:19:00 +0800 |
Add rcu_read_is_locked() to detect holding of rcu lock.
Signed-off-by: Chuang Xu <xuchuangxclwt@bytedance.com>
---
include/qemu/rcu.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h
index 313fc414bc..7bf45602e1 100644
--- a/include/qemu/rcu.h
+++ b/include/qemu/rcu.h
@@ -115,6 +115,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);
/*
--
2.20.1
- [PATCH v8 0/6] migration: reduce time of loading non-iterable vmstate, Chuang Xu, 2023/03/17
- [PATCH v8 1/6] memory: Reference as->current_map directly in memory commit, Chuang Xu, 2023/03/17
- [PATCH v8 2/6] rcu: Introduce rcu_read_is_locked(),
Chuang Xu <=
- [PATCH v8 3/6] memory: Introduce memory_region_transaction_do_commit(), Chuang Xu, 2023/03/17
- [PATCH v8 4/6] memory: Add do_commit() and sanity check in address_space_to_flatview, Chuang Xu, 2023/03/17
- [PATCH v8 5/6] migration: Reduce time of loading non-iterable vmstate, Chuang Xu, 2023/03/17
- [PATCH v8 6/6] memory: Introduce address_space_to_flatview_rcu(), Chuang Xu, 2023/03/17