1. 10 11月, 2007 15 次提交
    • A
      sched: proper prototype for kernel/sched.c:migration_init() · e6fe6649
      Adrian Bunk 提交于
      This patch adds a proper prototype for migration_init() in
      include/linux/sched.h
      
      Since there's no point in always returning 0 to a caller that doesn't check
      the return value it also changes the function to return void.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e6fe6649
    • P
      sched: avoid large irq-latencies in smp-balancing · b82d9fdd
      Peter Zijlstra 提交于
      SMP balancing is done with IRQs disabled and can iterate the full rq.
      When rqs are large this can cause large irq-latencies. Limit the nr of
      iterations on each run.
      
      This fixes a scheduling latency regression reported by the -rt folks.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Tested-by: NGregory Haskins <ghaskins@novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b82d9fdd
    • S
      sched: fix copy_namespace() <-> sched_fork() dependency in do_fork · 3c90e6e9
      Srivatsa Vaddagiri 提交于
      Sukadev Bhattiprolu reported a kernel crash with control groups.
      There are couple of problems discovered by Suka's test:
      
      - The test requires the cgroup filesystem to be mounted with
        atleast the cpu and ns options (i.e both namespace and cpu 
        controllers are active in the same hierarchy). 
      
      	# mkdir /dev/cpuctl
      	# mount -t cgroup -ocpu,ns none cpuctl
      	(or simply)
      	# mount -t cgroup none cpuctl -> Will activate all controllers
      					 in same hierarchy.
      
      - The test invokes clone() with CLONE_NEWNS set. This causes a a new child
        to be created, also a new group (do_fork->copy_namespaces->ns_cgroup_clone->
        cgroup_clone) and the child is attached to the new group (cgroup_clone->
        attach_task->sched_move_task). At this point in time, the child's scheduler 
        related fields are uninitialized (including its on_rq field, which it has
        inherited from parent). As a result sched_move_task thinks its on
        runqueue, when it isn't.
      
        As a solution to this problem, I moved sched_fork() call, which
        initializes scheduler related fields on a new task, before
        copy_namespaces(). I am not sure though whether moving up will
        cause other side-effects. Do you see any issue?
      
      - The second problem exposed by this test is that task_new_fair()
        assumes that parent and child will be part of the same group (which 
        needn't be as this test shows). As a result, cfs_rq->curr can be NULL
        for the child.
      
        The solution is to test for curr pointer being NULL in
        task_new_fair().
      
      With the patch below, I could run ns_exec() fine w/o a crash.
      Reported-by: NSukadev Bhattiprolu <sukadev@us.ibm.com>
      Signed-off-by: NSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3c90e6e9
    • I
      sched: clean up the wakeup preempt check, #2 · 502d26b5
      Ingo Molnar 提交于
      clean up the preemption check to not use unnecessary 64-bit
      variables. This improves code size:
      
         text    data     bss     dec     hex filename
        44227    3326      36   47589    b9e5 sched.o.before
        44201    3326      36   47563    b9cb sched.o.after
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      502d26b5
    • I
      sched: clean up the wakeup preempt check · 77d9cc44
      Ingo Molnar 提交于
      clean up the wakeup preemption check. No code changed:
      
         text    data     bss     dec     hex filename
        44227    3326      36   47589    b9e5 sched.o.before
        44227    3326      36   47589    b9e5 sched.o.after
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      77d9cc44
    • I
      sched: wakeup preemption fix · 8bc6767a
      Ingo Molnar 提交于
      wakeup preemption fix: do not make it dependent on p->prio.
      Preemption purely depends on ->vruntime.
      
      This improves preemption in mixed-nice-level workloads.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8bc6767a
    • I
      sched: remove PREEMPT_RESTRICT · 3e3e13f3
      Ingo Molnar 提交于
      remove PREEMPT_RESTRICT. (this is a separate commit so that any
      regression related to the removal itself is bisectable)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3e3e13f3
    • I
      sched: turn off PREEMPT_RESTRICT · 52d3da1a
      Ingo Molnar 提交于
      PREEMPT_RESTRICT was a method aimed at reducing the amount of wakeup
      related preemption. It has a disadvantage though, it can prevent
      legitimate wakeups if a task is 'unlucky' to be hit too early by a tick
      that clears peer_preempt.
      
      Now that the wakeup preemption has been cleaned up we dont seem to have
      excessive preemptions anymore, so this feature can be turned off. (and
      removed in the next patch)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      52d3da1a
    • E
      sched: cleanup, use NSEC_PER_MSEC and NSEC_PER_SEC · d6322faf
      Eric Dumazet 提交于
      1) hardcoded 1000000000 value is used five times in places where
         NSEC_PER_SEC might be more readable.
      
      2) A conversion from nsec to msec uses the hardcoded 1000000 value,
         which is a candidate for NSEC_PER_MSEC.
      
      no code changed:
      
          text    data     bss     dec     hex filename
         44359    3326      36   47721    ba69 sched.o.before
         44359    3326      36   47721    ba69 sched.o.after
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d6322faf
    • I
      sched: reintroduce SMP tunings again · 19978ca6
      Ingo Molnar 提交于
      Yanmin Zhang reported an aim7 regression and bisected it down to:
      
       |  commit 38ad464d
       |  Author: Ingo Molnar <mingo@elte.hu>
       |  Date:   Mon Oct 15 17:00:02 2007 +0200
       |
       |     sched: uniform tunings
       |
       |     use the same defaults on both UP and SMP.
      
      fix this by reintroducing similar SMP tunings again. This resolves
      the regression.
      
      (also update the comments to match the ilog2(nr_cpus) tuning effect)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      19978ca6
    • P
      sched: restore deterministic CPU accounting on powerpc · fa13a5a1
      Paul Mackerras 提交于
      Since powerpc started using CONFIG_GENERIC_CLOCKEVENTS, the
      deterministic CPU accounting (CONFIG_VIRT_CPU_ACCOUNTING) has been
      broken on powerpc, because we end up counting user time twice: once in
      timer_interrupt() and once in update_process_times().
      
      This fixes the problem by pulling the code in update_process_times
      that updates utime and stime into a separate function called
      account_process_tick.  If CONFIG_VIRT_CPU_ACCOUNTING is not defined,
      there is a version of account_process_tick in kernel/timer.c that
      simply accounts a whole tick to either utime or stime as before.  If
      CONFIG_VIRT_CPU_ACCOUNTING is defined, then arch code gets to
      implement account_process_tick.
      
      This also lets us simplify the s390 code a bit; it means that the s390
      timer interrupt can now call update_process_times even when
      CONFIG_VIRT_CPU_ACCOUNTING is turned on, and can just implement a
      suitable account_process_tick().
      
      account_process_tick() now takes the task_struct * as an argument.
      Tested both with and without CONFIG_VIRT_CPU_ACCOUNTING.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fa13a5a1
    • B
      sched: fix delay accounting regression · 9a41785c
      Balbir Singh 提交于
      Fix the delay accounting regression introduced by commit
      75d4ef16. rq no longer has sched_info
      data associated with it. task_struct sched_info structure is used by delay
      accounting to provide back statistics to user space.
      
      also remove direct use of sched_clock() (which is not a valid thing to
      do anymore) and use rq->clock instead.
      Signed-off-by: NBalbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9a41785c
    • P
      sched: reintroduce the sched_min_granularity tunable · b2be5e96
      Peter Zijlstra 提交于
      we lost the sched_min_granularity tunable to a clever optimization
      that uses the sched_latency/min_granularity ratio - but the ratio
      is quite unintuitive to users and can also crash the kernel if the
      ratio is set to 0. So reintroduce the min_granularity tunable,
      while keeping the ratio maintained internally.
      
      no functionality changed.
      
      [ mingo@elte.hu: some fixlets. ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b2be5e96
    • P
      sched: documentation: place_entity() comments · 2cb8600e
      Peter Zijlstra 提交于
      Add a few comments to place_entity(). No code changed.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2cb8600e
    • P
      sched: fix vslice · 10b77724
      Peter Zijlstra 提交于
      vslice was missing a factor NICE_0_LOAD, as weight is in
      weight*NICE_0_LOAD units.
      
      the effect of this bug was larger initial slices and
      thus latency-noisier forks.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      10b77724
  2. 06 11月, 2007 2 次提交
  3. 05 11月, 2007 1 次提交
  4. 31 10月, 2007 1 次提交
  5. 30 10月, 2007 9 次提交
  6. 29 10月, 2007 5 次提交
  7. 26 10月, 2007 1 次提交
  8. 25 10月, 2007 6 次提交
    • P
      sched: fix unconditional irq lock · ab63a633
      Peter Zijlstra 提交于
      Lockdep noticed that this lock can also be taken from hardirq context, and can
      thus not unconditionally disable/enable irqs.
      
       WARNING: at kernel/lockdep.c:2033 trace_hardirqs_on()
        [show_trace_log_lvl+26/48] show_trace_log_lvl+0x1a/0x30
        [show_trace+18/32] show_trace+0x12/0x20
        [dump_stack+22/32] dump_stack+0x16/0x20
        [trace_hardirqs_on+405/416] trace_hardirqs_on+0x195/0x1a0
        [_read_unlock_irq+34/48] _read_unlock_irq+0x22/0x30
        [sched_debug_show+2615/4224] sched_debug_show+0xa37/0x1080
        [show_state_filter+326/368] show_state_filter+0x146/0x170
        [sysrq_handle_showstate+10/16] sysrq_handle_showstate+0xa/0x10
        [__handle_sysrq+123/288] __handle_sysrq+0x7b/0x120
        [handle_sysrq+40/64] handle_sysrq+0x28/0x40
        [kbd_event+1045/1680] kbd_event+0x415/0x690
        [input_pass_event+206/208] input_pass_event+0xce/0xd0
        [input_handle_event+170/928] input_handle_event+0xaa/0x3a0
        [input_event+95/112] input_event+0x5f/0x70
        [atkbd_interrupt+434/1456] atkbd_interrupt+0x1b2/0x5b0
        [serio_interrupt+59/128] serio_interrupt+0x3b/0x80
        [i8042_interrupt+263/576] i8042_interrupt+0x107/0x240
        [handle_IRQ_event+40/96] handle_IRQ_event+0x28/0x60
        [handle_edge_irq+175/320] handle_edge_irq+0xaf/0x140
        [do_IRQ+64/128] do_IRQ+0x40/0x80
        [common_interrupt+46/52] common_interrupt+0x2e/0x34
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ab63a633
    • 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
    • A
      sched: make cpu_shares_{show,store}() static · a0f846aa
      Adrian Bunk 提交于
      cpu_shares_{show,store}() can become static.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a0f846aa
    • P
      sched: clean up some control group code · 2b01dfe3
      Paul Menage 提交于
      - replace "cont" with "cgrp" in a few places in the CFS cgroup code, 
      - use write_uint rather than write for cpu.shares write function
      Signed-off-by: NPaul Menage <menage@google.com>
      Acked-by : Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2b01dfe3
    • M
      sched: document profile=sleep requiring CONFIG_SCHEDSTATS · b3da2a73
      Mel Gorman 提交于
      profile=sleep only works if CONFIG_SCHEDSTATS is set. This patch notes
      the limitation in Documentation/kernel-parameters.txt and prints a
      warning at boot-time if profile=sleep is used without CONFIG_SCHEDSTAT.
      Signed-off-by: NMel Gorman <mel@csn.ul.ie>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b3da2a73