Merge branch 'linus' into locking-for-linus
authorIngo Molnar <mingo@elte.hu>
Tue, 31 Mar 2009 11:53:43 +0000 (13:53 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 31 Mar 2009 11:53:43 +0000 (13:53 +0200)
Conflicts:
lib/Kconfig.debug

1  2 
kernel/lockdep.c
kernel/softirq.c

diff --combined kernel/lockdep.c
index 9a1e2bcc4b8d2062ad72d491f19ef49e7e18434d,3673a3f44d9d445f7cdf42f2ee5592731a4c0db7..981cd4854281458cc78e2e4730ee93df075287f4
@@@ -433,6 -433,13 +433,6 @@@ atomic_t nr_find_usage_forwards_checks
  atomic_t nr_find_usage_forwards_recursions;
  atomic_t nr_find_usage_backwards_checks;
  atomic_t nr_find_usage_backwards_recursions;
 -# define debug_atomic_inc(ptr)                atomic_inc(ptr)
 -# define debug_atomic_dec(ptr)                atomic_dec(ptr)
 -# define debug_atomic_read(ptr)               atomic_read(ptr)
 -#else
 -# define debug_atomic_inc(ptr)                do { } while (0)
 -# define debug_atomic_dec(ptr)                do { } while (0)
 -# define debug_atomic_read(ptr)               0
  #endif
  
  /*
@@@ -1893,9 -1900,9 +1893,9 @@@ print_irq_inversion_bug(struct task_str
                curr->comm, task_pid_nr(curr));
        print_lock(this);
        if (forwards)
 -              printk("but this lock took another, %s-irq-unsafe lock in the past:\n", irqclass);
 +              printk("but this lock took another, %s-unsafe lock in the past:\n", irqclass);
        else
 -              printk("but this lock was taken by another, %s-irq-safe lock in the past:\n", irqclass);
 +              printk("but this lock was taken by another, %s-safe lock in the past:\n", irqclass);
        print_lock_name(other);
        printk("\n\nand interrupts could create inverse lock ordering between them.\n\n");
  
@@@ -2008,8 -2015,7 +2008,8 @@@ typedef int (*check_usage_f)(struct tas
                             enum lock_usage_bit bit, const char *name);
  
  static int
 -mark_lock_irq(struct task_struct *curr, struct held_lock *this, int new_bit)
 +mark_lock_irq(struct task_struct *curr, struct held_lock *this,
 +              enum lock_usage_bit new_bit)
  {
        int excl_bit = exclusive_bit(new_bit);
        int read = new_bit & 1;
         * states.
         */
        if ((!read || !dir || STRICT_READ_CHECKS) &&
 -                      !usage(curr, this, excl_bit, state_name(new_bit)))
 +                      !usage(curr, this, excl_bit, state_name(new_bit & ~1)))
                return 0;
  
        /*
@@@ -2254,7 -2260,7 +2254,7 @@@ void trace_softirqs_off(unsigned long i
                debug_atomic_inc(&redundant_softirqs_off);
  }
  
void lockdep_trace_alloc(gfp_t gfp_mask)
static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags)
  {
        struct task_struct *curr = current;
  
        if (!(gfp_mask & __GFP_FS))
                return;
  
-       if (DEBUG_LOCKS_WARN_ON(irqs_disabled()))
+       if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)))
                return;
  
        mark_held_locks(curr, RECLAIM_FS);
  }
  
+ static void check_flags(unsigned long flags);
+ void lockdep_trace_alloc(gfp_t gfp_mask)
+ {
+       unsigned long flags;
+       if (unlikely(current->lockdep_recursion))
+               return;
+       raw_local_irq_save(flags);
+       check_flags(flags);
+       current->lockdep_recursion = 1;
+       __lockdep_trace_alloc(gfp_mask, flags);
+       current->lockdep_recursion = 0;
+       raw_local_irq_restore(flags);
+ }
  static int mark_irqflags(struct task_struct *curr, struct held_lock *hlock)
  {
        /*
diff --combined kernel/softirq.c
index 08a030f85416c3e73d6131f5605d997403fa509c,57d3f67f6f38af7fdfb0fad66ff1cdbef790951e..4877516043000a42278eb13b2bef99e21696671a
@@@ -180,7 -180,7 +180,7 @@@ asmlinkage void __do_softirq(void
        account_system_vtime(current);
  
        __local_bh_disable((unsigned long)__builtin_return_address(0));
 -      trace_softirq_enter();
 +      lockdep_softirq_enter();
  
        cpu = smp_processor_id();
  restart:
        if (pending)
                wakeup_softirqd();
  
 -      trace_softirq_exit();
 +      lockdep_softirq_exit();
  
        account_system_vtime(current);
        _local_bh_enable();
@@@ -796,6 -796,11 +796,11 @@@ int __init __weak early_irq_init(void
        return 0;
  }
  
+ int __init __weak arch_probe_nr_irqs(void)
+ {
+       return 0;
+ }
  int __init __weak arch_early_irq_init(void)
  {
        return 0;