Re: [Bug 1805256] Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191011175536.GB25464@xps13.dannf/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Bug 1805256] Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues Type: series Message-id

Re: [Bug 1805256] Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191011175536.GB25464@xps13.dannf/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread dann frazier
On Fri, Oct 11, 2019 at 06:05:25AM +, Jan Glauber wrote: > On Wed, Oct 09, 2019 at 11:15:04AM +0200, Paolo Bonzini wrote: > > On 09/10/19 10:02, Jan Glauber wrote: > > > > I'm still not sure what the actual issue is here, but could it be some bad > > > interaction between the notify_me and

[Bug 1805256] Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread dann frazier
On Fri, Oct 11, 2019 at 08:30:02AM +, Jan Glauber wrote: > On Fri, Oct 11, 2019 at 10:18:18AM +0200, Paolo Bonzini wrote: > > On 11/10/19 08:05, Jan Glauber wrote: > > > On Wed, Oct 09, 2019 at 11:15:04AM +0200, Paolo Bonzini wrote: > > >>> ...but if I bump notify_me size to uint64_t the issue

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread Jan Glauber
On Fri, Oct 11, 2019 at 10:18:18AM +0200, Paolo Bonzini wrote: > On 11/10/19 08:05, Jan Glauber wrote: > > On Wed, Oct 09, 2019 at 11:15:04AM +0200, Paolo Bonzini wrote: > >>> ...but if I bump notify_me size to uint64_t the issue goes away. > >> > >> Ouch. :) Is this with or without my patch(es)?

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread Paolo Bonzini
On 11/10/19 08:05, Jan Glauber wrote: > On Wed, Oct 09, 2019 at 11:15:04AM +0200, Paolo Bonzini wrote: >>> ...but if I bump notify_me size to uint64_t the issue goes away. >> >> Ouch. :) Is this with or without my patch(es)? You didn't answer this question. >> Also, what if you just add a dummy

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-11 Thread Jan Glauber
On Wed, Oct 09, 2019 at 11:15:04AM +0200, Paolo Bonzini wrote: > On 09/10/19 10:02, Jan Glauber wrote: > > I'm still not sure what the actual issue is here, but could it be some bad > > interaction between the notify_me and the list_lock? The are both 4 byte > > and side-by-side: > > > > address

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-09 Thread Paolo Bonzini
On 09/10/19 10:02, Jan Glauber wrote: > On Mon, Oct 07, 2019 at 04:58:30PM +0200, Paolo Bonzini wrote: >> On 07/10/19 16:44, dann frazier wrote: >>> On Mon, Oct 07, 2019 at 01:06:20PM +0200, Paolo Bonzini wrote: On 02/10/19 11:23, Jan Glauber wrote: > I've looked into this on ThunderX2.

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-09 Thread Jan Glauber
On Mon, Oct 07, 2019 at 04:58:30PM +0200, Paolo Bonzini wrote: > On 07/10/19 16:44, dann frazier wrote: > > On Mon, Oct 07, 2019 at 01:06:20PM +0200, Paolo Bonzini wrote: > >> On 02/10/19 11:23, Jan Glauber wrote: > >>> I've looked into this on ThunderX2. The arm64 code generated for the > >>>

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-07 Thread Paolo Bonzini
On 07/10/19 16:44, dann frazier wrote: > On Mon, Oct 07, 2019 at 01:06:20PM +0200, Paolo Bonzini wrote: >> On 02/10/19 11:23, Jan Glauber wrote: >>> I've looked into this on ThunderX2. The arm64 code generated for the >>> atomic_[add|sub] accesses of ctx->notify_me doesn't contain any >>> memory

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-07 Thread dann frazier
On Mon, Oct 07, 2019 at 01:06:20PM +0200, Paolo Bonzini wrote: > On 02/10/19 11:23, Jan Glauber wrote: > > I've looked into this on ThunderX2. The arm64 code generated for the > > atomic_[add|sub] accesses of ctx->notify_me doesn't contain any > > memory barriers. It is just plain ldaxr/stlxr. > >

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-07 Thread Jan Glauber
On Mon, Oct 07, 2019 at 01:06:20PM +0200, Paolo Bonzini wrote: > On 02/10/19 11:23, Jan Glauber wrote: > > I've looked into this on ThunderX2. The arm64 code generated for the > > atomic_[add|sub] accesses of ctx->notify_me doesn't contain any > > memory barriers. It is just plain ldaxr/stlxr. > >

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-07 Thread Paolo Bonzini
On 02/10/19 11:23, Jan Glauber wrote: > I've looked into this on ThunderX2. The arm64 code generated for the > atomic_[add|sub] accesses of ctx->notify_me doesn't contain any > memory barriers. It is just plain ldaxr/stlxr. > > From my understanding this is not sufficient for SMP sync. > > If I

Re: memory barriers and ATOMIC_SEQ_CST on aarch64 (was Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues)

2019-10-02 Thread Paolo Bonzini
On 02/10/19 16:58, Torvald Riegel wrote: > This example looks like Dekker synchronization (if I get the intent right). It is the same pattern. However, one of the two synchronized variables is a counter rather than just a flag. > Two possible implementations of this are either (1) with all

Re: memory barriers and ATOMIC_SEQ_CST on aarch64 (was Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues)

2019-10-02 Thread Torvald Riegel
On Wed, 2019-10-02 at 15:20 +0200, Paolo Bonzini wrote: > On 02/10/19 13:05, Jan Glauber wrote: > > The arm64 code generated for the > > atomic_[add|sub] accesses of ctx->notify_me doesn't contain any > > memory barriers. It is just plain ldaxr/stlxr. > > > > From my understanding this is not

memory barriers and ATOMIC_SEQ_CST on aarch64 (was Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues)

2019-10-02 Thread Paolo Bonzini
On 02/10/19 13:05, Jan Glauber wrote: > The arm64 code generated for the > atomic_[add|sub] accesses of ctx->notify_me doesn't contain any > memory barriers. It is just plain ldaxr/stlxr. > > From my understanding this is not sufficient for SMP sync. > >>> If I read this comment correct: >>>

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-02 Thread Jan Glauber
On Wed, Oct 02, 2019 at 11:45:19AM +0200, Paolo Bonzini wrote: > On 02/10/19 11:23, Jan Glauber wrote: > > I've tried to verify me theory with this patch and didn't run into the > > issue for ~500 iterations (usually I would trigger the issue ~20 > > iterations). > > Awesome! That would be a

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-02 Thread Jan Glauber
I've looked into this on ThunderX2. The arm64 code generated for the atomic_[add|sub] accesses of ctx->notify_me doesn't contain any memory barriers. It is just plain ldaxr/stlxr. >From my understanding this is not sufficient for SMP sync. If I read this comment correct: void

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-10-02 Thread Paolo Bonzini
On 02/10/19 11:23, Jan Glauber wrote: > I've tried to verify me theory with this patch and didn't run into the > issue for ~500 iterations (usually I would trigger the issue ~20 iterations). Awesome! That would be a compiler bug though, as atomic_add and atomic_sub are defined as sequentially

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-09-24 Thread dann frazier
On Wed, Sep 11, 2019 at 04:09:25PM -0300, Rafael David Tinoco wrote: > > Zhengui's theory that notify_me doesn't work properly on ARM is more > > promising, but he couldn't provide a clear explanation of why he thought > > notify_me is involved. In particular, I would have expected notify_me to >

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-09-11 Thread Rafael David Tinoco
> Zhengui's theory that notify_me doesn't work properly on ARM is more > promising, but he couldn't provide a clear explanation of why he thought > notify_me is involved. In particular, I would have expected notify_me to > be wrong if the qemu_poll_ns call came from aio_ctx_dispatch, for example:

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-09-11 Thread Rafael David Tinoco
> Note that the RCU thread is expected to sit most of the time doing > nothing, so I don't think this matters. Agreed. > Zhengui's theory that notify_me doesn't work properly on ARM is more > promising, but he couldn't provide a clear explanation of why he thought > notify_me is involved. In

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-09-11 Thread Paolo Bonzini
Note that the RCU thread is expected to sit most of the time doing nothing, so I don't think this matters. Zhengui's theory that notify_me doesn't work properly on ARM is more promising, but he couldn't provide a clear explanation of why he thought notify_me is involved. In particular, I would

Re: [Qemu-devel] qemu_futex_wait() lockups in ARM64: 2 possible issues

2019-09-11 Thread Rafael David Tinoco
Quick update... > value INT_MAX (4294967295) seems WRONG for qemu_futex_wait(): > > - EV_BUSY, being -1, and passed as an argument qemu_futex_wait(void *, > unsigned), is a two's complement, making argument into a INT_MAX when > that's not what is expected (unless I missed something). > > ***