]> git.baikalelectronics.ru Git - kernel.git/commit
list: Add lockless list traversal primitives
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Sun, 6 Dec 2015 02:14:19 +0000 (18:14 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 8 Dec 2015 01:01:33 +0000 (17:01 -0800)
commit594c14bb50c373dec7a9f083f5f24fd21db7e678
tree426f6e2eefb7c03e0f278231f20166514dcdde3e
parente001867e134a99c6950f021b73b02dfe5ddbe3c8
list: Add lockless list traversal primitives

Although list_for_each_entry_rcu() can in theory be used anywhere
preemption is disabled, it can result in calls to lockdep, which cannot
be used in certain constrained execution environments, such as exception
handlers that do not map the entire kernel into their address spaces.
This commit therefore adds list_entry_lockless() and
list_for_each_entry_lockless(), which never invoke lockdep and can
therefore safely be used from these constrained environments, but only
as long as those environments are non-preemptible (or items are never
deleted from the list).

Use synchronize_sched(), call_rcu_sched(), or synchronize_sched_expedited()
in updates for the needed grace periods.  Of course, if items are never
deleted from the list, there is no need to wait for grace periods.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/rculist.h