public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/1] oprofile: Convert oprofilefs_lock to raw_spinlock
@ 2010-02-17 14:41 Thomas Gleixner
  2010-03-04 16:22 ` Robert Richter
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Gleixner @ 2010-02-17 14:41 UTC (permalink / raw)
  To: LKML; +Cc: Robert Richter

[-- Attachment #1: 0121.patch --]
[-- Type: text/plain, Size: 3660 bytes --]

oprofilefs_lock needs to be a real spinlock on preempt-rt. Convert it
to a raw_spinlock. No change for !RT kernels.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Robert Richter <robert.richter@amd.com>
---
 arch/arm/oprofile/common.c      |    4 ++--
 arch/x86/oprofile/nmi_int.c     |    4 ++--
 drivers/oprofile/event_buffer.c |    4 ++--
 drivers/oprofile/oprofilefs.c   |    6 +++---
 include/linux/oprofile.h        |    2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

Index: linux-2.6-tip/arch/arm/oprofile/common.c
===================================================================
--- linux-2.6-tip.orig/arch/arm/oprofile/common.c
+++ linux-2.6-tip/arch/arm/oprofile/common.c
@@ -48,9 +48,9 @@ static int op_arm_setup(void)
 {
 	int ret;
 
-	spin_lock(&oprofilefs_lock);
+	raw_spin_lock(&oprofilefs_lock);
 	ret = op_arm_model->setup_ctrs();
-	spin_unlock(&oprofilefs_lock);
+	raw_spin_unlock(&oprofilefs_lock);
 	return ret;
 }
 
Index: linux-2.6-tip/arch/x86/oprofile/nmi_int.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/oprofile/nmi_int.c
+++ linux-2.6-tip/arch/x86/oprofile/nmi_int.c
@@ -321,10 +321,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: linux-2.6-tip/drivers/oprofile/event_buffer.c
===================================================================
--- linux-2.6-tip.orig/drivers/oprofile/event_buffer.c
+++ linux-2.6-tip/drivers/oprofile/event_buffer.c
@@ -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: linux-2.6-tip/drivers/oprofile/oprofilefs.c
===================================================================
--- linux-2.6-tip.orig/drivers/oprofile/oprofilefs.c
+++ linux-2.6-tip/drivers/oprofile/oprofilefs.c
@@ -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)
 {
@@ -75,9 +75,9 @@ int oprofilefs_ulong_from_user(unsigned 
 	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: linux-2.6-tip/include/linux/oprofile.h
===================================================================
--- linux-2.6-tip.orig/include/linux/oprofile.h
+++ linux-2.6-tip/include/linux/oprofile.h
@@ -156,7 +156,7 @@ ssize_t oprofilefs_ulong_to_user(unsigne
 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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 1/1] oprofile: Convert oprofilefs_lock to raw_spinlock
  2010-02-17 14:41 [patch 1/1] oprofile: Convert oprofilefs_lock to raw_spinlock Thomas Gleixner
@ 2010-03-04 16:22 ` Robert Richter
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Richter @ 2010-03-04 16:22 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML

On 17.02.10 14:41:59, Thomas Gleixner wrote:
> oprofilefs_lock needs to be a real spinlock on preempt-rt. Convert it
> to a raw_spinlock. No change for !RT kernels.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Robert Richter <robert.richter@amd.com>
> ---
>  arch/arm/oprofile/common.c      |    4 ++--
>  arch/x86/oprofile/nmi_int.c     |    4 ++--
>  drivers/oprofile/event_buffer.c |    4 ++--
>  drivers/oprofile/oprofilefs.c   |    6 +++---
>  include/linux/oprofile.h        |    2 +-
>  5 files changed, 10 insertions(+), 10 deletions(-)

Acked-by: Robert Richter <robert.richter@amd.com>

Thomas, do you want to send it upstream via RT updates?

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-04 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-17 14:41 [patch 1/1] oprofile: Convert oprofilefs_lock to raw_spinlock Thomas Gleixner
2010-03-04 16:22 ` Robert Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox