In the Linux kernel, list_for_each_entry_rcu()
is used to traverse rcu protected list in reader side critical section. What happens if list_for_each_entry()
is used instead? Does it cause problems?
In some architectures CPUs can look through the next pointer early. Specially in case of ALPHA and SPARC CPUs. Hence list_for_each_entry_rcu()
is needed which essentially put memory barriers to limit this behavior. However in writer side we can avoid list_for_each_entry_rcu()
and use list_for_each_entry()
.