Hacker News new | past | comments | ask | show | jobs | submit login
Memory Bandwidth Napkin Math (2020) (forrestthewoods.com)
45 points by ZainRiz on March 4, 2022 | hide | past | favorite | 6 comments



Does anyone know what "Mutex lock/unlock" is actually measuring?

In Linux at least, a mutex is a plain old struct living in main memory that you "lock" and "unlock" by cmpxchg'ing some fields. It's literally a main memory write, I don't understand how it could have a quarter of the latency of main memory.


Everything not in the registers is a main memory write if you ignore that cache sits inbetween. "All" the CPU needs to do for a mutex is some atomics to verify the core can lock it, it doesn't need to wait for that info to propagate back to the physical RAM stick the same as how anything else in cache doesn't need to wait for it.


Related ongoing thread:

How “latency numbers everybody should know” decreased from 1990–2020 - https://news.ycombinator.com/item?id=30546995 - March 2022 (142 comments)


Has anyone looked at the M1Max numbers? They have impressive bandwidth but haven't seen anything on latency yet.



This part jumped out at me:

> L1 is slower; 0.5 ns -> 1.5 ns

Why did that happen?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: