This is related to another question I have already asked: Why does malloc rely on mmap starting from a certain threshold?
I got an answer for most points but we are not sure about if an mmap forces a context switch or not specially for the anonymous case (in the case of file mapping I assume that the process loses that CPU since loading the file from the disk is a time consuming operation)
So my doubts are:
- Does the process lose the CPU when mapping an anonymous page?
- Is there a simple way in Linux to check if the process loses the CPU after a specific system call?