DF
Size: a a a
DF
DF
DF
An ordinary page fault (e.g. if your process needs to allocate a new page due to copy-on-write or to extend the stack or something) will eventually invoke handle_mm_fault. The first thing it does is set the state to TASK_RUNNING. Then it can either allocate a new page immediately, fix up PTEs, etc. (satisfying the page fault) and return to user-mode leaving state as TASK_RUNNING. Or it can block the process until memory is available which, somewhere along the way, will result in a call to schedule(), allowing other processes to run while it's blocked.
Sounds like you want to do essentially the same thing. So just look at what handle_mm_fault is doing
BD
BD
DF
fork()BD
BD
DF
DF
DF
DF
LK
BD
DF
BD
BD
DF
BD
DF