From: Andrew Morton <akpm@linux-foundation.org>
To: Andi Kleen <ak@linux.intel.com>
Cc: Dmitry Vyukov <dvyukov@google.com>,
20170315021431.13107-3-andi@firstfloor.org,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"x86@kernel.org" <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
Date: Thu, 16 Mar 2017 11:45:29 -0700 [thread overview]
Message-ID: <20170316114529.b94234511ed04faf3605a364@linux-foundation.org> (raw)
In-Reply-To: <20170316164110.GK32070@tassilo.jf.intel.com>
On Thu, 16 Mar 2017 09:41:10 -0700 Andi Kleen <ak@linux.intel.com> wrote:
> > Andi, why did you completely remove __arch_atomic_add_unless() from
> > the header? Don't we need at least a declaration there?
>
> Actually it's there in my git version:
>
> I wonder where it disappeared.
>
> -/**
> - * __atomic_add_unless - add unless the number is already a given value
> - * @v: pointer of type atomic_t
> - * @a: the amount to add to v...
> - * @u: ...unless v is equal to u.
> - *
> - * Atomically adds @a to @v, so long as @v was not already @u.
> - * Returns the old value of @v.
> - */
> -static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
> -{
> - int c, old;
> - c = atomic_read(v);
> - for (;;) {
> - if (unlikely(c == (u)))
> - break;
> - old = atomic_cmpxchg((v), c, c + (a));
> - if (likely(old == c))
> - break;
> - c = old;
> - }
> - return c;
> -}
> +int __atomic_add_unless(atomic_t *v, int a, int u);
That was me fixing rejects (from
asm-generic-x86-wrap-atomic-operations.patch), incompletely.
--- a/arch/x86/include/asm/atomic.h~x86-atomic-move-__atomic_add_unless-out-of-line-fix
+++ a/arch/x86/include/asm/atomic.h
@@ -235,6 +235,8 @@ ATOMIC_OPS(xor, ^)
#undef ATOMIC_FETCH_OP
#undef ATOMIC_OP
+int __arch_atomic_add_unless(atomic_t *v, int a, int u);
+
/**
* arch_atomic_inc_short - increment of a short integer
* @v: pointer to type int
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2017-03-16 18:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-16 4:47 Sergey Senozhatsky
2017-03-16 8:27 ` Dmitry Vyukov
2017-03-16 16:27 ` Andi Kleen
2017-03-16 16:41 ` Andi Kleen
2017-03-16 18:45 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170316114529.b94234511ed04faf3605a364@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=20170315021431.13107-3-andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=dvyukov@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox