1

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:

  1. Does the process lose the CPU when mapping an anonymous page?
  2. Is there a simple way in Linux to check if the process loses the CPU after a specific system call?
Community
  • 1
  • 1
rkachach
  • 16,517
  • 6
  • 42
  • 66
  • Calling mmap doesn't load the file from disk. It just arranges for the file to be loaded on-demand when you access certain memory addresses. – Wyzard Oct 15 '15 at 12:47
  • @Wyzard thanks for the clarification. So the process lose the CPU or not in this case? – rkachach Oct 15 '15 at 12:49

0 Answers0