cs431 icon indicating copy to clipboard operation
cs431 copied to clipboard

[Question] About NUMA awaring of MCS lock

Open jonge-1124 opened this issue 2 years ago • 1 comments

While lcok function of ChlLock spins over node which was allocated by other thread, lock function of McsLock spins over self-allocated node.

I've understood that's how McsLock considers NUMA.

However, I think that unlock function of McsLock has to spin over next node which was allocated by other thread. Then, does McsLock get advantage of NUMA consideration on its lock function, but get some trade-off on its unlock function?

jonge-1124 avatar Oct 14 '22 10:10 jonge-1124

I think that unlock function of McsLock has to spin over next node which was allocated by other thread. Then, does McsLock get advantage of NUMA consideration on its lock function, but get some trade-off on its unlock function?

For this, are your asking if it is not NUMA aware in unlock() because it waits on (*node).next? I am not an expert on this field, but in this case, I don't think it is a problem because the value we keep on reading is a field of node, which was allocated by the unlocked thread.

The only time the unlocked thread will access an allocation by another thread is here. Since this access only happens once, I think it is ok.

Now as I said, I'm not an expert on this so I don't know if my answer above is correct. Also, it is not the intend of this course to know such details, so we will not ask such detailed NUMA questions other than what is mentioned in the slide.

Lee-Janggun avatar Oct 14 '22 10:10 Lee-Janggun

Closing as duplicate of #342

Lee-Janggun avatar Dec 20 '22 06:12 Lee-Janggun