  

   ,   - ,  
 mm    . ,  current->mm
     .  copy_mm () -
        -
      fork() .  mm_ struct
    mm_cachep    allocate_mm (). 
   kernel/fork, .     -
   mm_struct     -
.

          
  ,    CLONE_VM  -
  clone  .    .   -
  3, " ",     Linux   
        -
.  Linux       .   
     ,     -
  .

 ,    CLONE_VM,  allocate_mm ()  , 
  mm       
   .     -
     copy_mm ().

if (clone_flags & CLONE_VM) {
/*

* current    

* tsk   ,    fork()

*/

atomic inc (&current->mrn->mrn users);

tsk->mm = current->mm;

}

  

 ,     , -
,    exit_mm().     -
      .  -
  mput (),       
 mm users   .    -
    ,    mmdrop (),
      mm_count.  
      ,  
 free_mm() ,     mm_struct  -
  mm cachep     kmem_cache_free () ,  -
    .

   315