From: Christian Borntraeger <borntraeger@de.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, paulmck@linux.vnet.ibm.com,
torvalds@linux-foundation.org
Subject: Re: [PATCHv4 0/9] ACCESS_ONCE and non-scalar accesses
Date: Thu, 04 Dec 2014 16:24:02 +0100 [thread overview]
Message-ID: <54807C92.1010405@de.ibm.com> (raw)
In-Reply-To: <1417645821-54731-1-git-send-email-borntraeger@de.ibm.com>
Am 03.12.2014 um 23:30 schrieb Christian Borntraeger:
> As discussed on LKML http://marc.info/?i=54611D86.4040306%40de.ibm.com
> ACCESS_ONCE might fail with specific compiler for non-scalar accesses.
>
> Here is a set of patches to tackle that problem.
>
> The first patch introduce READ_ONCE and ASSIGN_ONCE. If the data structure
> is larger than the machine word size memcpy is used and a warning is emitted.
> The next patches fix up all in-tree users of ACCESS_ONCE on non-scalar types.
> The last patch forces ACCESS_ONCE to work only on scalar types.
>
> I have cross-compiled the resulting kernel with defconfig and gcc 4.9 for
> microblaze, m68k, alpha, s390,x86_64, i686, sparc, sparc64, mips,
> ia64, arm and arm64.
>
> Runtime tested on s390x and x86_64. I have also verified that ASSIGN_ONCE works
> as expected with some test changes as there are no user in this patch series.
>
> Linus, ok for the next merge window?
>
> Christian Borntraeger (9):
> kernel: Provide READ_ONCE and ASSIGN_ONCE
> mm: replace ACCESS_ONCE with READ_ONCE or barriers
> x86/spinlock: Replace ACCESS_ONCE with READ_ONCE
> x86/gup: Replace ACCESS_ONCE with READ_ONCE
> mips/gup: Replace ACCESS_ONCE with READ_ONCE
> arm64/spinlock: Replace ACCESS_ONCE READ_ONCE
> arm/spinlock: Replace ACCESS_ONCE with READ_ONCE
> s390/kvm: REPLACE ACCESS_ONCE with READ_ONCE
> kernel: tighten rules for ACCESS ONCE
>
> arch/arm/include/asm/spinlock.h | 4 +--
> arch/arm64/include/asm/spinlock.h | 4 +--
> arch/mips/mm/gup.c | 2 +-
> arch/s390/kvm/gaccess.c | 14 ++++----
> arch/x86/include/asm/spinlock.h | 8 ++---
> arch/x86/mm/gup.c | 2 +-
> include/linux/compiler.h | 74 ++++++++++++++++++++++++++++++++++++++-
> mm/gup.c | 2 +-
> mm/memory.c | 2 +-
> mm/rmap.c | 3 +-
> 10 files changed, 95 insertions(+), 20 deletions(-)
>
FWIW, the code is on
git://git.kernel.org/pub/scm/linux/kernel/git/borntraeger/linux.git linux-next
and
git://git.kernel.org/pub/scm/linux/kernel/git/borntraeger/linux.git ACCESS_ONCE
I rebased the queue against rc3 + the initial patch that triggered the whole discussion.
Christian
next prev parent reply other threads:[~2014-12-04 15:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 22:30 [PATCHv4 0/9] ACCESS_ONCE and non-scalar accesses Christian Borntraeger
2014-12-03 22:30 ` [PATCH 1/9] kernel: Provide READ_ONCE and ASSIGN_ONCE Christian Borntraeger
2014-12-04 0:07 ` Paul E. McKenney
2014-12-04 9:24 ` Christian Borntraeger
2014-12-04 14:41 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 2/9] mm: replace ACCESS_ONCE with READ_ONCE or barriers Christian Borntraeger
2014-12-04 0:09 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 3/9] x86/spinlock: Replace ACCESS_ONCE with READ_ONCE Christian Borntraeger
2014-12-04 0:10 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 4/9] x86/gup: " Christian Borntraeger
2014-12-04 0:10 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 5/9] mips/gup: " Christian Borntraeger
2014-12-04 0:11 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 6/9] arm64/spinlock: Replace ACCESS_ONCE READ_ONCE Christian Borntraeger
2014-12-04 0:11 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 7/9] arm/spinlock: Replace ACCESS_ONCE with READ_ONCE Christian Borntraeger
2014-12-04 0:12 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 8/9] s390/kvm: REPLACE " Christian Borntraeger
2014-12-04 0:12 ` Paul E. McKenney
2014-12-03 22:30 ` [PATCH 9/9] kernel: tighten rules for ACCESS ONCE Christian Borntraeger
2014-12-04 0:16 ` Paul E. McKenney
2014-12-04 9:28 ` Christian Borntraeger
2014-12-04 14:41 ` Paul E. McKenney
2014-12-04 15:24 ` Christian Borntraeger [this message]
2014-12-04 23:40 ` [PATCHv4 0/9] ACCESS_ONCE and non-scalar accesses Linus Torvalds
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=54807C92.1010405@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=torvalds@linux-foundation.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