]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck...
authorIngo Molnar <mingo@kernel.org>
Mon, 19 Oct 2015 08:09:54 +0000 (10:09 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 19 Oct 2015 08:09:54 +0000 (10:09 +0200)
Pull RCU updates from Paul E. McKenney:

  - Miscellaneous fixes. (Paul E. McKenney, Boqun Feng, Oleg Nesterov, Patrick Marlier)

  - Improvements to expedited grace periods. (Paul E. McKenney)

  - Performance improvements to and locktorture tests for percpu-rwsem.
    (Oleg Nesterov, Paul E. McKenney)

  - Torture-test changes. (Paul E. McKenney, Davidlohr Bueso)

  - Documentation updates. (Paul E. McKenney)

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
include/linux/sched.h
kernel/sched/core.c

diff --combined include/linux/sched.h
index b7b9501b41af4eab6a096601c3baf85c85854807,7fa8c4d372e7d2eb547a7580932d1b7d661535a2..aec904bc3da9b10aa4d69bece034b77aed3b5e1f
@@@ -762,18 -762,6 +762,18 @@@ struct signal_struct 
        unsigned audit_tty_log_passwd;
        struct tty_audit_buf *tty_audit_buf;
  #endif
 +#ifdef CONFIG_CGROUPS
 +      /*
 +       * group_rwsem prevents new tasks from entering the threadgroup and
 +       * member tasks from exiting,a more specifically, setting of
 +       * PF_EXITING.  fork and exit paths are protected with this rwsem
 +       * using threadgroup_change_begin/end().  Users which require
 +       * threadgroup to remain stable should use threadgroup_[un]lock()
 +       * which also takes care of exec path.  Currently, cgroup is the
 +       * only user.
 +       */
 +      struct rw_semaphore group_rwsem;
 +#endif
  
        oom_flags_t oom_flags;
        short oom_score_adj;            /* OOM kill score adjustment */
@@@ -1342,10 -1330,12 +1342,12 @@@ struct sched_dl_entity 
  
  union rcu_special {
        struct {
-               bool blocked;
-               bool need_qs;
-       } b;
-       short s;
+               u8 blocked;
+               u8 need_qs;
+               u8 exp_need_qs;
+               u8 pad; /* Otherwise the compiler can store garbage here. */
+       } b; /* Bits. */
+       u32 s; /* Set of bits. */
  };
  struct rcu_node;
  
diff --combined kernel/sched/core.c
index 10a8faa1b0d4a5f737bd9008eb8f9a7e817b6ec9,c4e607873d6f12446e42378b86d1ff75b840db7b..42d273d349b4e6e14a4f524a081103ad57285916
@@@ -2517,11 -2517,11 +2517,11 @@@ static struct rq *finish_task_switch(st
         * If a task dies, then it sets TASK_DEAD in tsk->state and calls
         * schedule one last time. The schedule call will never return, and
         * the scheduled task must drop that reference.
 -       * The test for TASK_DEAD must occur while the runqueue locks are
 -       * still held, otherwise prev could be scheduled on another cpu, die
 -       * there before we look at prev->state, and then the reference would
 -       * be dropped twice.
 -       *              Manfred Spraul <manfred@colorfullife.com>
 +       *
 +       * We must observe prev->state before clearing prev->on_cpu (in
 +       * finish_lock_switch), otherwise a concurrent wakeup can get prev
 +       * running on another CPU and we could rave with its RUNNING -> DEAD
 +       * transition, resulting in a double drop.
         */
        prev_state = prev->state;
        vtime_task_switch(prev);
@@@ -4022,6 -4022,7 +4022,7 @@@ int sched_setscheduler_nocheck(struct t
  {
        return _sched_setscheduler(p, policy, param, false);
  }
+ EXPORT_SYMBOL_GPL(sched_setscheduler_nocheck);
  
  static int
  do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
@@@ -4934,15 -4935,7 +4935,15 @@@ void init_idle(struct task_struct *idle
        idle->state = TASK_RUNNING;
        idle->se.exec_start = sched_clock();
  
 -      do_set_cpus_allowed(idle, cpumask_of(cpu));
 +#ifdef CONFIG_SMP
 +      /*
 +       * Its possible that init_idle() gets called multiple times on a task,
 +       * in that case do_set_cpus_allowed() will not do the right thing.
 +       *
 +       * And since this is boot we can forgo the serialization.
 +       */
 +      set_cpus_allowed_common(idle, cpumask_of(cpu));
 +#endif
        /*
         * We're having a chicken and egg problem, even though we are
         * holding rq->lock, the cpu isn't yet set to this cpu so the
  
        rq->curr = rq->idle = idle;
        idle->on_rq = TASK_ON_RQ_QUEUED;
 -#if defined(CONFIG_SMP)
 +#ifdef CONFIG_SMP
        idle->on_cpu = 1;
  #endif
        raw_spin_unlock(&rq->lock);
        idle->sched_class = &idle_sched_class;
        ftrace_graph_init_idle_task(idle, cpu);
        vtime_init_idle(idle, cpu);
 -#if defined(CONFIG_SMP)
 +#ifdef CONFIG_SMP
        sprintf(idle->comm, "%s/%d", INIT_TASK_COMM, cpu);
  #endif
  }