Recall the really important fact we learned earlier in the chapter, in the A brief note on memory allocations and demand paging section: because of the demand paging (or lazy allocation) policy that the OS uses, when a memory page is allocated by malloc(3)(and friends), it only actually causes virtual memory space to be reserved in a region of the process VAS; no physical memory is allocated at this time. Only when you perform some action on any byte(s) of the virtual page – a read, write, or execute – does the MMU raise a page fault (a minor fault) and the OS's page fault handler runs as a result. If it deems that this memory access is legal, it allocates a physical frame (via the page allocator).
In our simple oom_killer_try app, we manipulate this very idea via it's third parameter, force_page_fault: when set as 1, we emulate precisely this situation by writing something...