diff options
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r-- | include/linux/rcupdate.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index de50d8a4cf41..1a9f70d44af9 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -523,7 +523,7 @@ static inline void rcu_preempt_sleep_check(void) { } | |||
523 | * Return the value of the specified RCU-protected pointer, but omit | 523 | * Return the value of the specified RCU-protected pointer, but omit |
524 | * both the smp_read_barrier_depends() and the READ_ONCE(). This | 524 | * both the smp_read_barrier_depends() and the READ_ONCE(). This |
525 | * is useful in cases where update-side locks prevent the value of the | 525 | * is useful in cases where update-side locks prevent the value of the |
526 | * pointer from changing. Please note that this primitive does -not- | 526 | * pointer from changing. Please note that this primitive does *not* |
527 | * prevent the compiler from repeating this reference or combining it | 527 | * prevent the compiler from repeating this reference or combining it |
528 | * with other references, so it should not be used without protection | 528 | * with other references, so it should not be used without protection |
529 | * of appropriate locks. | 529 | * of appropriate locks. |
@@ -568,7 +568,7 @@ static inline void rcu_preempt_sleep_check(void) { } | |||
568 | * is handed off from RCU to some other synchronization mechanism, for | 568 | * is handed off from RCU to some other synchronization mechanism, for |
569 | * example, reference counting or locking. In C11, it would map to | 569 | * example, reference counting or locking. In C11, it would map to |
570 | * kill_dependency(). It could be used as follows: | 570 | * kill_dependency(). It could be used as follows: |
571 | * | 571 | * `` |
572 | * rcu_read_lock(); | 572 | * rcu_read_lock(); |
573 | * p = rcu_dereference(gp); | 573 | * p = rcu_dereference(gp); |
574 | * long_lived = is_long_lived(p); | 574 | * long_lived = is_long_lived(p); |
@@ -579,6 +579,7 @@ static inline void rcu_preempt_sleep_check(void) { } | |||
579 | * p = rcu_pointer_handoff(p); | 579 | * p = rcu_pointer_handoff(p); |
580 | * } | 580 | * } |
581 | * rcu_read_unlock(); | 581 | * rcu_read_unlock(); |
582 | *`` | ||
582 | */ | 583 | */ |
583 | #define rcu_pointer_handoff(p) (p) | 584 | #define rcu_pointer_handoff(p) (p) |
584 | 585 | ||
@@ -778,18 +779,21 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
778 | 779 | ||
779 | /** | 780 | /** |
780 | * RCU_INIT_POINTER() - initialize an RCU protected pointer | 781 | * RCU_INIT_POINTER() - initialize an RCU protected pointer |
782 | * @p: The pointer to be initialized. | ||
783 | * @v: The value to initialized the pointer to. | ||
781 | * | 784 | * |
782 | * Initialize an RCU-protected pointer in special cases where readers | 785 | * Initialize an RCU-protected pointer in special cases where readers |
783 | * do not need ordering constraints on the CPU or the compiler. These | 786 | * do not need ordering constraints on the CPU or the compiler. These |
784 | * special cases are: | 787 | * special cases are: |
785 | * | 788 | * |
786 | * 1. This use of RCU_INIT_POINTER() is NULLing out the pointer -or- | 789 | * 1. This use of RCU_INIT_POINTER() is NULLing out the pointer *or* |
787 | * 2. The caller has taken whatever steps are required to prevent | 790 | * 2. The caller has taken whatever steps are required to prevent |
788 | * RCU readers from concurrently accessing this pointer -or- | 791 | * RCU readers from concurrently accessing this pointer *or* |
789 | * 3. The referenced data structure has already been exposed to | 792 | * 3. The referenced data structure has already been exposed to |
790 | * readers either at compile time or via rcu_assign_pointer() -and- | 793 | * readers either at compile time or via rcu_assign_pointer() *and* |
791 | * a. You have not made -any- reader-visible changes to | 794 | * |
792 | * this structure since then -or- | 795 | * a. You have not made *any* reader-visible changes to |
796 | * this structure since then *or* | ||
793 | * b. It is OK for readers accessing this structure from its | 797 | * b. It is OK for readers accessing this structure from its |
794 | * new location to see the old state of the structure. (For | 798 | * new location to see the old state of the structure. (For |
795 | * example, the changes were to statistical counters or to | 799 | * example, the changes were to statistical counters or to |
@@ -805,7 +809,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
805 | * by a single external-to-structure RCU-protected pointer, then you may | 809 | * by a single external-to-structure RCU-protected pointer, then you may |
806 | * use RCU_INIT_POINTER() to initialize the internal RCU-protected | 810 | * use RCU_INIT_POINTER() to initialize the internal RCU-protected |
807 | * pointers, but you must use rcu_assign_pointer() to initialize the | 811 | * pointers, but you must use rcu_assign_pointer() to initialize the |
808 | * external-to-structure pointer -after- you have completely initialized | 812 | * external-to-structure pointer *after* you have completely initialized |
809 | * the reader-accessible portions of the linked structure. | 813 | * the reader-accessible portions of the linked structure. |
810 | * | 814 | * |
811 | * Note that unlike rcu_assign_pointer(), RCU_INIT_POINTER() provides no | 815 | * Note that unlike rcu_assign_pointer(), RCU_INIT_POINTER() provides no |
@@ -819,6 +823,8 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
819 | 823 | ||
820 | /** | 824 | /** |
821 | * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer | 825 | * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer |
826 | * @p: The pointer to be initialized. | ||
827 | * @v: The value to initialized the pointer to. | ||
822 | * | 828 | * |
823 | * GCC-style initialization for an RCU-protected pointer in a structure field. | 829 | * GCC-style initialization for an RCU-protected pointer in a structure field. |
824 | */ | 830 | */ |