TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Global Kernel Locks in APFS

141 pointsby indygreg2over 6 years ago

5 comments

kiwijamoover 6 years ago
I wonder if this is why recent versions of macOS performs so poorly on old HDD-based MacBooks. The difference between my work's 2012 MacBook (HDD) and my personal 2015 (SSD) MacBook is like night and day. Most apps open in a second on my SSD MacBook yet take up to a minute to open on my employer's HDD MacBook. It's not just this MacBook, I also see the same on a work iMac as well. Such a shame as these older machines previously didn't run so slowly.
评论 #18334182 未加载
评论 #18334180 未加载
评论 #18335913 未加载
chmaynardover 6 years ago
The author worked very hard to determine the root cause of the problem but he was stymied because the APFS source code is not available. Why not? Apple has open-sourced the Swift compiler with great success, but there seems to be no movement within Apple to open up other system software components.
评论 #18332978 未加载
评论 #18333445 未加载
评论 #18332711 未加载
评论 #18332793 未加载
twotwotwoover 6 years ago
I&#x27;m too late to the thread, but wonder if locking might have to do with updating access times on the dirs on read--that would help justify a read-only workload taking some sort of exclusive lock. The &quot;fix&quot; there would be something like relatime to get atimes set infrequently.<p>There&#x27;re def a ton of other possibilities. Some locking could be overbroad, like an exclusive lock where a reader lock would be enough. I don&#x27;t see super-strong evidence that any locks involved are actually <i>global</i>, just that they&#x27;re under contention here. And I can understand shipping a product with somewhat excessive locking because perf issues with specific workloads are a better problem to have with your shiny new FS rollout than data loss.<p>Anyway it&#x27;s mostly shooting in the dark for us here (though cool some folks disassembled the functions), but there are some shots in the dark that look different from what I could find in the comments already here :)
lelfover 6 years ago
Absolutely <i>nothing</i> there indicates the presence of global kernel locks. <i>readdir</i> (obviously!!!) needs to hold a lock, it’s not global, it’s per-DIR.
georgnover 6 years ago
As someone who used to work on BitKeeper, I&#x27;m tickled to see a more popular SCM&#x27;s test suite as a kind of de facto filesystem benchmark -- confirming what we had been observing ourselves forever.