[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6dbe51f-88a8-0b18-e0e7-147d8022ad54@synopsys.com>
Date: Mon, 3 Jun 2019 11:44:52 -0700
From: Vineet Gupta <Vineet.Gupta1@...opsys.com>
To: David Laight <David.Laight@...LAB.COM>,
Peter Zijlstra <peterz@...radead.org>,
Will Deacon <Will.Deacon@....com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
CC: "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
arcml <linux-snps-arc@...ts.infradead.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: single copy atomicity for double load/stores on 32-bit systems
On 5/31/19 2:41 AM, David Laight wrote:
>> While it seems reasonable form hardware pov to not implement such atomicity by
>> default it seems there's an additional burden on application writers. They could
>> be happily using a lockless algorithm with just a shared flag between 2 threads
>> w/o need for any explicit synchronization. But upgrade to a new compiler which
>> aggressively "packs" struct rendering long long 32-bit aligned (vs. 64-bit before)
>> causing the code to suddenly stop working. Is the onus on them to declare such
>> memory as c11 atomic or some such.
> A 'new' compiler can't suddenly change the alignment rules for structure elements.
> The alignment rules will be part of the ABI.
>
> More likely is that the structure itself is unexpectedly allocated on
> an 8n+4 boundary due to code changes elsewhere.
Indeed thats what I meant that the layout changed as is typical of a new compiler.
Powered by blists - more mailing lists