]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
locking, oprofile: Annotate oprofilefs lock as raw
authorThomas Gleixner <tglx@linutronix.de>
Sat, 25 Jul 2009 14:18:34 +0000 (16:18 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 13 Sep 2011 09:12:05 +0000 (11:12 +0200)
The oprofilefs_lock can be taken in atomic context (in profiling
interrupts) and therefore cannot cannot be preempted on -rt -
annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/oprofile/nmi_int.c
drivers/oprofile/event_buffer.c
drivers/oprofile/oprofile_perf.c
drivers/oprofile/oprofilefs.c
include/linux/oprofile.h

index 68894fdc034bc3cb01cd79b66ec995dadc7b7c67..96646b3aeca84fccc6f48ce127aa214feb7a3597 100644 (file)
@@ -355,10 +355,10 @@ static void nmi_cpu_setup(void *dummy)
        int cpu = smp_processor_id();
        struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
        nmi_cpu_save_registers(msrs);
-       spin_lock(&oprofilefs_lock);
+       raw_spin_lock(&oprofilefs_lock);
        model->setup_ctrs(model, msrs);
        nmi_cpu_setup_mux(cpu, msrs);
-       spin_unlock(&oprofilefs_lock);
+       raw_spin_unlock(&oprofilefs_lock);
        per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC);
        apic_write(APIC_LVTPC, APIC_DM_NMI);
 }
index dd87e86048be7913e9cc0090c52a957712d0067c..c0cc4e7ff023b685dd5a2159fe16d7cd0deb6ad3 100644 (file)
@@ -82,10 +82,10 @@ int alloc_event_buffer(void)
 {
        unsigned long flags;
 
-       spin_lock_irqsave(&oprofilefs_lock, flags);
+       raw_spin_lock_irqsave(&oprofilefs_lock, flags);
        buffer_size = oprofile_buffer_size;
        buffer_watershed = oprofile_buffer_watershed;
-       spin_unlock_irqrestore(&oprofilefs_lock, flags);
+       raw_spin_unlock_irqrestore(&oprofilefs_lock, flags);
 
        if (buffer_watershed >= buffer_size)
                return -EINVAL;
index 94796f39bc47caafcb5771ba693b64e9691880ad..da14432806c6e1662e536c2c18c21763094a5329 100644 (file)
@@ -160,9 +160,9 @@ static int oprofile_perf_create_files(struct super_block *sb, struct dentry *roo
 
 static int oprofile_perf_setup(void)
 {
-       spin_lock(&oprofilefs_lock);
+       raw_spin_lock(&oprofilefs_lock);
        op_perf_setup();
-       spin_unlock(&oprofilefs_lock);
+       raw_spin_unlock(&oprofilefs_lock);
        return 0;
 }
 
index e9ff6f7770be23a046cd5ce22b8fd504794b3907..d0de6cc2d7a5e56e36d2dfa8b2cc8b6ad17074f5 100644 (file)
@@ -21,7 +21,7 @@
 
 #define OPROFILEFS_MAGIC 0x6f70726f
 
-DEFINE_SPINLOCK(oprofilefs_lock);
+DEFINE_RAW_SPINLOCK(oprofilefs_lock);
 
 static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode)
 {
@@ -76,9 +76,9 @@ int oprofilefs_ulong_from_user(unsigned long *val, char const __user *buf, size_
        if (copy_from_user(tmpbuf, buf, count))
                return -EFAULT;
 
-       spin_lock_irqsave(&oprofilefs_lock, flags);
+       raw_spin_lock_irqsave(&oprofilefs_lock, flags);
        *val = simple_strtoul(tmpbuf, NULL, 0);
-       spin_unlock_irqrestore(&oprofilefs_lock, flags);
+       raw_spin_unlock_irqrestore(&oprofilefs_lock, flags);
        return 0;
 }
 
index 49c8727eeb570a8648092301d0736d7b9dfd242f..a4c562453f6b726e0abe6f2b62c66f34a3a07946 100644 (file)
@@ -166,7 +166,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co
 int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count);
 
 /** lock for read/write safety */
-extern spinlock_t oprofilefs_lock;
+extern raw_spinlock_t oprofilefs_lock;
 
 /**
  * Add the contents of a circular buffer to the event buffer.