Re: bit fields && data tearing

2014-09-25 Thread Pavel Machek
On Fri 2014-09-05 12:17:16, Peter Hurley wrote: > On 09/05/2014 08:37 AM, David Laight wrote: > > From: Peter Hurley > >> On 09/05/2014 04:30 AM, David Laight wrote: > >>> I've seen gcc generate 32bit accesses for 16bit structure members on arm. > >>> It does this because of the more limited range

Re: bit fields data tearing

2014-09-25 Thread Pavel Machek
On Fri 2014-09-05 12:17:16, Peter Hurley wrote: On 09/05/2014 08:37 AM, David Laight wrote: From: Peter Hurley On 09/05/2014 04:30 AM, David Laight wrote: I've seen gcc generate 32bit accesses for 16bit structure members on arm. It does this because of the more limited range of the

Re: bit fields && data tearing

2014-09-23 Thread One Thousand Gnomes
> > Yes - because if you think about it that tells you that nobody is hitting > > it with the old code and it probably doesn't matter. > > I don't understand this reply. It's a matter of priorities. There are hundreds of potential security holes turned up by scanners, 2,500+ filed bugs in kernel

Re: bit fields && data tearing

2014-09-23 Thread Peter Hurley
On 09/14/2014 07:24 PM, One Thousand Gnomes wrote: >> So a problem that no one has ever complained about on _any_ arch is suddenly >> a problem on a subset of Alpha cpus, but a problem I know exists on Alpha >> isn't important because no one's filed a bug about it? > > Yes - because if you think

Re: bit fields data tearing

2014-09-23 Thread Peter Hurley
On 09/14/2014 07:24 PM, One Thousand Gnomes wrote: So a problem that no one has ever complained about on _any_ arch is suddenly a problem on a subset of Alpha cpus, but a problem I know exists on Alpha isn't important because no one's filed a bug about it? Yes - because if you think about it

Re: bit fields data tearing

2014-09-23 Thread One Thousand Gnomes
Yes - because if you think about it that tells you that nobody is hitting it with the old code and it probably doesn't matter. I don't understand this reply. It's a matter of priorities. There are hundreds of potential security holes turned up by scanners, 2,500+ filed bugs in kernel

Re: bit fields && data tearing

2014-09-22 Thread Paul E. McKenney
On Mon, Sep 15, 2014 at 12:24:27AM +0100, One Thousand Gnomes wrote: > > So a problem that no one has ever complained about on _any_ arch is suddenly > > a problem on a subset of Alpha cpus, but a problem I know exists on Alpha > > isn't important because no one's filed a bug about it? > > Yes -

Re: bit fields data tearing

2014-09-22 Thread Paul E. McKenney
On Mon, Sep 15, 2014 at 12:24:27AM +0100, One Thousand Gnomes wrote: So a problem that no one has ever complained about on _any_ arch is suddenly a problem on a subset of Alpha cpus, but a problem I know exists on Alpha isn't important because no one's filed a bug about it? Yes - because

Re: bit fields && data tearing

2014-09-14 Thread One Thousand Gnomes
> So a problem that no one has ever complained about on _any_ arch is suddenly > a problem on a subset of Alpha cpus, but a problem I know exists on Alpha > isn't important because no one's filed a bug about it? Yes - because if you think about it that tells you that nobody is hitting it with the

Re: bit fields data tearing

2014-09-14 Thread One Thousand Gnomes
So a problem that no one has ever complained about on _any_ arch is suddenly a problem on a subset of Alpha cpus, but a problem I know exists on Alpha isn't important because no one's filed a bug about it? Yes - because if you think about it that tells you that nobody is hitting it with the

Re: bit fields && data tearing

2014-09-11 Thread Peter Hurley
On 09/11/2014 06:04 AM, One Thousand Gnomes wrote: >>> Is *that* what we are talking about? I was added to this conversation >>> in the middle where it had already generalized, so I had no idea. >> >> No, this is just what brought this craziness to my attention. > > None of it is craziness. It's

Re: bit fields && data tearing

2014-09-11 Thread Paul E. McKenney
On Thu, Sep 11, 2014 at 11:04:11AM +0100, One Thousand Gnomes wrote: > > > Is *that* what we are talking about? I was added to this conversation > > > in the middle where it had already generalized, so I had no idea. > > > > No, this is just what brought this craziness to my attention. > > None

Re: bit fields && data tearing

2014-09-11 Thread Will Deacon
On Wed, Sep 10, 2014 at 10:48:06PM +0100, James Bottomley wrote: > On Tue, 2014-09-09 at 06:40 -0400, Peter Hurley wrote: > > >> The processor is free to re-order this to: > > >> > > >> STORE C > > >> STORE B > > >> UNLOCK > > >> > > >> That's because the unlock() only guarantees that: > > >> >

Re: bit fields && data tearing

2014-09-11 Thread One Thousand Gnomes
> > Is *that* what we are talking about? I was added to this conversation > > in the middle where it had already generalized, so I had no idea. > > No, this is just what brought this craziness to my attention. None of it is craziness. It's the real world leaking into the crazy delusional world

Re: bit fields data tearing

2014-09-11 Thread One Thousand Gnomes
Is *that* what we are talking about? I was added to this conversation in the middle where it had already generalized, so I had no idea. No, this is just what brought this craziness to my attention. None of it is craziness. It's the real world leaking into the crazy delusional world of

Re: bit fields data tearing

2014-09-11 Thread Will Deacon
On Wed, Sep 10, 2014 at 10:48:06PM +0100, James Bottomley wrote: On Tue, 2014-09-09 at 06:40 -0400, Peter Hurley wrote: The processor is free to re-order this to: STORE C STORE B UNLOCK That's because the unlock() only guarantees that: Stores before the unlock in

Re: bit fields data tearing

2014-09-11 Thread Paul E. McKenney
On Thu, Sep 11, 2014 at 11:04:11AM +0100, One Thousand Gnomes wrote: Is *that* what we are talking about? I was added to this conversation in the middle where it had already generalized, so I had no idea. No, this is just what brought this craziness to my attention. None of it is

Re: bit fields data tearing

2014-09-11 Thread Peter Hurley
On 09/11/2014 06:04 AM, One Thousand Gnomes wrote: Is *that* what we are talking about? I was added to this conversation in the middle where it had already generalized, so I had no idea. No, this is just what brought this craziness to my attention. None of it is craziness. It's the real

Re: bit fields && data tearing

2014-09-10 Thread Peter Hurley
On 09/10/2014 05:48 PM, James Bottomley wrote: > On Tue, 2014-09-09 at 06:40 -0400, Peter Hurley wrote: >> On 09/08/2014 10:56 PM, James Bottomley wrote: >>> On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: On 09/08/2014 01:50 AM, James Bottomley wrote: >> But additionally, even if

Re: bit fields && data tearing

2014-09-10 Thread James Bottomley
On Tue, 2014-09-09 at 06:40 -0400, Peter Hurley wrote: > On 09/08/2014 10:56 PM, James Bottomley wrote: > > On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: > >> On 09/08/2014 01:50 AM, James Bottomley wrote: > But additionally, even if gcc combines adjacent writes _that are part >

Re: bit fields && data tearing

2014-09-10 Thread Rob Landley
On Wed, Sep 10, 2014 at 3:18 PM, H. Peter Anvin wrote: > On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: >> >> I think the whole "removing Alpha EV5" support is basically bonkers. Just >> use set_bit in the tty layer. Alpha will continue to work as well as it >> always has done and you won't

Re: bit fields && data tearing

2014-09-10 Thread H. Peter Anvin
On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: > > I think the whole "removing Alpha EV5" support is basically bonkers. Just > use set_bit in the tty layer. Alpha will continue to work as well as it > always has done and you won't design out support for any future processor > that turns out

Re: bit fields data tearing

2014-09-10 Thread H. Peter Anvin
On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: I think the whole removing Alpha EV5 support is basically bonkers. Just use set_bit in the tty layer. Alpha will continue to work as well as it always has done and you won't design out support for any future processor that turns out not to

Re: bit fields data tearing

2014-09-10 Thread Rob Landley
On Wed, Sep 10, 2014 at 3:18 PM, H. Peter Anvin h...@zytor.com wrote: On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: I think the whole removing Alpha EV5 support is basically bonkers. Just use set_bit in the tty layer. Alpha will continue to work as well as it always has done and you

Re: bit fields data tearing

2014-09-10 Thread James Bottomley
On Tue, 2014-09-09 at 06:40 -0400, Peter Hurley wrote: On 09/08/2014 10:56 PM, James Bottomley wrote: On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: On 09/08/2014 01:50 AM, James Bottomley wrote: But additionally, even if gcc combines adjacent writes _that are part of the program

Re: bit fields data tearing

2014-09-10 Thread Peter Hurley
On 09/10/2014 05:48 PM, James Bottomley wrote: On Tue, 2014-09-09 at 06:40 -0400, Peter Hurley wrote: On 09/08/2014 10:56 PM, James Bottomley wrote: On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: On 09/08/2014 01:50 AM, James Bottomley wrote: But additionally, even if gcc combines

Re: bit fields && data tearing

2014-09-09 Thread Peter Hurley
On 09/08/2014 03:17 PM, One Thousand Gnomes wrote: >>> I think the whole "removing Alpha EV5" support is basically bonkers. Just >>> use set_bit in the tty layer. Alpha will continue to work as well as it >>> always has done and you won't design out support for any future processor >>> that turns

Re: bit fields && data tearing

2014-09-09 Thread Peter Hurley
On 09/08/2014 06:47 PM, Peter Hurley wrote: > On 09/08/2014 01:59 PM, H. Peter Anvin wrote: >> On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: >>> On Fri, 05 Sep 2014 08:41:52 -0700 >>> "H. Peter Anvin" wrote: >>> On 09/05/2014 08:31 AM, Peter Hurley wrote: > > Which is a bit

Re: bit fields && data tearing

2014-09-09 Thread Peter Hurley
On 09/08/2014 10:56 PM, James Bottomley wrote: > On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: >> On 09/08/2014 01:50 AM, James Bottomley wrote: But additionally, even if gcc combines adjacent writes _that are part of the program flow_ then I believe the situation is no worse

Re: bit fields && data tearing

2014-09-09 Thread Arnd Bergmann
On Monday 08 September 2014 19:27:14 H. Peter Anvin wrote: > On 09/08/2014 03:43 PM, James Bottomley wrote: > > > > This was years ago (possibly decades). We had to implement in-kernel > > unaligned traps for the networking layer because it could access short > > and int fields that weren't of

Re: bit fields data tearing

2014-09-09 Thread Arnd Bergmann
On Monday 08 September 2014 19:27:14 H. Peter Anvin wrote: On 09/08/2014 03:43 PM, James Bottomley wrote: This was years ago (possibly decades). We had to implement in-kernel unaligned traps for the networking layer because it could access short and int fields that weren't of the

Re: bit fields data tearing

2014-09-09 Thread Peter Hurley
On 09/08/2014 10:56 PM, James Bottomley wrote: On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: On 09/08/2014 01:50 AM, James Bottomley wrote: But additionally, even if gcc combines adjacent writes _that are part of the program flow_ then I believe the situation is no worse than would

Re: bit fields data tearing

2014-09-09 Thread Peter Hurley
On 09/08/2014 06:47 PM, Peter Hurley wrote: On 09/08/2014 01:59 PM, H. Peter Anvin wrote: On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: On Fri, 05 Sep 2014 08:41:52 -0700 H. Peter Anvin h...@zytor.com wrote: On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is a bit ironic because I

Re: bit fields data tearing

2014-09-09 Thread Peter Hurley
On 09/08/2014 03:17 PM, One Thousand Gnomes wrote: I think the whole removing Alpha EV5 support is basically bonkers. Just use set_bit in the tty layer. Alpha will continue to work as well as it always has done and you won't design out support for any future processor that turns out not to do

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
Add a short member for proper alignment and one will probably pop out. Sent from my tablet, pardon any formatting problems. > On Sep 8, 2014, at 19:56, James Bottomley > wrote: > >> On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: >> On 09/08/2014 01:50 AM, James Bottomley wrote:

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 07:56 PM, James Bottomley wrote: >> >> Yeah, the extra requirement I added is basically nonsense, since the >> only issue is what instructions the compiler is emitting. So if compiler >> thinks the alignment is natural and combines the writes -- ok. If the >> compiler thinks the

Re: bit fields && data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: > On 09/08/2014 01:50 AM, James Bottomley wrote: > >> Two things: I think that gcc has given up on combining adjacent writes, > >> perhaps because unaligned writes on some arches are prohibitive, so > >> whatever minor optimization was

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 03:39 PM, James Bottomley wrote: > > I don't understand what you mean by "pass each other". Atomicity > guarantees are not ordering guarantees in a SMP environment. The > guarantee is that if you follow the rules when two CPUs update the same > natural width aligned object

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 03:43 PM, James Bottomley wrote: > > This was years ago (possibly decades). We had to implement in-kernel > unaligned traps for the networking layer because it could access short > and int fields that weren't of the correct alignment when processing > packets. It that's all

Re: bit fields && data tearing

2014-09-08 Thread Paul E. McKenney
On Mon, Sep 08, 2014 at 06:47:35PM -0400, Peter Hurley wrote: > On 09/08/2014 01:59 PM, H. Peter Anvin wrote: > > On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: > >> On Fri, 05 Sep 2014 08:41:52 -0700 > >> "H. Peter Anvin" wrote: > >> > >>> On 09/05/2014 08:31 AM, Peter Hurley wrote: > >

Re: bit fields && data tearing

2014-09-08 Thread Peter Hurley
On 09/08/2014 01:50 AM, James Bottomley wrote: > On Sun, 2014-09-07 at 16:41 -0400, Peter Hurley wrote: >> On 09/07/2014 03:04 PM, James Bottomley wrote: >>> On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > On

Re: bit fields && data tearing

2014-09-08 Thread Peter Hurley
On 09/08/2014 01:59 PM, H. Peter Anvin wrote: > On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: >> On Fri, 05 Sep 2014 08:41:52 -0700 >> "H. Peter Anvin" wrote: >> >>> On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is a bit ironic because I remember when Digital had a team

Re: bit fields && data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 16:45 -0400, Chris Metcalf wrote: > On 9/8/2014 1:50 AM, James Bottomley wrote: > > Actual alignment is pretty irrelevant. That's why all architectures > > which require alignment also have to implement misaligned traps ... this > > is a fundamental requirement of the

Re: bit fields && data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 12:12 -0700, H. Peter Anvin wrote: > On 09/08/2014 12:09 PM, James Bottomley wrote: > > > > Um, I think you need to re-read the thread; that's not what I said at > > all. It's even written lower down: "PA can't do atomic bit sets (no > > atomic RMW except the ldcw operation)

Re: bit fields && data tearing

2014-09-08 Thread Chris Metcalf
On 9/8/2014 1:50 AM, James Bottomley wrote: Actual alignment is pretty irrelevant. That's why all architectures which require alignment also have to implement misaligned traps ... this is a fundamental requirement of the networking code, for instance. Can you clarify what you think the

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 12:09 PM, James Bottomley wrote: > > Um, I think you need to re-read the thread; that's not what I said at > all. It's even written lower down: "PA can't do atomic bit sets (no > atomic RMW except the ldcw operation) it can do atomic writes to > fundamental sizes (byte, short, int,

Re: bit fields && data tearing

2014-09-08 Thread One Thousand Gnomes
> > I think the whole "removing Alpha EV5" support is basically bonkers. Just > > use set_bit in the tty layer. Alpha will continue to work as well as it > > always has done and you won't design out support for any future processor > > that turns out not to do byte aligned stores. > > > > Alan >

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 12:09 PM, James Bottomley wrote: > > Um, I think you need to re-read the thread; that's not what I said at > all. It's even written lower down: "PA can't do atomic bit sets (no > atomic RMW except the ldcw operation) it can do atomic writes to > fundamental sizes (byte, short, int,

Re: bit fields && data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 11:12 -0700, H. Peter Anvin wrote: > On 09/07/2014 10:56 PM, James Bottomley wrote: > > On Sun, 2014-09-07 at 16:39 -0700, H. Peter Anvin wrote: > >> How many PARISC systems do we have that actually do real work on Linux? > > > > I'd be very surprised if this problem didn't

Re: bit fields && data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 18:52 +0100, One Thousand Gnomes wrote: > On Fri, 05 Sep 2014 08:41:52 -0700 > "H. Peter Anvin" wrote: > > > On 09/05/2014 08:31 AM, Peter Hurley wrote: > > > > > > Which is a bit ironic because I remember when Digital had a team > > > working on emulating native x86 apps

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/07/2014 10:56 PM, James Bottomley wrote: > On Sun, 2014-09-07 at 16:39 -0700, H. Peter Anvin wrote: >> How many PARISC systems do we have that actually do real work on Linux? > > I'd be very surprised if this problem didn't exist on all alignment > requiring architectures, like PPC and

Re: bit fields && data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: > On Fri, 05 Sep 2014 08:41:52 -0700 > "H. Peter Anvin" wrote: > >> On 09/05/2014 08:31 AM, Peter Hurley wrote: >>> >>> Which is a bit ironic because I remember when Digital had a team >>> working on emulating native x86 apps on Alpha/NT. >>> >>

Re: bit fields && data tearing

2014-09-08 Thread One Thousand Gnomes
On Fri, 05 Sep 2014 08:41:52 -0700 "H. Peter Anvin" wrote: > On 09/05/2014 08:31 AM, Peter Hurley wrote: > > > > Which is a bit ironic because I remember when Digital had a team > > working on emulating native x86 apps on Alpha/NT. > > > > Right, because the x86 architecture was obsolete and

Re: bit fields data tearing

2014-09-08 Thread One Thousand Gnomes
On Fri, 05 Sep 2014 08:41:52 -0700 H. Peter Anvin h...@zytor.com wrote: On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is a bit ironic because I remember when Digital had a team working on emulating native x86 apps on Alpha/NT. Right, because the x86 architecture was obsolete and

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: On Fri, 05 Sep 2014 08:41:52 -0700 H. Peter Anvin h...@zytor.com wrote: On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is a bit ironic because I remember when Digital had a team working on emulating native x86 apps on Alpha/NT.

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/07/2014 10:56 PM, James Bottomley wrote: On Sun, 2014-09-07 at 16:39 -0700, H. Peter Anvin wrote: How many PARISC systems do we have that actually do real work on Linux? I'd be very surprised if this problem didn't exist on all alignment requiring architectures, like PPC and Sparc as

Re: bit fields data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 18:52 +0100, One Thousand Gnomes wrote: On Fri, 05 Sep 2014 08:41:52 -0700 H. Peter Anvin h...@zytor.com wrote: On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is a bit ironic because I remember when Digital had a team working on emulating native x86 apps on

Re: bit fields data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 11:12 -0700, H. Peter Anvin wrote: On 09/07/2014 10:56 PM, James Bottomley wrote: On Sun, 2014-09-07 at 16:39 -0700, H. Peter Anvin wrote: How many PARISC systems do we have that actually do real work on Linux? I'd be very surprised if this problem didn't exist on

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 12:09 PM, James Bottomley wrote: Um, I think you need to re-read the thread; that's not what I said at all. It's even written lower down: PA can't do atomic bit sets (no atomic RMW except the ldcw operation) it can do atomic writes to fundamental sizes (byte, short, int, long)

Re: bit fields data tearing

2014-09-08 Thread One Thousand Gnomes
I think the whole removing Alpha EV5 support is basically bonkers. Just use set_bit in the tty layer. Alpha will continue to work as well as it always has done and you won't design out support for any future processor that turns out not to do byte aligned stores. Alan Is *that*

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 12:09 PM, James Bottomley wrote: Um, I think you need to re-read the thread; that's not what I said at all. It's even written lower down: PA can't do atomic bit sets (no atomic RMW except the ldcw operation) it can do atomic writes to fundamental sizes (byte, short, int, long)

Re: bit fields data tearing

2014-09-08 Thread Chris Metcalf
On 9/8/2014 1:50 AM, James Bottomley wrote: Actual alignment is pretty irrelevant. That's why all architectures which require alignment also have to implement misaligned traps ... this is a fundamental requirement of the networking code, for instance. Can you clarify what you think the

Re: bit fields data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 12:12 -0700, H. Peter Anvin wrote: On 09/08/2014 12:09 PM, James Bottomley wrote: Um, I think you need to re-read the thread; that's not what I said at all. It's even written lower down: PA can't do atomic bit sets (no atomic RMW except the ldcw operation) it can do

Re: bit fields data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 16:45 -0400, Chris Metcalf wrote: On 9/8/2014 1:50 AM, James Bottomley wrote: Actual alignment is pretty irrelevant. That's why all architectures which require alignment also have to implement misaligned traps ... this is a fundamental requirement of the networking

Re: bit fields data tearing

2014-09-08 Thread Peter Hurley
On 09/08/2014 01:59 PM, H. Peter Anvin wrote: On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: On Fri, 05 Sep 2014 08:41:52 -0700 H. Peter Anvin h...@zytor.com wrote: On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is a bit ironic because I remember when Digital had a team working on

Re: bit fields data tearing

2014-09-08 Thread Peter Hurley
On 09/08/2014 01:50 AM, James Bottomley wrote: On Sun, 2014-09-07 at 16:41 -0400, Peter Hurley wrote: On 09/07/2014 03:04 PM, James Bottomley wrote: On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: On Thu, 2014-09-04

Re: bit fields data tearing

2014-09-08 Thread Paul E. McKenney
On Mon, Sep 08, 2014 at 06:47:35PM -0400, Peter Hurley wrote: On 09/08/2014 01:59 PM, H. Peter Anvin wrote: On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: On Fri, 05 Sep 2014 08:41:52 -0700 H. Peter Anvin h...@zytor.com wrote: On 09/05/2014 08:31 AM, Peter Hurley wrote: Which is

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 03:43 PM, James Bottomley wrote: This was years ago (possibly decades). We had to implement in-kernel unaligned traps for the networking layer because it could access short and int fields that weren't of the correct alignment when processing packets. It that's all corrected

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 03:39 PM, James Bottomley wrote: I don't understand what you mean by pass each other. Atomicity guarantees are not ordering guarantees in a SMP environment. The guarantee is that if you follow the rules when two CPUs update the same natural width aligned object simultaneously

Re: bit fields data tearing

2014-09-08 Thread James Bottomley
On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: On 09/08/2014 01:50 AM, James Bottomley wrote: Two things: I think that gcc has given up on combining adjacent writes, perhaps because unaligned writes on some arches are prohibitive, so whatever minor optimization was believed to be

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
On 09/08/2014 07:56 PM, James Bottomley wrote: Yeah, the extra requirement I added is basically nonsense, since the only issue is what instructions the compiler is emitting. So if compiler thinks the alignment is natural and combines the writes -- ok. If the compiler thinks the alignment is

Re: bit fields data tearing

2014-09-08 Thread H. Peter Anvin
Add a short member for proper alignment and one will probably pop out. Sent from my tablet, pardon any formatting problems. On Sep 8, 2014, at 19:56, James Bottomley james.bottom...@hansenpartnership.com wrote: On Mon, 2014-09-08 at 19:30 -0400, Peter Hurley wrote: On 09/08/2014 01:50 AM,

Re: bit fields && data tearing

2014-09-07 Thread James Bottomley
On Sun, 2014-09-07 at 16:39 -0700, H. Peter Anvin wrote: > How many PARISC systems do we have that actually do real work on Linux? I'd be very surprised if this problem didn't exist on all alignment requiring architectures, like PPC and Sparc as well. I know it would be very convenient if all

Re: bit fields && data tearing

2014-09-07 Thread James Bottomley
On Sun, 2014-09-07 at 16:41 -0400, Peter Hurley wrote: > On 09/07/2014 03:04 PM, James Bottomley wrote: > > On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: > >> On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > >>> On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney

Re: bit fields && data tearing

2014-09-07 Thread H. Peter Anvin
How many PARISC systems do we have that actually do real work on Linux? On September 7, 2014 4:36:55 PM PDT, "Paul E. McKenney" wrote: >On Sun, Sep 07, 2014 at 04:17:30PM -0700, H. Peter Anvin wrote: >> I'm confused why storing 0x0102 would be a problem. I think gcc does >that even on other

Re: bit fields && data tearing

2014-09-07 Thread Paul E. McKenney
On Sun, Sep 07, 2014 at 04:17:30PM -0700, H. Peter Anvin wrote: > I'm confused why storing 0x0102 would be a problem. I think gcc does that > even on other cpus. > > More atomicity can't hurt, can it? I must defer to James for any additional details on why PARISC systems don't provide

Re: bit fields && data tearing

2014-09-07 Thread H. Peter Anvin
I'm confused why storing 0x0102 would be a problem. I think gcc does that even on other cpus. More atomicity can't hurt, can it? On September 7, 2014 4:00:19 PM PDT, "Paul E. McKenney" wrote: >On Sun, Sep 07, 2014 at 12:04:47PM -0700, James Bottomley wrote: >> On Sun, 2014-09-07 at 09:21

Re: bit fields && data tearing

2014-09-07 Thread Paul E. McKenney
On Sun, Sep 07, 2014 at 12:04:47PM -0700, James Bottomley wrote: > On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: > > On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > > > On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: > > > > On Thu, Sep 04, 2014 at

Re: bit fields && data tearing

2014-09-07 Thread Peter Hurley
On 09/07/2014 03:04 PM, James Bottomley wrote: > On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: >> On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: >>> On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley

Re: bit fields && data tearing

2014-09-07 Thread James Bottomley
On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: > On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > > On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: > > > On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: > > > > Hi James, > > > > > > > > On

Re: bit fields && data tearing

2014-09-07 Thread Paul E. McKenney
On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: > > On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: > > > Hi James, > > > > > > On 09/04/2014 10:11 PM, James Bottomley wrote: > > > > On Thu, 2014-09-04 at

Re: bit fields data tearing

2014-09-07 Thread Paul E. McKenney
On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: Hi James, On 09/04/2014 10:11 PM, James Bottomley wrote: On Thu, 2014-09-04 at 17:17 -0700,

Re: bit fields data tearing

2014-09-07 Thread James Bottomley
On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: Hi James, On 09/04/2014 10:11 PM,

Re: bit fields data tearing

2014-09-07 Thread Peter Hurley
On 09/07/2014 03:04 PM, James Bottomley wrote: On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote:

Re: bit fields data tearing

2014-09-07 Thread Paul E. McKenney
On Sun, Sep 07, 2014 at 12:04:47PM -0700, James Bottomley wrote: On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On Thu, Sep 04, 2014 at 10:47:24PM

Re: bit fields data tearing

2014-09-07 Thread H. Peter Anvin
I'm confused why storing 0x0102 would be a problem. I think gcc does that even on other cpus. More atomicity can't hurt, can it? On September 7, 2014 4:00:19 PM PDT, Paul E. McKenney paul...@linux.vnet.ibm.com wrote: On Sun, Sep 07, 2014 at 12:04:47PM -0700, James Bottomley wrote: On Sun,

Re: bit fields data tearing

2014-09-07 Thread Paul E. McKenney
On Sun, Sep 07, 2014 at 04:17:30PM -0700, H. Peter Anvin wrote: I'm confused why storing 0x0102 would be a problem. I think gcc does that even on other cpus. More atomicity can't hurt, can it? I must defer to James for any additional details on why PARISC systems don't provide atomicity

Re: bit fields data tearing

2014-09-07 Thread H. Peter Anvin
How many PARISC systems do we have that actually do real work on Linux? On September 7, 2014 4:36:55 PM PDT, Paul E. McKenney paul...@linux.vnet.ibm.com wrote: On Sun, Sep 07, 2014 at 04:17:30PM -0700, H. Peter Anvin wrote: I'm confused why storing 0x0102 would be a problem. I think gcc does

Re: bit fields data tearing

2014-09-07 Thread James Bottomley
On Sun, 2014-09-07 at 16:41 -0400, Peter Hurley wrote: On 09/07/2014 03:04 PM, James Bottomley wrote: On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On

Re: bit fields data tearing

2014-09-07 Thread James Bottomley
On Sun, 2014-09-07 at 16:39 -0700, H. Peter Anvin wrote: How many PARISC systems do we have that actually do real work on Linux? I'd be very surprised if this problem didn't exist on all alignment requiring architectures, like PPC and Sparc as well. I know it would be very convenient if all the

Re: bit fields && data tearing

2014-09-06 Thread James Bottomley
On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: > On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: > > Hi James, > > > > On 09/04/2014 10:11 PM, James Bottomley wrote: > > > On Thu, 2014-09-04 at 17:17 -0700, Paul E. McKenney wrote: > > >> +And there are anti-guarantees: >

Re: bit fields data tearing

2014-09-06 Thread James Bottomley
On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: Hi James, On 09/04/2014 10:11 PM, James Bottomley wrote: On Thu, 2014-09-04 at 17:17 -0700, Paul E. McKenney wrote: +And there are anti-guarantees: + + (*)

Re: bit fields && data tearing

2014-09-05 Thread Michael Cree
On Fri, Sep 05, 2014 at 05:12:28PM -0400, Peter Hurley wrote: > On 09/05/2014 04:39 PM, Michael Cree wrote: > > On Fri, Sep 05, 2014 at 04:14:48PM -0400, Peter Hurley wrote: > >> Second, in the body of the document: > >> > >> "The Linux kernel no longer supports pre-EV56 Alpha CPUs, because these

Re: bit fields && data tearing

2014-09-05 Thread Peter Hurley
On 09/05/2014 04:39 PM, Michael Cree wrote: > On Fri, Sep 05, 2014 at 04:14:48PM -0400, Peter Hurley wrote: >> Second, in the body of the document: >> >> "The Linux kernel no longer supports pre-EV56 Alpha CPUs, because these >> older CPUs _do not provide_ atomic one-byte and two-byte loads and

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 10:48:34PM +0200, Thomas Gleixner wrote: > On Fri, 5 Sep 2014, Paul E. McKenney wrote: > > On Fri, Sep 05, 2014 at 01:34:52PM -0700, H. Peter Anvin wrote: > > > On 09/05/2014 01:14 PM, Peter Hurley wrote: > > > > > > > > Here's how I read the two statements. > > > > > > >

Re: bit fields && data tearing

2014-09-05 Thread Thomas Gleixner
On Fri, 5 Sep 2014, Paul E. McKenney wrote: > On Fri, Sep 05, 2014 at 01:34:52PM -0700, H. Peter Anvin wrote: > > On 09/05/2014 01:14 PM, Peter Hurley wrote: > > > > > > Here's how I read the two statements. > > > > > > First, the commit message: > > > > > > "It [this commit] documents that

Re: bit fields && data tearing

2014-09-05 Thread Michael Cree
On Fri, Sep 05, 2014 at 01:34:52PM -0700, H. Peter Anvin wrote: > On 09/05/2014 01:14 PM, Peter Hurley wrote: > > > > Here's how I read the two statements. > > > > First, the commit message: > > > > "It [this commit] documents that CPUs [supported by the Linux kernel] > > _must provide_ atomic

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 01:34:52PM -0700, H. Peter Anvin wrote: > On 09/05/2014 01:14 PM, Peter Hurley wrote: > > > > Here's how I read the two statements. > > > > First, the commit message: > > > > "It [this commit] documents that CPUs [supported by the Linux kernel] > > _must provide_ atomic

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 04:14:48PM -0400, Peter Hurley wrote: > On 09/05/2014 03:38 PM, Marc Gauthier wrote: > > Paul E. McKenney wrote: > >> On Fri, Sep 05, 2014 at 02:50:31PM -0400, Peter Hurley wrote: > >>> On 09/05/2014 02:09 PM, Paul E. McKenney wrote: > This commit documents the fact

Re: bit fields && data tearing

2014-09-05 Thread Michael Cree
On Fri, Sep 05, 2014 at 04:14:48PM -0400, Peter Hurley wrote: > Second, in the body of the document: > > "The Linux kernel no longer supports pre-EV56 Alpha CPUs, because these > older CPUs _do not provide_ atomic one-byte and two-byte loads and stores." Let's be clear here, the pre-EV56 Alpha

  1   2   3   >