1. 24 Aug, 2004 14 commits
    • Matthew Dobson's avatar
      [PATCH] Create cpu_sibling_map for PPC64 · 0c5af7c6
      Matthew Dobson authored
      In light of some proposed changes in the sched_domains code, I coded up
      this little ditty that simply creates and populates a cpu_sibling_map for
      PPC64 machines.  The patch just checks the CPU flags to determine if the
      CPU supports SMT (aka Hyper-Threading aka Multi-Threading aka ...) and
      fills in a mask of the siblings for each CPU in the system.  This should
      allow us to build sched_domains for PPC64 with generic code in
      kernel/sched.c for the SMT systems.  SMT is becoming more popular and is
      turning up in more and more architectures.  I don't think it will be too
      long until this feature is supported by most arches...
      Signed-off-by: default avatarMatthew Dobson <colpatch@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0c5af7c6
    • Dimitri Sivanich's avatar
      [PATCH] sched: isolated sched domains · 6f4c30b1
      Dimitri Sivanich authored
      Here's a version of the isolated scheduler domain code that I mentioned in
      an RFC on 7/22.  This patch applies on top of 2.6.8-rc2-mm1 (to include all
      of the new arch_init_sched_domain code).  This patch also contains the 2
      line fix to remove the check of first_cpu(sd->groups->cpumask)) that Jesse
      sent in earlier.
      
      Note that this has not been tested with CONFIG_SCHED_SMT.  I hope that my
      handling of those instances is OK.
      Signed-off-by: default avatarDimitri Sivanich <sivanich@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6f4c30b1
    • Jesse Barnes's avatar
      [PATCH] sched: limit cpuspan of node scheduler domains · c183e253
      Jesse Barnes authored
        This patch limits the cpu span of each node's scheduler domain to prevent
        balancing across too many cpus.  The cpus included in a node's domain are
        determined by the SD_NODES_PER_DOMAIN define and the arch specific
        sched_domain_node_span routine if ARCH_HAS_SCHED_DOMAIN is defined.  If
        ARCH_HAS_SCHED_DOMAIN is not defined, behavior is unchanged--all possible
        cpus will be included in each node's scheduling domain.  Currently, only
        ia64 provides an arch specific sched_domain_node_span routine.
      
      From: Jesse Barnes <jbarnes@engr.sgi.com>
      
        This patch adds some more NUMA specific logic to the creation of scheduler
        domains.  Domains spanning all CPUs in a large system are too large to
        schedule across efficiently, leading to livelocks and inordinate amounts of
        time being spent in scheduler routines.  With this patch applied, the node
        scheduling domains for NUMA platforms will only contain a specified number
        of nearby CPUs, based on the value of SD_NODES_PER_DOMAIN.  It also allows
        arches to override SD_NODE_INIT, which sets the domain scheduling parameters
        for each node's domain.  This is necessary especially for large systems.
      
        Possible future directions:
      
        o multilevel node hierarchy (e.g.  node domains could contain 4 nodes
          worth of CPUs, supernode domains could contain 32 nodes worth, etc.  each
          with their own SD_NODE_INIT values)
      
        o more tweaking of SD_NODE_INIT values for good load balancing vs. 
          overhead tradeoffs
      
      From: mita akinobu <amgta@yacht.ocn.ne.jp>
      
        Compile fix
      Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
      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>
      c183e253
    • Nick Piggin's avatar
      [PATCH] sched: consolidate sched domains · 8a7a2318
      Nick Piggin authored
        Teach the generic domains builder about SMT, and consolidate all
        architecture specific domain code into that.  Also, the SD_*_INIT macros can
        now be redefined by arch code without duplicating the entire setup code. 
        This can be done by defining ARCH_HASH_SCHED_TUNE.
      
        The generic builder has been simplified with the addition of a helper
        macro which will probably prove to be useful to arch specific code as well
        and should be exported if that is the case.
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      
      From: Matthew Dobson <colpatch@us.ibm.com>
      
        The attached patch is against 2.6.8-rc2-mm2, and removes Nick's
        conditional definition & population of cpu_sibling_map[] in favor of my
        unconditional ones.  This does not affect how cpu_sibling_map is used, just
        gives it broader scope.
      
      From: Nick Piggin <nickpiggin@yahoo.com.au>
      
        Small fix to sched-consolidate-domains.patch picked up by
      
      From: Suresh <suresh.b.siddha@intel.com>
      
        another sched consolidate domains fix
      
      From: Nick Piggin <nickpiggin@yahoo.com.au>
      
        Don't use cpu_sibling_map if !CONFIG_SCHED_SMT
      
        This one spotted by Dimitri Sivanich <sivanich@sgi.com>
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8a7a2318
    • Ingo Molnar's avatar
      [PATCH] sched: fork hotplug hanling cleanup · c62e7cdb
      Ingo Molnar authored
      - remove the hotplug lock from around much of fork(), and re-copy the
        cpus_allowed mask to solve the hotplug race cleanly.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c62e7cdb
    • Nick Piggin's avatar
      [PATCH] sched: remove balance on clone · c15d3bea
      Nick Piggin authored
      This removes balance on clone capability altogether.  I told Andi we wouldn't
      remove it yet, but provided it is in a single small patch, he mightn't get too
      upset.
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c15d3bea
    • Nick Piggin's avatar
      [PATCH] sched: disable balance on clone · b4f14b64
      Nick Piggin authored
      Don't balance on clone by default.
      
      Balance on clone has a number of trivial performance failure cases, but it was
      needed to get decent OpenMP performance on NUMA (Opteron) systems.  Not doing
      child-runs-first for new threads also solves this problem in a nicer way
      (implemented in a previous patch).
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b4f14b64
    • Nick Piggin's avatar
      [PATCH] sched: sched misc changes · 8a78765b
      Nick Piggin authored
      Add some likely/unliklies, a for_each_cpu => for_each_cpu_online, and close
      the sched_exit race.
      
      From: Ingo Molnar <mingo@elte.hu>
      
        fix a typo in a previous patch breaking RT scheduling & interactivity.
      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>
      8a78765b
    • Nick Piggin's avatar
      [PATCH] sched: make rt_task unlikely · 0df0d063
      Nick Piggin authored
      From: Ingo Molnar <mingo@elte.hu>
      
      RT tasks are unlikely, move this into rt_task() instead of open-coding it.
      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>
      0df0d063
    • Ingo Molnar's avatar
      [PATCH] sched: misc cleanups #2 · ce9bb66d
      Ingo Molnar authored
       - fix two stale comments
       - cleanup
      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>
      ce9bb66d
    • Nick Piggin's avatar
      [PATCH] kernel thread idle fix · 49717553
      Nick Piggin authored
      Now that init_idle does not remove tasks from the runqueue, those
      architectures that use kernel_thread instead of copy_process for the idle
      task will break.  To fix, ensure that CLONE_IDLETASK tasks are not put on
      the runqueue in the first place.
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      49717553
    • 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
    • Nick Piggin's avatar
      [PATCH] sched: cleanup init_idle() · 70a0b8e7
      Nick Piggin authored
      Clean up init_idle to not use wake_up_forked_process, then undo all the stuff
      that call does.  Instead, do everything in init_idle.
      
      Make double_rq_lock depend on CONFIG_SMP because it is no longer used on UP.
      Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      70a0b8e7
    • Ingo Molnar's avatar
      [PATCH] sched: fix timeslice calculations for HZ=1000. · b2a0e913
      Ingo Molnar authored
      The main benefit is that with the default HZ=1000 nice +19 tasks now get 5
      msecs of timeslices, so the ratio of CPU use is linear.  (nice 0 task gets
      20 times more CPU time than a nice 19 task.  Prior this change the ratio
      was 1:10)
      
      another effect is that nice 0 tasks now get a round 100 msecs of timeslices
      (as intended), instead of 102 msecs.
      
      here's a table of old/new timeslice values, for HZ=1000 and 100:
      
                            HZ=1000         (   HZ=100   )
                          old    new        ( old    new )
      
              nice -20:   200    200        ( 200    200 )
              nice -19:   195    195        ( 190    190 )
              ...
              nice 0:     102    100        ( 100    100 )
              nice 1:      97     95        (  90     90 )
              nice 2:      92     90        (  90     90 )
              ...
              nice 17:     19     15        (  10     10 )
              nice 18:     14     10        (  10     10 )
              nice 19:     10      5        (  10     10 )
      
      i've tested the patch on x86.
      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>
      b2a0e913
  2. 23 Aug, 2004 26 commits