Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull rcu/next + tools/memory-model changes from Paul E. McKenney: - RCU flavor consolidation cleanups and optmizations - Documentation updates - Miscellaneous fixes - SRCU updates - RCU-sync flavor consolidation - Torture-test updates - Linux-kernel memory-consistency-model updates, most notably the addition of plain C-language accesses Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -365,16 +365,15 @@ static inline void rcu_preempt_sleep_check(void) { }
|
||||
* other macros that it invokes.
|
||||
*/
|
||||
#define rcu_assign_pointer(p, v) \
|
||||
({ \
|
||||
do { \
|
||||
uintptr_t _r_a_p__v = (uintptr_t)(v); \
|
||||
rcu_check_sparse(p, __rcu); \
|
||||
rcu_check_sparse(p, __rcu); \
|
||||
\
|
||||
if (__builtin_constant_p(v) && (_r_a_p__v) == (uintptr_t)NULL) \
|
||||
WRITE_ONCE((p), (typeof(p))(_r_a_p__v)); \
|
||||
else \
|
||||
smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
|
||||
_r_a_p__v; \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* rcu_swap_protected() - swap an RCU and a regular pointer
|
||||
@@ -586,7 +585,7 @@ static inline void rcu_preempt_sleep_check(void) { }
|
||||
* read-side critical sections may be preempted and they may also block, but
|
||||
* only when acquiring spinlocks that are subject to priority inheritance.
|
||||
*/
|
||||
static inline void rcu_read_lock(void)
|
||||
static __always_inline void rcu_read_lock(void)
|
||||
{
|
||||
__rcu_read_lock();
|
||||
__acquire(RCU);
|
||||
@@ -803,7 +802,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
|
||||
/**
|
||||
* kfree_rcu() - kfree an object after a grace period.
|
||||
* @ptr: pointer to kfree
|
||||
* @rcu_head: the name of the struct rcu_head within the type of @ptr.
|
||||
* @rhf: the name of the struct rcu_head within the type of @ptr.
|
||||
*
|
||||
* Many rcu callbacks functions just call kfree() on the base structure.
|
||||
* These functions are trivial, but their size adds up, and furthermore
|
||||
@@ -826,9 +825,13 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
|
||||
* The BUILD_BUG_ON check must not involve any function calls, hence the
|
||||
* checks are done in macros here.
|
||||
*/
|
||||
#define kfree_rcu(ptr, rcu_head) \
|
||||
__kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
|
||||
|
||||
#define kfree_rcu(ptr, rhf) \
|
||||
do { \
|
||||
typeof (ptr) ___p = (ptr); \
|
||||
\
|
||||
if (___p) \
|
||||
__kfree_rcu(&((___p)->rhf), offsetof(typeof(*(ptr)), rhf)); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Place this after a lock-acquisition primitive to guarantee that
|
||||
|
Reference in New Issue
Block a user