All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, x86@kernel.org,
	xen-devel@lists.xenproject.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/8] x86/spinlock: Leftover conversion ACCESS_ONCE->READ_ONCE
Date: Thu, 15 Jan 2015 20:01:19 +0000	[thread overview]
Message-ID: <20150115200119.GA29684@redhat.com> (raw)
In-Reply-To: <54B81A37.80109@de.ibm.com>

On 01/15, Christian Borntraeger wrote:
>
> Am 15.01.2015 um 20:38 schrieb Oleg Nesterov:
> > On 01/15, Christian Borntraeger wrote:
> >>
> >> --- a/arch/x86/include/asm/spinlock.h
> >> +++ b/arch/x86/include/asm/spinlock.h
> >> @@ -186,7 +186,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
> >>  	__ticket_t head = ACCESS_ONCE(lock->tickets.head);
> >>
> >>  	for (;;) {
> >> -		struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
> >> +		struct __raw_tickets tmp = READ_ONCE(lock->tickets);
> >
> > Agreed, but what about another ACCESS_ONCE() above?
> >
> > Oleg.
>
> tickets.head is a scalar type, so ACCESS_ONCE does work fine with gcc 4.6/4.7.
> My goal was to convert all accesses on non-scalar types

I understand, but READ_ONCE(lock->tickets.head) looks better anyway and
arch_spin_lock() already use READ_ONCE() for this.

So why we should keep the last ACCESS_ONCE() in spinlock.h ? Just to make
another cosmetic cleanup which touches the same function later?

Oleg.


WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, x86@kernel.org,
	xen-devel@lists.xenproject.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/8] x86/spinlock: Leftover conversion ACCESS_ONCE->READ_ONCE
Date: Thu, 15 Jan 2015 21:01:19 +0100	[thread overview]
Message-ID: <20150115200119.GA29684@redhat.com> (raw)
In-Reply-To: <54B81A37.80109@de.ibm.com>

On 01/15, Christian Borntraeger wrote:
>
> Am 15.01.2015 um 20:38 schrieb Oleg Nesterov:
> > On 01/15, Christian Borntraeger wrote:
> >>
> >> --- a/arch/x86/include/asm/spinlock.h
> >> +++ b/arch/x86/include/asm/spinlock.h
> >> @@ -186,7 +186,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
> >>  	__ticket_t head = ACCESS_ONCE(lock->tickets.head);
> >>
> >>  	for (;;) {
> >> -		struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
> >> +		struct __raw_tickets tmp = READ_ONCE(lock->tickets);
> >
> > Agreed, but what about another ACCESS_ONCE() above?
> >
> > Oleg.
>
> tickets.head is a scalar type, so ACCESS_ONCE does work fine with gcc 4.6/4.7.
> My goal was to convert all accesses on non-scalar types

I understand, but READ_ONCE(lock->tickets.head) looks better anyway and
arch_spin_lock() already use READ_ONCE() for this.

So why we should keep the last ACCESS_ONCE() in spinlock.h ? Just to make
another cosmetic cleanup which touches the same function later?

Oleg.

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, x86@kernel.org,
	xen-devel@lists.xenproject.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/8] x86/spinlock: Leftover conversion ACCESS_ONCE->READ_ONCE
Date: Thu, 15 Jan 2015 21:01:19 +0100	[thread overview]
Message-ID: <20150115200119.GA29684@redhat.com> (raw)
Message-ID: <20150115200119.i2HgqEzQbyleEcVDIwakVTW8y_umwFD96U6N3gE0Rjw@z> (raw)
In-Reply-To: <54B81A37.80109@de.ibm.com>

On 01/15, Christian Borntraeger wrote:
>
> Am 15.01.2015 um 20:38 schrieb Oleg Nesterov:
> > On 01/15, Christian Borntraeger wrote:
> >>
> >> --- a/arch/x86/include/asm/spinlock.h
> >> +++ b/arch/x86/include/asm/spinlock.h
> >> @@ -186,7 +186,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
> >>  	__ticket_t head = ACCESS_ONCE(lock->tickets.head);
> >>
> >>  	for (;;) {
> >> -		struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
> >> +		struct __raw_tickets tmp = READ_ONCE(lock->tickets);
> >
> > Agreed, but what about another ACCESS_ONCE() above?
> >
> > Oleg.
>
> tickets.head is a scalar type, so ACCESS_ONCE does work fine with gcc 4.6/4.7.
> My goal was to convert all accesses on non-scalar types

I understand, but READ_ONCE(lock->tickets.head) looks better anyway and
arch_spin_lock() already use READ_ONCE() for this.

So why we should keep the last ACCESS_ONCE() in spinlock.h ? Just to make
another cosmetic cleanup which touches the same function later?

Oleg.


WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-arch@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org,
	linux-mm@kvack.org, xen-devel@lists.xenproject.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 4/8] x86/spinlock: Leftover conversion ACCESS_ONCE->READ_ONCE
Date: Thu, 15 Jan 2015 21:01:19 +0100	[thread overview]
Message-ID: <20150115200119.GA29684@redhat.com> (raw)
In-Reply-To: <54B81A37.80109@de.ibm.com>

On 01/15, Christian Borntraeger wrote:
>
> Am 15.01.2015 um 20:38 schrieb Oleg Nesterov:
> > On 01/15, Christian Borntraeger wrote:
> >>
> >> --- a/arch/x86/include/asm/spinlock.h
> >> +++ b/arch/x86/include/asm/spinlock.h
> >> @@ -186,7 +186,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
> >>  	__ticket_t head = ACCESS_ONCE(lock->tickets.head);
> >>
> >>  	for (;;) {
> >> -		struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
> >> +		struct __raw_tickets tmp = READ_ONCE(lock->tickets);
> >
> > Agreed, but what about another ACCESS_ONCE() above?
> >
> > Oleg.
>
> tickets.head is a scalar type, so ACCESS_ONCE does work fine with gcc 4.6/4.7.
> My goal was to convert all accesses on non-scalar types

I understand, but READ_ONCE(lock->tickets.head) looks better anyway and
arch_spin_lock() already use READ_ONCE() for this.

So why we should keep the last ACCESS_ONCE() in spinlock.h ? Just to make
another cosmetic cleanup which touches the same function later?

Oleg.

  parent reply	other threads:[~2015-01-15 20:01 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15  8:58 [PATCH 0/8] current ACCESS_ONCE patch queue Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58 ` [PATCH 1/8] ppc/kvm: Replace ACCESS_ONCE with READ_ONCE Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15 23:09   ` Michael Ellerman
2015-01-15 23:09     ` Michael Ellerman
2015-01-15 23:09     ` Michael Ellerman
2015-01-15 23:09     ` Michael Ellerman
2015-01-16  9:43     ` Christian Borntraeger
2015-01-16  9:43       ` Christian Borntraeger
2015-01-16  9:43       ` Christian Borntraeger
2015-01-16  9:43       ` Christian Borntraeger
2015-01-16  9:43     ` Christian Borntraeger
2015-01-15 23:09   ` Michael Ellerman
2015-01-15  8:58 ` [PATCH 2/8] ppc/hugetlbfs: " Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58 ` [PATCH 3/8] x86/xen/p2m: " Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  9:26   ` Jürgen Groß
2015-01-15  9:26     ` Jürgen Groß
2015-01-15  9:26     ` Jürgen Groß
2015-01-15  9:26     ` Jürgen Groß
2015-01-15  9:26   ` Jürgen Groß
2015-01-15 10:43   ` [Xen-devel] " David Vrabel
2015-01-15 10:43     ` David Vrabel
2015-01-15 10:43     ` David Vrabel
2015-01-15 10:43     ` David Vrabel
2015-01-15 10:43     ` David Vrabel
2015-01-15 11:07     ` Christian Borntraeger
2015-01-15 11:07       ` Christian Borntraeger
2015-01-15 11:07       ` Christian Borntraeger
2015-01-15 11:07     ` Christian Borntraeger
2015-01-15 10:43   ` David Vrabel
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58 ` [PATCH 4/8] x86/spinlock: Leftover conversion ACCESS_ONCE->READ_ONCE Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15 19:38   ` Oleg Nesterov
2015-01-15 19:38     ` Oleg Nesterov
2015-01-15 19:38     ` Oleg Nesterov
2015-01-15 19:38     ` Oleg Nesterov
2015-01-15 19:51     ` Christian Borntraeger
2015-01-15 19:51     ` Christian Borntraeger
2015-01-15 19:51       ` Christian Borntraeger
2015-01-15 19:51       ` Christian Borntraeger
2015-01-15 19:51       ` Christian Borntraeger
2015-01-15 20:01       ` Oleg Nesterov
2015-01-15 20:01       ` Oleg Nesterov [this message]
2015-01-15 20:01         ` Oleg Nesterov
2015-01-15 20:01         ` Oleg Nesterov
2015-01-15 20:01         ` Oleg Nesterov
2015-01-15 21:00         ` Christian Borntraeger
2015-01-15 21:00           ` Christian Borntraeger
2015-01-15 21:00           ` Christian Borntraeger
2015-01-15 21:00           ` Christian Borntraeger
2015-01-15 21:00         ` Christian Borntraeger
2015-01-15 19:38   ` Oleg Nesterov
2015-01-15  8:58 ` [PATCH 5/8] mm/gup: Replace ACCESS_ONCE with READ_ONCE Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58 ` [PATCH 6/8] kernel: tighten rules for ACCESS ONCE Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58 ` [PATCH 7/8] next: sh: Fix compile error Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58 ` [PATCH 8/8] kernel: Fix sparse warning for ACCESS_ONCE Christian Borntraeger
2015-01-15  8:58 ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-15  8:58   ` Christian Borntraeger
2015-01-16 12:12 ` [PATCH 0/8] current ACCESS_ONCE patch queue Alexander Graf
2015-01-16 12:12 ` Alexander Graf
2015-01-16 12:12   ` Alexander Graf
2015-01-16 12:12   ` Alexander Graf
2015-01-16 12:12   ` Alexander Graf

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=20150115200119.GA29684@redhat.com \
    --to=oleg@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.