I took a typical computer architecture class a long time ago as an undergrad and since then I've done a fair amount of low-level systems programming down to the assembly level and worked on OS kernels. However, I still acknowledge that I have some gaps when it comes to understanding how memory subsystems work in multiprocessor and multicore systems.
My question is the following: Is there any good book or other good source covering memory buses and caches on multiprocessor and multicore systems? I'm specifically interested in what exactly happens in hardware when e.g. a processor claims a lock on some memory address. How much background traffic on the memory bus is caused by locks that might slow down unrelated memory intensive code? What kind of lock granularity is typically offered by hardware? What kind of stalls can occur when multiple CPUs try to concurrently write into memory (i.e. not just the same address, but same bank etc.). What kind of issues come up when multiple cores share the same caches? In other words, everything a kernel engineer should know about memory to get rid of hidden bottlenecks.
I know this is a pretty broad question, but I would hope that someone has at least written a book like this. Alternatively, that there's a small set of books that cover all of this.