Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608141

linux-next: manual merge of the akpm tree with the tip tree

From Stephen Rothwell <sfr@canb.auug.org.au>
Newsgroups linux.kernel
Subject linux-next: manual merge of the akpm tree with the tip tree
Date 2017-03-24 06:50 +0100
Message-ID <toqgO-5l2-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi all,

Today's linux-next merge of the akpm tree got a conflict in:

  arch/x86/include/asm/atomic.h

between commit:

  e6790e4b5d5e ("locking/atomic/x86: Use atomic_try_cmpxchg()")

from the tip tree and patch:

  "x86/atomic: move __arch_atomic_add_unless out of line"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --git a/arch/x86/lib/atomic.c b/arch/x86/lib/atomic.c
index 88c8372109f8..4b8f6b842be9 100644
--- a/arch/x86/lib/atomic.c
+++ b/arch/x86/lib/atomic.c
@@ -12,16 +12,11 @@
  */
 int __arch_atomic_add_unless(atomic_t *v, int a, int u)
 {
-	int c, old;
-	c = arch_atomic_read(v);
-	for (;;) {
-		if (unlikely(c == (u)))
+	int c = arch_atomic_read(v);
+	do {
+		if (unlikely(c == u))
 			break;
-		old = arch_atomic_cmpxchg((v), c, c + (a));
-		if (likely(old == c))
-			break;
-		c = old;
-	}
+	} while (!atomic_try_cmpxchg(v, &c, c + a));
 	return c;
 }
 EXPORT_SYMBOL(__arch_atomic_add_unless);

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

linux-next: manual merge of the akpm tree with the tip tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-03-24 06:50 +0100
  Re: linux-next: manual merge of the akpm tree with the tip tree Peter Zijlstra <peterz@infradead.org> - 2017-03-24 09:10 +0100

csiph-web