Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
os/bluestore: move cache_trim into MempoolThread #15380
IIRC the reason I left trim_cache in the IO thread was for cpu cache locality (since that is the thread that's doing the cache updates). Mempool thread does not. That said, this gets the potentially long-running trim out of the thread that blocks other ops' progress, and we could shard it and pin the threads in the future if the cpu caching effects are significant...
I just got done testing this PR out. It doesn't appear to affect performance dramatically in any of my tests either way, though did appear to dramatically reduce time spent in trim (even in the MempoolThread?) and as a result lowered pg::lock contention from 95% in the finisher thread to something more like 78%. Unfortunately we are still spending a lot of time in the tp_osd_tp threads simply doing reads of the onodes when there isn't enough cache to keep them in memory. Included are gdb wallclock profiles on a run before this PR and after this PR.