Function Report

Linux Kernel (v4.4)

Source File:kernel\fork.c Create Date:2016-01-14 10:16:32
Last Modify:2016-01-11 07:01:32 Copyright©Brick
home page Tree
Annotate the kernelChinese

Function Name:copy_mm

Function:static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)

Return Type:static int

Parameter:

Type Parameter NameRemarks
unsigned long clone_flags
struct task_struct * tsk

Function description:

953  mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific = mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific = 0
954  context switch counts = context switch counts = 0
956  hung task detection = context switch counts + context switch counts
959  mm = NULL
960  active_mm = NULL
967  oldmm = current process->mm
968  If !oldmm then Returning 0
972  vmacache_flush(tsk)
974  If clone_flags & set if VM shared between processes then
975  increment atomic variable
976  mm = oldmm
977  Go to good_mm
980  retval = -Out of memory
981  mm = Allocate a new mm structure and copy contents from the mm structure of the passed in task structure.
982  If !mm then Go to fail_nomem
985  good_mm
986  mm = mm
987  active_mm = mm
988  Returning 0
990  fail_nomem
991  Returning retval
Caller
Function NameFunction description
copy_processCreate a new process