+ cpu_relax-use-in-acpi-lock.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     cpu_relax(): use in ACPI lock

has been added to the -mm tree.  Its filename is

     cpu_relax-use-in-acpi-lock.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: cpu_relax(): use in ACPI lock
From: Andreas Mohr <andi@xxxxxxxxxxxxxxxxxxxxxxx>


Use cpu_relax() in __acpi_acquire_global_lock() etc.

Signed-off-by: Andreas Mohr <andi@xxxxxxxx>
Cc: "Brown, Len" <len.brown@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/asm-i386/acpi.h   |   14 ++++++++++----
 include/asm-x86_64/acpi.h |   12 +++++++++---
 2 files changed, 19 insertions(+), 7 deletions(-)

diff -puN include/asm-i386/acpi.h~cpu_relax-use-in-acpi-lock include/asm-i386/acpi.h
--- a/include/asm-i386/acpi.h~cpu_relax-use-in-acpi-lock
+++ a/include/asm-i386/acpi.h
@@ -61,11 +61,14 @@ static inline int
 __acpi_acquire_global_lock (unsigned int *lock)
 {
 	unsigned int old, new, val;
-	do {
+	while (1) {
 		old = *lock;
 		new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
 		val = cmpxchg(lock, old, new);
-	} while (unlikely (val != old));
+		if (likely(val == old))
+			break;
+		cpu_relax();
+	}
 	return (new < 3) ? -1 : 0;
 }
 
@@ -73,11 +76,14 @@ static inline int
 __acpi_release_global_lock (unsigned int *lock)
 {
 	unsigned int old, new, val;
-	do {
+	while (1) {
 		old = *lock;
 		new = old & ~0x3;
 		val = cmpxchg(lock, old, new);
-	} while (unlikely (val != old));
+		if (likely(val == old))
+			break;
+		cpu_relax();
+	}
 	return old & 0x1;
 }
 
diff -puN include/asm-x86_64/acpi.h~cpu_relax-use-in-acpi-lock include/asm-x86_64/acpi.h
--- a/include/asm-x86_64/acpi.h~cpu_relax-use-in-acpi-lock
+++ a/include/asm-x86_64/acpi.h
@@ -59,11 +59,14 @@ static inline int
 __acpi_acquire_global_lock (unsigned int *lock)
 {
 	unsigned int old, new, val;
-	do {
+	while (1) {
 		old = *lock;
 		new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
 		val = cmpxchg(lock, old, new);
-	} while (unlikely (val != old));
+		if (likely(val == old))
+			break;
+		cpu_relax();
+	}
 	return (new < 3) ? -1 : 0;
 }
 
@@ -75,7 +78,10 @@ __acpi_release_global_lock (unsigned int
 		old = *lock;
 		new = old & ~0x3;
 		val = cmpxchg(lock, old, new);
-	} while (unlikely (val != old));
+		if (likely(val == old))
+			break;
+		cpu_relax();
+	}
 	return old & 0x1;
 }
 
_

Patches currently in -mm which might be from andi@xxxxxxxxxxxxxxxxxxxxxxx are

git-acpi.patch
git-input.patch
ni5010-netcard-cleanup.patch
acx1xx-wireless-driver.patch
i386-apmc-optimization.patch
x86-make-using_apic_timer-__read_mostly.patch
x86-cyrix-code-config_pci-fix--add-__initdata.patch
x86-constify-some-parts-of-arch-i386-kernel-cpu.patch
x86-make-i387-mxcsr_feature_mask-__read_mostly.patch
x86-make-acpi-errata-__read_mostly.patch
x86-constify-arch-i386-pci-irqc.patch
x86-use-proper-defines-for-i8259a-i-o.patch
cpu_relax-smpbootc.patch
cpu_relax-use-in-acpi-lock.patch
cpu_relax-ptracec-coding-style-fix.patch
x86-powerpc-make-hardirq_ctx-and-softirq_ctx-__read_mostly.patch
make-noirqdebug-irqfixup-__read_mostly-add-unlikely.patch
make-debug_mutex_on-__read_mostly.patch
constify-parts-of-kernel-power.patch
constify-libcrc32c-table.patch
make-pmtmr_ioport-__read_mostly.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux