1. 09 8月, 2007 33 次提交
    • I
      sched: round a bit better · 194081eb
      Ingo Molnar 提交于
      round a tiny bit better in high-frequency rescheduling scenarios,
      by rounding around zero instead of rounding down.
      
      (this is pretty theoretical though)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      194081eb
    • I
      sched: make the multiplication table more accurate · 254753dc
      Ingo Molnar 提交于
      do small deltas in the weight and multiplication constant table so
      that the worst-case numeric error is better than 1:100000000. (8 digits)
      
      the current error table is:
      
           nice       mult *   inv_mult   error
           ------------------------------------------
           -20:      88761 *      48388  -0.0000000065
           -19:      71755 *      59856  -0.0000000037
           -18:      56483 *      76040   0.0000000056
           -17:      46273 *      92818   0.0000000042
           -16:      36291 *     118348  -0.0000000065
           -15:      29154 *     147320  -0.0000000037
           -14:      23254 *     184698  -0.0000000009
           -13:      18705 *     229616  -0.0000000037
           -12:      14949 *     287308  -0.0000000009
           -11:      11916 *     360437  -0.0000000009
           -10:       9548 *     449829  -0.0000000009
            -9:       7620 *     563644  -0.0000000037
            -8:       6100 *     704093   0.0000000009
            -7:       4904 *     875809   0.0000000093
            -6:       3906 *    1099582  -0.0000000009
            -5:       3121 *    1376151  -0.0000000058
            -4:       2501 *    1717300   0.0000000009
            -3:       1991 *    2157191  -0.0000000035
            -2:       1586 *    2708050   0.0000000009
            -1:       1277 *    3363326   0.0000000014
             0:       1024 *    4194304   0.0000000000
             1:        820 *    5237765   0.0000000009
             2:        655 *    6557202   0.0000000033
             3:        526 *    8165337  -0.0000000079
             4:        423 *   10153587   0.0000000012
             5:        335 *   12820798   0.0000000079
             6:        272 *   15790321   0.0000000037
             7:        215 *   19976592  -0.0000000037
             8:        172 *   24970740  -0.0000000037
             9:        137 *   31350126  -0.0000000079
            10:        110 *   39045157  -0.0000000061
            11:         87 *   49367440  -0.0000000037
            12:         70 *   61356676   0.0000000056
            13:         56 *   76695844  -0.0000000075
            14:         45 *   95443717  -0.0000000072
            15:         36 *  119304647  -0.0000000009
            16:         29 *  148102320  -0.0000000037
            17:         23 *  186737708  -0.0000000028
            18:         18 *  238609294  -0.0000000009
            19:         15 *  286331153  -0.0000000002
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      254753dc
    • I
      sched: optimize update_rq_clock() calls in the load-balancer · 6e82a3be
      Ingo Molnar 提交于
      optimize update_rq_clock() calls in the load-balancer: update them
      right after locking the runqueue(s) so that the pull functions do
      not have to call it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6e82a3be
    • I
      sched: optimize activate_task() · 2daa3577
      Ingo Molnar 提交于
      optimize activate_task() by removing update_rq_clock() from it.
      (and add update_rq_clock() to all callsites of activate_task() that
      did not have it before.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2daa3577
    • I
      sched: move the __update_rq_clock() call to scheduler_tick() · 546fe3c9
      Ingo Molnar 提交于
      move the __update_rq_clock() call from update_cpu_load() to
      scheduler_tick().
      
      ( identity transformation that causes no change in functionality. )
      
      this allows the direct use of rq->clock in ->task_tick() functions.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      546fe3c9
    • I
      sched: remove the 'u64 now' local variables · bdd4dfa8
      Ingo Molnar 提交于
      final step: remove all (now superfluous) 'u64 now' variables.
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bdd4dfa8
    • I
      sched: remove the 'u64 now' parameter from deactivate_task() · 2e1cb74a
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from deactivate_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2e1cb74a
    • I
      sched: remove the 'u64 now' parameter from dequeue_task() · 69be72c1
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from dequeue_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      69be72c1
    • I
      sched: remove the 'u64 now' parameter from enqueue_task() · 8159f87e
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from enqueue_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8159f87e
    • I
      sched: remove the 'u64 now' parameter from dec_nr_running() · db53181e
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from dec_nr_running().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      db53181e
    • I
      sched: remove the 'u64 now' parameter from inc_nr_running() · e5fa2237
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from inc_nr_running().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e5fa2237
    • I
      sched: remove the 'u64 now' parameter from dec_load() · 79b5dddf
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from dec_load().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      79b5dddf
    • I
      sched: remove the 'u64 now' parameter from inc_load() · 29b4b623
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from inc_load().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      29b4b623
    • I
      sched: remove the 'u64 now' parameter from update_curr_load() · 84a1d7a2
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from update_curr_load().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      84a1d7a2
    • I
      sched: remove the 'u64 now' parameter from ->task_new() · ee0827d8
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from ->task_new().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ee0827d8
    • I
      sched: remove the 'u64 now' parameter from ->put_prev_task() · 31ee529c
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from ->put_prev_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      31ee529c
    • I
      sched: remove the 'u64 now' parameter from pick_next_task() · ff95f3df
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from pick_next_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ff95f3df
    • I
      sched: remove the 'u64 now' parameter from ->pick_next_task() · fb8d4724
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from ->pick_next_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fb8d4724
    • I
      sched: remove the 'u64 now' parameter from ->dequeue_task() · f02231e5
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from ->dequeue_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f02231e5
    • I
      sched: remove the 'u64 now' parameter from ->enqueue_task() · fd390f6a
      Ingo Molnar 提交于
      remove the 'u64 now' parameter from ->enqueue_task().
      
      ( identity transformation that causes no change in functionality. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fd390f6a
    • I
      sched: remove 'now' use from assignments · d281918d
      Ingo Molnar 提交于
      change all 'now' timestamp uses in assignments to rq->clock.
      
      ( this is an identity transformation that causes no functionality change:
        all such new rq->clock is necessarily preceded by an update_rq_clock()
        call. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d281918d
    • I
      sched: remove __rq_clock() · eb594494
      Ingo Molnar 提交于
      remove the (now unused) __rq_clock() function.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      eb594494
    • I
      sched: eliminate __rq_clock() use · c1b3da3e
      Ingo Molnar 提交于
      eliminate __rq_clock() use by changing it to:
      
         __update_rq_clock(rq)
         now = rq->clock;
      
      identity transformation - no change in behavior.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c1b3da3e
    • I
      sched: remove rq_clock() · 2ab81159
      Ingo Molnar 提交于
      remove the now unused rq_clock() function.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2ab81159
    • I
      sched: eliminate rq_clock() use · a8e504d2
      Ingo Molnar 提交于
      eliminate rq_clock() use by changing it to:
      
         update_rq_clock(rq)
         now = rq->clock;
      
      identity transformation - no change in behavior.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a8e504d2
    • I
      sched: add [__]update_rq_clock(rq) · b04a0f4c
      Ingo Molnar 提交于
      add the [__]update_rq_clock(rq) functions. (No change in functionality,
      just reorganization to prepare for elimination of the heavy 64-bit
      timestamp-passing in the scheduler.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b04a0f4c
    • P
      sched: fix bug in balance_tasks() · a4ac01c3
      Peter Williams 提交于
      There are two problems with balance_tasks() and how it used:
      
      1. The variables best_prio and best_prio_seen (inherited from the old
      move_tasks()) were only required to handle problems caused by the
      active/expired arrays, the order in which they were processed and the
      possibility that the task with the highest priority could be on either.
        These issues are no longer present and the extra overhead associated
      with their use is unnecessary (and possibly wrong).
      
      2. In the absence of CONFIG_FAIR_GROUP_SCHED being set, the same
      this_best_prio variable needs to be used by all scheduling classes or
      there is a risk of moving too much load.  E.g. if the highest priority
      task on this at the beginning is a fairly low priority task and the rt
      class migrates a task (during its turn) then that moved task becomes the
      new highest priority task on this_rq but when the sched_fair class
      initializes its copy of this_best_prio it will get the priority of the
      original highest priority task as, due to the run queue locks being
      held, the reschedule triggered by pull_task() will not have taken place.
        This could result in inappropriate overriding of skip_for_load and
      excessive load being moved.
      
      The attached patch addresses these problems by deleting all reference to
      best_prio and best_prio_seen and making this_best_prio a reference
      parameter to the various functions involved.
      
      load_balance_fair() has also been modified so that this_best_prio is
      only reset (in the loop) if CONFIG_FAIR_GROUP_SCHED is set.  This should
      preserve the effect of helping spread groups' higher priority tasks
      around the available CPUs while improving system performance when
      CONFIG_FAIR_GROUP_SCHED isn't set.
      Signed-off-by: NPeter Williams <pwil3058@bigpond.net.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a4ac01c3
    • A
      sched: remove binary sysctls from kernel.sched_domain · e0361851
      Alexey Dobriyan 提交于
      kernel.sched_domain hierarchy is under CTL_UNNUMBERED and thus
      unreachable to sysctl(2). Generating .ctl_number's in such situation is
      not useful.
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e0361851
    • I
      sched: schedule() speedup · 8e717b19
      Ingo Molnar 提交于
      speed up schedule(): share the 'now' parameter that deactivate_task()
      was calculating internally.
      
      ( this also fixes the small accounting window between the deactivate
        call and the pick_next_task() call. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8e717b19
    • I
      sched: uninline rq_clock() · 7bfd0485
      Ingo Molnar 提交于
      uninline rq_clock() to save 263 bytes of code:
      
         text    data     bss     dec     hex filename
         39561    3642      24   43227    a8db sched.o.before
         39298    3642      24   42964    a7d4 sched.o.after
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7bfd0485
    • U
      sched: clean up sched_getaffinity() · 9531b62f
      Ulrich Drepper 提交于
      here's another tiny cleanup.  The generated code is not affected (gcc is
      smart enough) but for people looking over the code it is just irritating
      to have the extra conditional.
      Signed-off-by: NUlrich Drepper <drepper@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9531b62f
    • P
      sched: simplify move_tasks() · 43010659
      Peter Williams 提交于
      The move_tasks() function is currently multiplexed with two distinct
      capabilities:
      
      1. attempt to move a specified amount of weighted load from one run
      queue to another; and
      2. attempt to move a specified number of tasks from one run queue to
      another.
      
      The first of these capabilities is used in two places, load_balance()
      and load_balance_idle(), and in both of these cases the return value of
      move_tasks() is used purely to decide if tasks/load were moved and no
      notice of the actual number of tasks moved is taken.
      
      The second capability is used in exactly one place,
      active_load_balance(), to attempt to move exactly one task and, as
      before, the return value is only used as an indicator of success or failure.
      
      This multiplexing of sched_task() was introduced, by me, as part of the
      smpnice patches and was motivated by the fact that the alternative, one
      function to move specified load and one to move a single task, would
      have led to two functions of roughly the same complexity as the old
      move_tasks() (or the new balance_tasks()).  However, the new modular
      design of the new CFS scheduler allows a simpler solution to be adopted
      and this patch addresses that solution by:
      
      1. adding a new function, move_one_task(), to be used by
      active_load_balance(); and
      2. making move_tasks() a single purpose function that tries to move a
      specified weighted load and returns 1 for success and 0 for failure.
      
      One of the consequences of these changes is that neither move_one_task()
      or the new move_tasks() care how many tasks sched_class.load_balance()
      moves and this enables its interface to be simplified by returning the
      amount of load moved as its result and removing the load_moved pointer
      from the argument list.  This helps simplify the new move_tasks() and
      slightly reduces the amount of work done in each of
      sched_class.load_balance()'s implementations.
      
      Further simplification, e.g. changes to balance_tasks(), are possible
      but (slightly) complicated by the special needs of load_balance_fair()
      so I've left them to a later patch (if this one gets accepted).
      
      NB Since move_tasks() gets called with two run queue locks held even
      small reductions in overhead are worthwhile.
      
      [ mingo@elte.hu ]
      
      this change also reduces code size nicely:
      
         text    data     bss     dec     hex filename
         39216    3618      24   42858    a76a sched.o.before
         39173    3618      24   42815    a73f sched.o.after
      Signed-off-by: NPeter Williams <pwil3058@bigpond.net.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      43010659
    • I
      sched: reorder update_cpu_load(rq) with the ->task_tick() call · f1a438d8
      Ingo Molnar 提交于
      Peter Williams suggested to flip the order of update_cpu_load(rq) with
      the ->task_tick() call. This is a NOP for the current scheduler (the
      two functions are independent of each other), ->task_tick() might
      create some state for update_cpu_load() in the future (or in PlugSched).
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f1a438d8
  2. 02 8月, 2007 7 次提交