• Nick Piggin's avatar
    [PATCH] sched: cleanup, improve sched <=> fork APIs · 3632d86a
    Nick Piggin authored
    Move balancing and child-runs-first logic from fork.c into sched.c where
    it belongs.
    
    * Consolidate wake_up_forked_process and wake_up_forked_thread into
      wake_up_new_process, and pass in clone_flags as suggested by Linus.  This
      removes a lot of code duplication and allows all logic to be handled in that
      function.
    
    * Don't do balance-on-clone balancing for vfork'ed threads.
    
    * Don't do set_task_cpu or balance one clone in wake_up_new_process. 
      Instead do it in sched_fork to fix set_cpus_allowed races.
    
    * Don't do child-runs-first for CLONE_VM processes, as there is obviously no
      COW benifit to be had.  This is a big one, it enables Andi's workload to run
      well without clone balancing, because the OpenMP child threads can get
      balanced off to other nodes *before* they start running and allocating
      memory.
    
    * Rename sched_balance_exec to sched_exec: hide the policy from the API.
    
    
    From: Ingo Molnar <mingo@elte.hu>
    
      rename wake_up_new_process -> wake_up_new_task.
    
      in sched.c we are gradually moving away from the overloaded 'process' or
      'thread' notion to the traditional task (or context) naming.
    Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    3632d86a
fork.c 31.4 KB