|
|
Log in / Subscribe / Register

Shrinking shrinker locking overhead

Shrinking shrinker locking overhead

Posted Sep 17, 2023 17:54 UTC (Sun) by willy (subscriber, #9762)
In reply to: Shrinking shrinker locking overhead by nelhage
Parent article: Shrinking shrinker locking overhead

You wrote a great article about the problem; thank you. More people need to be aware of it. I share your opinion that rwlocks are an attractive nuisance, whether they're fair or unfair.

Your linked article about the mmap_sem is also spot on. https://www.tumblr.com/nelhagedebugsshit/140317144518/whe...

In the past few months, we've landed changes to avoid using the mmap_sem for the majority of page faults. There is more work to do (in particular, reading /proc/PID/maps needs to use RCU instead of the rwsem), but even in its current form, we see improvement. v6.4 will avoid the mmap_sem for anon memory and v6.6 will avoid it for file-backed memory too (as long as we hit in the page cache).

You can read about the scheme we're using right here on LWN: https://lwn.net/Articles/906852/

Funnily, it's _more_ rwsems, but there should rarely be contention; you have to be doing a write operation that splits an existing VMA to have a reader block. eg an mprotect(). It's certainly not a traditional way to use an rwsem, but it felt better than open-coding a spinlock, a wait-queue and a "modification in progress" bit.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds