1. 04 12月, 2015 15 次提交
  2. 23 11月, 2015 9 次提交
  3. 09 11月, 2015 1 次提交
  4. 23 10月, 2015 1 次提交
  5. 20 10月, 2015 7 次提交
  6. 16 10月, 2015 1 次提交
    • T
      cgroup: keep zombies associated with their original cgroups · 2e91fa7f
      Tejun Heo 提交于
      cgroup_exit() is called when a task exits and disassociates the
      exiting task from its cgroups and half-attach it to the root cgroup.
      This is unnecessary and undesirable.
      
      No controller actually needs an exiting task to be disassociated with
      non-root cgroups.  Both cpu and perf_event controllers update the
      association to the root cgroup from their exit callbacks just to keep
      consistent with the cgroup core behavior.
      
      Also, this disassociation makes it difficult to track resources held
      by zombies or determine where the zombies came from.  Currently, pids
      controller is completely broken as it uncharges on exit and zombies
      always escape the resource restriction.  With cgroup association being
      reset on exit, fixing it is pretty painful.
      
      There's no reason to reset cgroup membership on exit.  The zombie can
      be removed from its css_set so that it doesn't show up on
      "cgroup.procs" and thus can't be migrated or interfere with cgroup
      removal.  It can still pin and point to the css_set so that its cgroup
      membership is maintained.  This patch makes cgroup core keep zombies
      associated with their cgroups at the time of exit.
      
      * Previous patches decoupled populated_cnt tracking from css_set
        lifetime, so a dying task can be simply unlinked from its css_set
        while pinning and pointing to the css_set.  This keeps css_set
        association from task side alive while hiding it from "cgroup.procs"
        and populated_cnt tracking.  The css_set reference is dropped when
        the task_struct is freed.
      
      * ->exit() callback no longer needs the css arguments as the
        associated css never changes once PF_EXITING is set.  Removed.
      
      * cpu and perf_events controllers no longer need ->exit() callbacks.
        There's no reason to explicitly switch away on exit.  The final
        schedule out is enough.  The callbacks are removed.
      
      * On traditional hierarchies, nothing changes.  "/proc/PID/cgroup"
        still reports "/" for all zombies.  On the default hierarchy,
        "/proc/PID/cgroup" keeps reporting the cgroup that the task belonged
        to at the time of exit.  If the cgroup gets removed before the task
        is reaped, " (deleted)" is appended.
      
      v2: Build brekage due to missing dummy cgroup_free() when
          !CONFIG_CGROUP fixed.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      2e91fa7f
  7. 12 10月, 2015 1 次提交
  8. 07 10月, 2015 1 次提交
  9. 06 10月, 2015 4 次提交
    • X
      sched/core: Remove a parameter in the migrate_task_rq() function · 5a4fd036
      xiaofeng.yan 提交于
      The parameter "int next_cpu" in the following function is unused:
      
        migrate_task_rq(struct task_struct *p, int next_cpu)
      
      Remove it.
      Signed-off-by: Nxiaofeng.yan <yanxiaofeng@inspur.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1442991360-31945-1-git-send-email-yanxiaofeng@inspur.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      5a4fd036
    • G
      sched/core: Drop unlikely behind BUG_ON() · ce03e413
      Geliang Tang 提交于
      (1) For !CONFIG_BUG cases, the bug call is a no-op, so we couldn't care
          less and the change is ok.
      
      (2) PPC and MIPS, which HAVE_ARCH_BUG_ON, do not rely on branch predictions
          as it seems to be pointless [1] and thus callers should not be trying to
          push an optimization in the first place.
      
      (3) For CONFIG_BUG and !HAVE_ARCH_BUG_ON cases, BUG_ON() contains an
          unlikely compiler flag already.
      
      Hence, we can drop unlikely behind BUG_ON().
      
        [1] http://lkml.iu.edu/hypermail/linux/kernel/1101.3/02289.htmlSigned-off-by: NGeliang Tang <geliangtang@163.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/6fa7125979f98bbeac26e268271769b6ca935c8d.1444051018.git.geliangtang@163.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      ce03e413
    • P
      sched/core: Fix task and run queue sched_info::run_delay inconsistencies · 1de64443
      Peter Zijlstra 提交于
      Mike Meyer reported the following bug:
      
      > During evaluation of some performance data, it was discovered thread
      > and run queue run_delay accounting data was inconsistent with the other
      > accounting data that was collected.  Further investigation found under
      > certain circumstances execution time was leaking into the task and
      > run queue accounting of run_delay.
      >
      > Consider the following sequence:
      >
      >     a. thread is running.
      >     b. thread moves beween cgroups, changes scheduling class or priority.
      >     c. thread sleeps OR
      >     d. thread involuntarily gives up cpu.
      >
      > a. implies:
      >
      >     thread->sched_info.last_queued = 0
      >
      > a. and b. results in the following:
      >
      >     1. dequeue_task(rq, thread)
      >
      >            sched_info_dequeued(rq, thread)
      >                delta = 0
      >
      >                sched_info_reset_dequeued(thread)
      >                    thread->sched_info.last_queued = 0
      >
      >                thread->sched_info.run_delay += delta
      >
      >     2. enqueue_task(rq, thread)
      >
      >            sched_info_queued(rq, thread)
      >
      >                /* thread is still on cpu at this point. */
      >                thread->sched_info.last_queued = task_rq(thread)->clock;
      >
      > c. results in:
      >
      >     dequeue_task(rq, thread)
      >
      >         sched_info_dequeued(rq, thread)
      >
      >             /* delta is execution time not run_delay. */
      >             delta = task_rq(thread)->clock - thread->sched_info.last_queued
      >
      >         sched_info_reset_dequeued(thread)
      >             thread->sched_info.last_queued = 0
      >
      >         thread->sched_info.run_delay += delta
      >
      >     Since thread was running between enqueue_task(rq, thread) and
      >     dequeue_task(rq, thread), the delta above is really execution
      >     time and not run_delay.
      >
      > d. results in:
      >
      >     __sched_info_switch(thread, next_thread)
      >
      >         sched_info_depart(rq, thread)
      >
      >             sched_info_queued(rq, thread)
      >
      >                 /* last_queued not updated due to being non-zero */
      >                 return
      >
      >     Since thread was running between enqueue_task(rq, thread) and
      >     __sched_info_switch(thread, next_thread), the execution time
      >     between enqueue_task(rq, thread) and
      >     __sched_info_switch(thread, next_thread) now will become
      >     associated with run_delay due to when last_queued was last updated.
      >
      
      This alternative patch solves the problem by not calling
      sched_info_{de,}queued() in {de,en}queue_task(). Therefore the
      sched_info state is preserved and things work as expected.
      
      By inlining the {de,en}queue_task() functions the new condition
      becomes (mostly) a compile-time constant and we'll not emit any new
      branch instructions.
      
      It even shrinks the code (due to inlining {en,de}queue_task()):
      
      $ size defconfig-build/kernel/sched/core.o defconfig-build/kernel/sched/core.o.orig
         text    data     bss     dec     hex filename
        64019   23378    2344   89741   15e8d defconfig-build/kernel/sched/core.o
        64149   23378    2344   89871   15f0f defconfig-build/kernel/sched/core.o.orig
      Reported-by: NMike Meyer <Mike.Meyer@Teradata.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/20150930154413.GO3604@twins.programming.kicks-ass.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      1de64443
    • S
      sched/numa: Fix task_tick_fair() from disabling numa_balancing · b52da86e
      Srikar Dronamraju 提交于
      If static branch 'sched_numa_balancing' is enabled, it should kickstart
      NUMA balancing through task_tick_numa(). However the following commit:
      
        2a595721 ("sched/numa: Convert sched_numa_balancing to a static_branch")
      
      erroneously disables this.
      
      Fix this anomaly by enabling task_tick_numa() when the static branch
      'sched_numa_balancing' is enabled.
      Signed-off-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1443752305-27413-1-git-send-email-srikar@linux.vnet.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      b52da86e