1. 26 1月, 2008 33 次提交
  2. 20 12月, 2007 1 次提交
  3. 03 12月, 2007 1 次提交
    • S
      sched: cpu accounting controller (V2) · d842de87
      Srivatsa Vaddagiri 提交于
      Commit cfb52856 removed a useful feature for
      us, which provided a cpu accounting resource controller.  This feature would be
      useful if someone wants to group tasks only for accounting purpose and doesnt
      really want to exercise any control over their cpu consumption.
      
      The patch below reintroduces the feature. It is based on Paul Menage's
      original patch (Commit 62d0df64), with
      these differences:
      
              - Removed load average information. I felt it needs more thought (esp
      	  to deal with SMP and virtualized platforms) and can be added for
      	  2.6.25 after more discussions.
              - Convert group cpu usage to be nanosecond accurate (as rest of the cfs
      	  stats are) and invoke cpuacct_charge() from the respective scheduler
      	  classes
      	- Make accounting scalable on SMP systems by splitting the usage
      	  counter to be per-cpu
      	- Move the code from kernel/cpu_acct.c to kernel/sched.c (since the
      	  code is not big enough to warrant a new file and also this rightly
      	  needs to live inside the scheduler. Also things like accessing
      	  rq->lock while reading cpu usage becomes easier if the code lived in
      	  kernel/sched.c)
      
      The patch also modifies the cpu controller not to provide the same accounting
      information.
      Tested-by: NBalbir Singh <balbir@linux.vnet.ibm.com>
      
       Tested the patches on top of 2.6.24-rc3. The patches work fine. Ran
       some simple tests like cpuspin (spin on the cpu), ran several tasks in
       the same group and timed them. Compared their time stamps with
       cpuacct.usage.
      Signed-off-by: NSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
      Signed-off-by: NBalbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d842de87
  4. 25 10月, 2007 2 次提交
    • P
      sched: isolate SMP balancing code a bit more · 681f3e68
      Peter Williams 提交于
      At the moment, a lot of load balancing code that is irrelevant to non
      SMP systems gets included during non SMP builds.
      
      This patch addresses this issue and reduces the binary size on non
      SMP systems:
      
         text    data     bss     dec     hex filename
        10983      28    1192   12203    2fab sched.o.before
        10739      28    1192   11959    2eb7 sched.o.after
      Signed-off-by: NPeter Williams <pwil3058@bigpond.net.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      681f3e68
    • P
      sched: reduce balance-tasks overhead · e1d1484f
      Peter Williams 提交于
      At the moment, balance_tasks() provides low level functionality for both
        move_tasks() and move_one_task() (indirectly) via the load_balance()
      function (in the sched_class interface) which also provides dual
      functionality.  This dual functionality complicates the interfaces and
      internal mechanisms and makes the run time overhead of operations that
      are called with two run queue locks held.
      
      This patch addresses this issue and reduces the overhead of these
      operations.
      Signed-off-by: NPeter Williams <pwil3058@bigpond.net.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e1d1484f
  5. 15 10月, 2007 3 次提交
    • D
      sched: tidy up SCHED_RR · a4ec24b4
      Dmitry Adamushko 提交于
      - make timeslices of SCHED_RR tasks constant and not
      dependent on task's static_prio [1] ;
      - remove obsolete code (timeslice related bits);
      - make sched_rr_get_interval() return something more
      meaningful [2] for SCHED_OTHER tasks.
      
      [1] according to the following link, it's not compliant with SUSv3
      (not sure though, what is the reference for us :-)
      http://lkml.org/lkml/2007/3/7/656
      
      [2] the interval is dynamic and can be depicted as follows "should a
      task be one of the runnable tasks at this particular moment, it would
      expect to run for this interval of time before being re-scheduled by the
      scheduler tick".
      (i.e. it's more precise if a task is runnable at the moment)
      
      yeah, this seems to require task_rq_lock/unlock() but this is not a hot
      path.
      
      results:
      
      (SCHED_FIFO)
      
      dimm@earth:~/storage/prog$ sudo chrt -f 10 ./rr_interval 
      time_slice: 0 : 0
      
      (SCHED_RR)
      
      dimm@earth:~/storage/prog$ sudo chrt 10 ./rr_interval 
      time_slice: 0 : 99984800
      
      (SCHED_NORMAL)
      
      dimm@earth:~/storage/prog$ ./rr_interval 
      time_slice: 0 : 19996960
      
      (SCHED_NORMAL + a cpu_hog of similar 'weight' on the same CPU --- so should be a half of the previous result)
      
      dimm@earth:~/storage/prog$ taskset 1 ./rr_interval 
      time_slice: 0 : 9998480
      Signed-off-by: NDmitry Adamushko <dmitry.adamushko@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a4ec24b4
    • A
      sched: uninline scheduler · a9957449
      Alexey Dobriyan 提交于
      * save ~300 bytes
      * activate_idle_task() was moved to avoid a warning
      
      bloat-o-meter output:
      
      add/remove: 6/0 grow/shrink: 0/16 up/down: 438/-733 (-295)		<===
      function                                     old     new   delta
      __enqueue_entity                               -     165    +165
      finish_task_switch                             -     110    +110
      update_curr_rt                                 -      79     +79
      __load_balance_iterator                        -      32     +32
      __task_rq_unlock                               -      28     +28
      find_process_by_pid                            -      24     +24
      do_sched_setscheduler                        133     123     -10
      sys_sched_rr_get_interval                    176     165     -11
      sys_sched_getparam                           156     145     -11
      normalize_rt_tasks                           482     470     -12
      sched_getaffinity                            112      99     -13
      sys_sched_getscheduler                        86      72     -14
      sched_setaffinity                            226     212     -14
      sched_setscheduler                           666     642     -24
      load_balance_start_fair                       33       9     -24
      load_balance_next_fair                        33       9     -24
      dequeue_task_rt                              133      67     -66
      put_prev_task_rt                              97      28     -69
      schedule_tail                                133      50     -83
      schedule                                     682     594     -88
      enqueue_entity                               499     366    -133
      task_new_fair                                317     180    -137
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a9957449
    • I
      sched: mark scheduling classes as const · 5522d5d5
      Ingo Molnar 提交于
      mark scheduling classes as const. The speeds up the code
      a bit and shrinks it:
      
         text    data     bss     dec     hex filename
        40027    4018     292   44337    ad31 sched.o.before
        40190    3842     292   44324    ad24 sched.o.after
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      5522d5d5