On Sat, Nov 2, 2019 at 4:58 AM Vincent Blanchon
<
blanchon...@gmail.com> wrote:
>
> Reading the code, I can see the structs m and p hold a mcache instance. I'm curious to understand why both of them need an instance of mcache?
> Also, I see that those instances are the same ones (runtime/proc.go init the p.mcache with m.cache and vice versa), is it correct? Should we consider that mcache belongs to m or p?
The mcache belongs to the P.
We used to have the possibility of an M using the mcache of a P even
though it was not running on the P. That happened in the helpgc
function which was run by gchelpers. But gchelpers was removed in
https://golang.org/cl/134785, so it may be that we no longer need the
mcache field on an M.
Out of curiosity, I tried that:
https://golang.org/cl/205239.
Ian