Locking:(9)
π Locking: π
okay bestie, welcome to the Kernel API Manual β yes this is literally the locking page and yes it's short but it's IMPORTANT, so stay with me π
β¨ Locking: β¨
okay so first thing, ovs_lock is the main character here π β all writes are protected by it. and when I say all writes I mean ALL of them, like:
- writes to device state β and yes that includes add/remove datapath, port, set operations on vports, etc. π οΈ
- writes to other state β flow table modifications, set miscellaneous datapath parameters, etc. π
both of those categories? ovs_lock. no cap. π
Meanwhile, reads are protected by RCU β that's a whole different vibe, she runs lock-free-ish and we love her for it πΈ
Then there's the little squad of special cases (mostly stats) that have their own synchronization β but ngl they're lowkey chill because they nest under all of the above and they don't interact with each other. so they're independent, but still polite and hierarchical about it π«Ά
and the nesting order, since you asked:
- the
RTNLlock nests insideovs_mutexπ
that's it. that's the hierarchy. respect it. periodt. π₯
π SEE ALSO π
- Kernel file
./net/openvswitch/datapath.cβ go read the source, iykyk π
fr fr please don't mess with the locking order, bestie β the nesting rules are the whole point π
and that's a wrap, gorgeous β¨ this page came to you from ./net/openvswitch, dated October 2026, under the manual name Locking:(9) π mwah, go write some correctly-locked kernel code π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms