Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Oct 2010 19:54:12 +0000 (12:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Oct 2010 19:54:12 +0000 (12:54 -0700)
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (52 commits)
  sched: fix RCU lockdep splat from task_group()
  rcu: using ACCESS_ONCE() to observe the jiffies_stall/rnp->qsmask value
  sched: suppress RCU lockdep splat in task_fork_fair
  net: suppress RCU lockdep false positive in sock_update_classid
  rcu: move check from rcu_dereference_bh to rcu_read_lock_bh_held
  rcu: Add advice to PROVE_RCU_REPEATEDLY kernel config parameter
  rcu: Add tracing data to support queueing models
  rcu: fix sparse errors in rcutorture.c
  rcu: only one evaluation of arg in rcu_dereference_check() unless sparse
  kernel: Remove undead ifdef CONFIG_DEBUG_LOCK_ALLOC
  rcu: fix _oddness handling of verbose stall warnings
  rcu: performance fixes to TINY_PREEMPT_RCU callback checking
  rcu: upgrade stallwarn.txt documentation for CPU-bound RT processes
  vhost: add __rcu annotations
  rcu: add comment stating that list_empty() applies to RCU-protected lists
  rcu: apply TINY_PREEMPT_RCU read-side speedup to TREE_PREEMPT_RCU
  rcu: combine duplicate code, courtesy of CONFIG_PREEMPT_RCU
  rcu: Upgrade srcu_read_lock() docbook about SRCU grace periods
  rcu: document ways of stalling updates in low-memory situations
  rcu: repair code-duplication FIXMEs
  ...

1  2 
drivers/input/evdev.c
kernel/sched.c

diff --combined drivers/input/evdev.c
@@@ -28,7 -28,7 +28,7 @@@ struct evdev 
        int minor;
        struct input_handle handle;
        wait_queue_head_t wait;
-       struct evdev_client *grab;
+       struct evdev_client __rcu *grab;
        struct list_head client_list;
        spinlock_t client_lock; /* protects client_list */
        struct mutex mutex;
@@@ -669,9 -669,6 +669,9 @@@ static long evdev_do_ioctl(struct file 
  
                if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) {
  
 +                      if (!dev->absinfo)
 +                              return -EINVAL;
 +
                        t = _IOC_NR(cmd) & ABS_MAX;
                        abs = dev->absinfo[t];
  
                }
        }
  
 -      if (_IOC_DIR(cmd) == _IOC_READ) {
 +      if (_IOC_DIR(cmd) == _IOC_WRITE) {
  
                if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) {
  
 +                      if (!dev->absinfo)
 +                              return -EINVAL;
 +
                        t = _IOC_NR(cmd) & ABS_MAX;
  
                        if (copy_from_user(&abs, p, min_t(size_t,
diff --combined kernel/sched.c
@@@ -4645,7 -4645,7 +4645,7 @@@ recheck
        }
  
        if (user) {
 -              retval = security_task_setscheduler(p, policy, param);
 +              retval = security_task_setscheduler(p);
                if (retval)
                        return retval;
        }
@@@ -4887,7 -4887,7 +4887,7 @@@ long sched_setaffinity(pid_t pid, cons
        if (!check_same_owner(p) && !capable(CAP_SYS_NICE))
                goto out_unlock;
  
 -      retval = security_task_setscheduler(p, 0, NULL);
 +      retval = security_task_setscheduler(p);
        if (retval)
                goto out_unlock;
  
@@@ -5337,7 -5337,19 +5337,19 @@@ void __cpuinit init_idle(struct task_st
        idle->se.exec_start = sched_clock();
  
        cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu));
+       /*
+        * 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
+        * lockdep check in task_group() will fail.
+        *
+        * Similar case to sched_fork(). / Alternatively we could
+        * use task_rq_lock() here and obtain the other rq->lock.
+        *
+        * Silence PROVE_RCU
+        */
+       rcu_read_lock();
        __set_task_cpu(idle, cpu);
+       rcu_read_unlock();
  
        rq->curr = rq->idle = idle;
  #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)