Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-25 Thread Maciej W. Rozycki
On Mon, 25 Nov 2024, Richard Biener wrote: > > The full `-msafe-bwa' feature is required for a fix, as the data race > > comes from *outside* rather than from any lack of atomicity of the store > > to the object itself. As the previous value of the object itself is > > discarded, a plain RMW

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-25 Thread Richard Biener
On Mon, 25 Nov 2024, Maciej W. Rozycki wrote: > On Sat, 23 Nov 2024, Maciej W. Rozycki wrote: > > > I found no previous bug report, so this is now PR target/117759[1]. An > > obvious bug fix has been posted for review as well[2]. > > I gave this issue some thought as I travelled across Europ

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-25 Thread Maciej W. Rozycki
On Sat, 23 Nov 2024, Maciej W. Rozycki wrote: > I found no previous bug report, so this is now PR target/117759[1]. An > obvious bug fix has been posted for review as well[2]. I gave this issue some thought as I travelled across Europe over the weekend and I have now withdrawn the proposed f

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-23 Thread John Paul Adrian Glaubitz
Hi Maciej, On Sat, 2024-11-23 at 12:28 +, Maciej W. Rozycki wrote: > > Thanks a lot for your work, much appreciated! > > You are welcome! > > > I gave this a try on gcc.git master with LRA enabled for both non-BWX and > > BWX targets. BWX targets build fine with almost all languages enabled

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-23 Thread Maciej W. Rozycki
Hi Adrian, > > This has come out of a discussion[1] around the removal of non-BWX Alpha > > support from the Linux kernel due to data races affecting RCU algorithms. > > (...) > > Comments, questions, voices of concern or appreciation, all very welcome. > > Thanks a lot for your work, much ap

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-23 Thread Maciej W. Rozycki
On Tue, 19 Nov 2024, Maciej W. Rozycki wrote: > > time I think the RMW sequence on _Atomic variables is a clear > > bug that you'd need to fix also for -mno-safe-bwa. > > That's weird indeed, GCC internals manual clearly says: > > "'atomic_storeMODE' > This pattern implements an atomic sto

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-20 Thread John Paul Adrian Glaubitz
Hi Maciej On Mon, 2024-11-18 at 02:59 +, Maciej W. Rozycki wrote: > This has come out of a discussion[1] around the removal of non-BWX Alpha > support from the Linux kernel due to data races affecting RCU algorithms. > (...) > Comments, questions, voices of concern or appreciation, all ver

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-19 Thread Maciej W. Rozycki
On Mon, 18 Nov 2024, Arnd Bergmann wrote: > >> a) storing an '_Atomic' variable smaller than 8 bytes on non-bwx > >>targets should use ll/sc, but uses a plain rmw cycle. > > > > I think there should be no problem with aligned 4-byte (longword) data > > quantities, given that there are both pl

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-18 Thread Maciej W. Rozycki
On Mon, 18 Nov 2024, Arnd Bergmann wrote: > > This patch series addresses these issues in the last two changes, having > > made generic test suite updates to improve coverage in the concerned area > > first and then having addressed a bunch of issues in the code affected I > > discovered in th

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-18 Thread Arnd Bergmann
On Mon, Nov 18, 2024, at 13:22, Maciej W. Rozycki wrote: > On Mon, 18 Nov 2024, Arnd Bergmann wrote: > >> > This patch series addresses these issues in the last two changes, having >> > made generic test suite updates to improve coverage in the concerned area >> > first and then having addressed

Re: [PATCH 00/15] Fix data races with sub-longword accesses on Alpha

2024-11-18 Thread Arnd Bergmann
On Mon, Nov 18, 2024, at 03:59, Maciej W. Rozycki wrote: > > to zero a 9-byte member at the byte offset of 1 of a quadword-aligned > struct, happily clobbering a 1-byte member at the beginning of said struct > if there is a concurrent or parallel write to that member in the middle of > the unpro