public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Documentation of locking needs when working with lists?
@ 2025-05-10  8:46 Heiner Kallweit
  2025-05-10 13:20 ` Greg Kroah-Hartman
  2025-05-13 21:42 ` David Laight
  0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2025-05-10  8:46 UTC (permalink / raw)
  To: Andrew Morton, Greg Kroah-Hartman, Ingo Molnar; +Cc: Linux Kernel Mailing List

Even though lists are used everywhere, I was surprised not being able to find
documentation about which operations need locking, and which ones are safe
lock-less.

My case:
I have a list where the only operation is adding entries.
It's clear that adding entries has to be serialized.
Question is whether a list_for_each_entry is safe lock-less.

Looking at the code I *think* it's safe, under the precondition that
reading/writing pointers is atomic.

Any hint or documentation link would be appreciated. Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-13 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-10  8:46 Documentation of locking needs when working with lists? Heiner Kallweit
2025-05-10 13:20 ` Greg Kroah-Hartman
2025-05-10 20:46   ` Heiner Kallweit
2025-05-13 21:42 ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox