Re: [Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST

2018-08-19 Thread Emilio G. Cota
On Fri, Aug 17, 2018 at 19:53:40 +0200, Paolo Bonzini wrote: > On 15/08/2018 02:34, Emilio G. Cota wrote: > > On Tue, Aug 14, 2018 at 08:26:54 +0200, Paolo Bonzini wrote: > >> On 13/08/2018 18:38, Emilio G. Cota wrote: > >>> Fix it by implementing the CPU list as an RCU QLIST. This requires > >>> a

Re: [Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST

2018-08-17 Thread Paolo Bonzini
On 15/08/2018 02:34, Emilio G. Cota wrote: > On Tue, Aug 14, 2018 at 08:26:54 +0200, Paolo Bonzini wrote: >> On 13/08/2018 18:38, Emilio G. Cota wrote: >>> Fix it by implementing the CPU list as an RCU QLIST. This requires >>> a little bit of extra work to insert CPUs at the tail of >>> the list an

Re: [Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST

2018-08-14 Thread Emilio G. Cota
On Tue, Aug 14, 2018 at 08:26:54 +0200, Paolo Bonzini wrote: > On 13/08/2018 18:38, Emilio G. Cota wrote: > > Fix it by implementing the CPU list as an RCU QLIST. This requires > > a little bit of extra work to insert CPUs at the tail of > > the list and to iterate over the list in reverse order (s

Re: [Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST

2018-08-13 Thread Paolo Bonzini
On 13/08/2018 18:38, Emilio G. Cota wrote: > > Fix it by implementing the CPU list as an RCU QLIST. This requires > a little bit of extra work to insert CPUs at the tail of > the list and to iterate over the list in reverse order (see previous patch). > > One might be tempted to just insert new C

[Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST

2018-08-13 Thread Emilio G. Cota
Iterating over the list without using atomics is undefined behaviour, since the list can be modified concurrently by other threads (e.g. every time a new thread is created in user-mode). Fix it by implementing the CPU list as an RCU QLIST. This requires a little bit of extra work to insert CPUs at