Lines Matching +full:use +full:- +full:cases
1 .. SPDX-License-Identifier: GPL-2.0
4 Reference-count design for elements of lists/arrays protected by RCU
8 Please note that the percpu-ref feature is likely your first
10 include/linux/percpu-refcount.h for more information. However, in
11 those unusual cases where percpu-ref would consume too much memory,
14 ------------------------------------------------------------------------
26 atomic_set(&el->rc, 1); atomic_inc(&el->rc);
37 if(atomic_dec_and_test(&el->rc)) ...
42 if (atomic_dec_and_test(&el->rc))
51 has already been deleted from the list/array. Use atomic_inc_not_zero()
61 atomic_set(&el->rc, 1); if (!atomic_inc_not_zero(&el->rc)) {
72 if (atomic_dec_and_test(&el->rc)) ...
73 call_rcu(&el->head, el_free); remove_element
76 if (atomic_dec_and_test(&el->rc))
77 call_rcu(&el->head, el_free);
82 update (write) stream. In such cases, atomic_inc_not_zero() might be
83 overkill, since we hold the update-side spinlock. One might instead
84 use atomic_inc() in such cases.
87 search_and_reference() code path. In such cases, the
98 atomic_set(&el->rc, 1); atomic_inc(&el->rc);
109 if (atomic_dec_and_test(&el->rc)) spin_unlock(&list_lock);
111 ... call_rcu(&el->head, el_free);
122 of el->rc cannot increase. Thus, once it reaches zero, there are no
128 A clear advantage of the RCU-based pattern in listing C over the one
139 In cases where delete() can sleep, synchronize_rcu() can be called from
151 if (atomic_dec_and_test(&el->rc))