]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Dec 2009 17:52:14 +0000 (09:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Dec 2009 17:52:14 +0000 (09:52 -0800)
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
  rcu: Make RCU's CPU-stall detector be default
  rcu: Add expedited grace-period support for preemptible RCU
  rcu: Enable fourth level of TREE_RCU hierarchy
  rcu: Rename "quiet" functions
  rcu: Re-arrange code to reduce #ifdef pain
  rcu: Eliminate unneeded function wrapping
  rcu: Fix grace-period-stall bug on large systems with CPU hotplug
  rcu: Eliminate __rcu_pending() false positives
  rcu: Further cleanups of use of lastcomp
  rcu: Simplify association of forced quiescent states with grace periods
  rcu: Accelerate callback processing on CPUs not detecting GP end
  rcu: Mark init-time-only rcu_bootup_announce() as __init
  rcu: Simplify association of quiescent states with grace periods
  rcu: Rename dynticks_completed to completed_fqs
  rcu: Enable synchronize_sched_expedited() fastpath
  rcu: Remove inline from forward-referenced functions
  rcu: Fix note_new_gpnum() uses of ->gpnum
  rcu: Fix synchronization for rcu_process_gp_end() uses of ->completed counter
  rcu: Prepare for synchronization fixes: clean up for non-NO_HZ handling of ->completed counter
  rcu: Cleanup: balance rcu_irq_enter()/rcu_irq_exit() calls
  ...

1  2 
init/Kconfig
kernel/Makefile
kernel/sched.c
lib/Kconfig.debug

diff --combined init/Kconfig
index 2e9a1457132cdbcd7cc3911a4d0db4e07a897e21,d367bf6bcc340b44e2de4b857ea79d828040879f..9ee7782947561831509157409b9860a200dff205
@@@ -297,7 -297,7 +297,7 @@@ config AUDI
  
  config AUDITSYSCALL
        bool "Enable system-call auditing support"
 -      depends on AUDIT && (X86 || PPC || PPC64 || S390 || IA64 || UML || SPARC64|| SUPERH)
 +      depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH)
        default y if SECURITY_SELINUX
        help
          Enable low-overhead system-call auditing infrastructure that
@@@ -334,6 -334,15 +334,15 @@@ config TREE_PREEMPT_RC
          is also required.  It also scales down nicely to
          smaller systems.
  
+ config TINY_RCU
+       bool "UP-only small-memory-footprint RCU"
+       depends on !SMP
+       help
+         This option selects the RCU implementation that is
+         designed for UP systems from which real-time response
+         is not required.  This option greatly reduces the
+         memory footprint of RCU.
  endchoice
  
  config RCU_TRACE
@@@ -606,7 -615,7 +615,7 @@@ config SYSFS_DEPRECATE
        bool
  
  config SYSFS_DEPRECATED_V2
 -      bool "remove sysfs features which may confuse old userspace tools"
 +      bool "enable deprecated sysfs features which may confuse old userspace tools"
        depends on SYSFS
        default n
        select SYSFS_DEPRECATED
@@@ -937,7 -946,7 +946,7 @@@ config PERF_EVENT
          Enable kernel support for various performance events provided
          by software and hardware.
  
 -        Software events are supported either build-in or via the
 +        Software events are supported either built-in or via the
          use of generic tracepoints.
  
          Most modern CPUs support performance events via performance
          used to profile the code that runs on that CPU.
  
          The Linux Performance Event subsystem provides an abstraction of
 -        these software and hardware cevent apabilities, available via a
 +        these software and hardware event capabilities, available via a
          system call and used by the "perf" utility in tools/perf/. It
          provides per task and per CPU counters, and it provides event
          capabilities on top of those.
@@@ -1098,16 -1107,6 +1107,16 @@@ config SLOW_WOR
  
          See Documentation/slow-work.txt.
  
 +config SLOW_WORK_DEBUG
 +      bool "Slow work debugging through debugfs"
 +      default n
 +      depends on SLOW_WORK && DEBUG_FS
 +      help
 +        Display the contents of the slow work run queue through debugfs,
 +        including items currently executing.
 +
 +        See Documentation/slow-work.txt.
 +
  endmenu               # General setup
  
  config HAVE_GENERIC_DMA_COHERENT
@@@ -1220,4 -1219,3 +1229,4 @@@ source "block/Kconfig
  config PREEMPT_NOTIFIERS
        bool
  
 +source "kernel/Kconfig.locks"
diff --combined kernel/Makefile
index d7c13d249b2d7176e4f534cf5835ba7b65749cbb,e9a0e6ed25cc91f30aaaff31e904d1204aad8620..dcf6789bf547e5af8e1c569b743ac72a2af4af93
@@@ -82,6 -82,7 +82,7 @@@ obj-$(CONFIG_RCU_TORTURE_TEST) += rcuto
  obj-$(CONFIG_TREE_RCU) += rcutree.o
  obj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o
  obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o
+ obj-$(CONFIG_TINY_RCU) += rcutiny.o
  obj-$(CONFIG_RELAY) += relay.o
  obj-$(CONFIG_SYSCTL) += utsname_sysctl.o
  obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
@@@ -94,7 -95,6 +95,7 @@@ obj-$(CONFIG_X86_DS) += trace
  obj-$(CONFIG_RING_BUFFER) += trace/
  obj-$(CONFIG_SMP) += sched_cpupri.o
  obj-$(CONFIG_SLOW_WORK) += slow-work.o
 +obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o
  obj-$(CONFIG_PERF_EVENTS) += perf_event.o
  
  ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
diff --combined kernel/sched.c
index ec0af1fcb195957e2d3814541058c65a4a1ab2ba,e69fee4544bd2ae57d96d61b3f77947fbcbafe66..6ae2739b8f193b590155683665b8943a882f6493
@@@ -309,8 -309,6 +309,8 @@@ static DEFINE_PER_CPU_SHARED_ALIGNED(st
   */
  static DEFINE_SPINLOCK(task_group_lock);
  
 +#ifdef CONFIG_FAIR_GROUP_SCHED
 +
  #ifdef CONFIG_SMP
  static int root_task_group_empty(void)
  {
  }
  #endif
  
 -#ifdef CONFIG_FAIR_GROUP_SCHED
  #ifdef CONFIG_USER_SCHED
  # define INIT_TASK_GROUP_LOAD (2*NICE_0_LOAD)
  #else /* !CONFIG_USER_SCHED */
@@@ -677,7 -676,6 +677,7 @@@ inline void update_rq_clock(struct rq *
  
  /**
   * runqueue_is_locked
 + * @cpu: the processor in question.
   *
   * Returns true if the current cpu runqueue is locked.
   * This interface allows printk to be called with the runqueue lock
@@@ -1565,7 -1563,11 +1565,7 @@@ static unsigned long cpu_avg_load_per_t
  
  #ifdef CONFIG_FAIR_GROUP_SCHED
  
 -struct update_shares_data {
 -      unsigned long rq_weight[NR_CPUS];
 -};
 -
 -static DEFINE_PER_CPU(struct update_shares_data, update_shares_data);
 +static __read_mostly unsigned long *update_shares_data;
  
  static void __set_se_shares(struct sched_entity *se, unsigned long shares);
  
  static void update_group_shares_cpu(struct task_group *tg, int cpu,
                                    unsigned long sd_shares,
                                    unsigned long sd_rq_weight,
 -                                  struct update_shares_data *usd)
 +                                  unsigned long *usd_rq_weight)
  {
        unsigned long shares, rq_weight;
        int boost = 0;
  
 -      rq_weight = usd->rq_weight[cpu];
 +      rq_weight = usd_rq_weight[cpu];
        if (!rq_weight) {
                boost = 1;
                rq_weight = NICE_0_LOAD;
  static int tg_shares_up(struct task_group *tg, void *data)
  {
        unsigned long weight, rq_weight = 0, shares = 0;
 -      struct update_shares_data *usd;
 +      unsigned long *usd_rq_weight;
        struct sched_domain *sd = data;
        unsigned long flags;
        int i;
                return 0;
  
        local_irq_save(flags);
 -      usd = &__get_cpu_var(update_shares_data);
 +      usd_rq_weight = per_cpu_ptr(update_shares_data, smp_processor_id());
  
        for_each_cpu(i, sched_domain_span(sd)) {
                weight = tg->cfs_rq[i]->load.weight;
 -              usd->rq_weight[i] = weight;
 +              usd_rq_weight[i] = weight;
  
                /*
                 * If there are currently no tasks on the cpu pretend there
                shares = tg->shares;
  
        for_each_cpu(i, sched_domain_span(sd))
 -              update_group_shares_cpu(tg, i, shares, rq_weight, usd);
 +              update_group_shares_cpu(tg, i, shares, rq_weight, usd_rq_weight);
  
        local_irq_restore(flags);
  
@@@ -1993,38 -1995,6 +1993,38 @@@ static inline void check_class_changed(
                p->sched_class->prio_changed(rq, p, oldprio, running);
  }
  
 +/**
 + * kthread_bind - bind a just-created kthread to a cpu.
 + * @p: thread created by kthread_create().
 + * @cpu: cpu (might not be online, must be possible) for @k to run on.
 + *
 + * Description: This function is equivalent to set_cpus_allowed(),
 + * except that @cpu doesn't need to be online, and the thread must be
 + * stopped (i.e., just returned from kthread_create()).
 + *
 + * Function lives here instead of kthread.c because it messes with
 + * scheduler internals which require locking.
 + */
 +void kthread_bind(struct task_struct *p, unsigned int cpu)
 +{
 +      struct rq *rq = cpu_rq(cpu);
 +      unsigned long flags;
 +
 +      /* Must have done schedule() in kthread() before we set_task_cpu */
 +      if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE)) {
 +              WARN_ON(1);
 +              return;
 +      }
 +
 +      spin_lock_irqsave(&rq->lock, flags);
 +      set_task_cpu(p, cpu);
 +      p->cpus_allowed = cpumask_of_cpu(cpu);
 +      p->rt.nr_cpus_allowed = 1;
 +      p->flags |= PF_THREAD_BOUND;
 +      spin_unlock_irqrestore(&rq->lock, flags);
 +}
 +EXPORT_SYMBOL(kthread_bind);
 +
  #ifdef CONFIG_SMP
  /*
   * Is this task likely cache-hot:
@@@ -2037,7 -2007,7 +2037,7 @@@ task_hot(struct task_struct *p, u64 now
        /*
         * Buddy candidates are cache hot:
         */
 -      if (sched_feat(CACHE_HOT_BUDDY) &&
 +      if (sched_feat(CACHE_HOT_BUDDY) && this_rq()->nr_running &&
                        (&p->se == cfs_rq_of(&p->se)->next ||
                         &p->se == cfs_rq_of(&p->se)->last))
                return 1;
@@@ -2341,7 -2311,7 +2341,7 @@@ static int try_to_wake_up(struct task_s
  {
        int cpu, orig_cpu, this_cpu, success = 0;
        unsigned long flags;
 -      struct rq *rq;
 +      struct rq *rq, *orig_rq;
  
        if (!sched_feat(SYNC_WAKEUPS))
                wake_flags &= ~WF_SYNC;
        this_cpu = get_cpu();
  
        smp_wmb();
 -      rq = task_rq_lock(p, &flags);
 +      rq = orig_rq = task_rq_lock(p, &flags);
        update_rq_clock(rq);
        if (!(p->state & state))
                goto out;
                set_task_cpu(p, cpu);
  
        rq = task_rq_lock(p, &flags);
 +
 +      if (rq != orig_rq)
 +              update_rq_clock(rq);
 +
        WARN_ON(p->state != TASK_WAKING);
        cpu = task_cpu(p);
  
@@@ -3690,7 -3656,6 +3690,7 @@@ static void update_group_power(struct s
  
  /**
   * update_sg_lb_stats - Update sched_group's statistics for load balancing.
 + * @sd: The sched_domain whose statistics are to be updated.
   * @group: sched_group whose statistics are to be updated.
   * @this_cpu: Cpu for which load balance is currently performed.
   * @idle: Idle status of this_cpu
@@@ -5481,7 -5446,7 +5481,7 @@@ need_resched_nonpreemptible
  }
  EXPORT_SYMBOL(schedule);
  
 -#ifdef CONFIG_SMP
 +#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
  /*
   * Look out! "owner" is an entirely speculative pointer
   * access and not reliable.
@@@ -6753,6 -6718,9 +6753,6 @@@ EXPORT_SYMBOL(yield)
  /*
   * This task is about to go to sleep on IO. Increment rq->nr_iowait so
   * that process accounting knows that this is a task in IO wait state.
 - *
 - * But don't do that if it is a deliberate, throttling IO wait (this task
 - * has set its backing_dev_info: the queue against which it should throttle)
   */
  void __sched io_schedule(void)
  {
@@@ -9436,10 -9404,6 +9436,10 @@@ void __init sched_init(void
  #endif /* CONFIG_USER_SCHED */
  #endif /* CONFIG_GROUP_SCHED */
  
 +#if defined CONFIG_FAIR_GROUP_SCHED && defined CONFIG_SMP
 +      update_shares_data = __alloc_percpu(nr_cpu_ids * sizeof(unsigned long),
 +                                          __alignof__(unsigned long));
 +#endif
        for_each_possible_cpu(i) {
                struct rq *rq;
  
        current->sched_class = &fair_sched_class;
  
        /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */
 -      alloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT);
 +      zalloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT);
  #ifdef CONFIG_SMP
  #ifdef CONFIG_NO_HZ
 -      alloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
 +      zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
        alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
  #endif
 -      alloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
 +      zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
  #endif /* SMP */
  
        perf_event_init();
@@@ -10901,6 -10865,7 +10901,7 @@@ void synchronize_sched_expedited(void
                spin_unlock_irqrestore(&rq->lock, flags);
        }
        rcu_expedited_state = RCU_EXPEDITED_STATE_IDLE;
+       synchronize_sched_expedited_count++;
        mutex_unlock(&rcu_sched_expedited_mutex);
        put_online_cpus();
        if (need_full_sync)
diff --combined lib/Kconfig.debug
index 234ceb10861f304ba858ec9a0baa9f6b297a43a6,50e0e78259e7f6d50b6111a2a4a92a180ee1d0de..a79c4d0407abf7c3cf783b1112e8c78ad0148802
@@@ -346,9 -346,8 +346,9 @@@ config SLUB_STAT
  
  config DEBUG_KMEMLEAK
        bool "Kernel memory leak detector"
 -      depends on DEBUG_KERNEL && EXPERIMENTAL && (X86 || ARM || PPC) && \
 -              !MEMORY_HOTPLUG
 +      depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \
 +              (X86 || ARM || PPC || S390)
 +
        select DEBUG_FS if SYSFS
        select STACKTRACE if STACKTRACE_SUPPORT
        select KALLSYMS
  config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
        int "Maximum kmemleak early log entries"
        depends on DEBUG_KMEMLEAK
 -      range 200 2000
 +      range 200 40000
        default 400
        help
          Kmemleak must track all the memory allocations to avoid
@@@ -392,7 -391,7 +392,7 @@@ config DEBUG_KMEMLEAK_TES
  
  config DEBUG_PREEMPT
        bool "Debug preemptible kernel"
 -      depends on DEBUG_KERNEL && PREEMPT && (TRACE_IRQFLAGS_SUPPORT || PPC64)
 +      depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
        default y
        help
          If you say Y here then the kernel will use a debug variant of the
@@@ -750,7 -749,7 +750,7 @@@ config RCU_TORTURE_TEST_RUNNABL
  config RCU_CPU_STALL_DETECTOR
        bool "Check for stalled CPUs delaying RCU grace periods"
        depends on TREE_RCU || TREE_PREEMPT_RCU
-       default n
+       default y
        help
          This option causes RCU to printk information on which
          CPUs are delaying the current grace period, but only when