Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-30 Thread Julien Grall
Hi Jan, On 20/10/2020 15:08, Jan Beulich wrote: There's no global lock around the updating of this global piece of data. Make use of cmpxchgptr() to avoid two entities racing with their updates. While touching the functionality, mark xen_consumers[] read-mostly (or else the if() condition could

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Roger Pau Monné
On Thu, Oct 22, 2020 at 10:56:15AM +0200, Jan Beulich wrote: > On 22.10.2020 10:29, Roger Pau Monné wrote: > > On Thu, Oct 22, 2020 at 10:15:45AM +0200, Jan Beulich wrote: > >> On 22.10.2020 10:11, Roger Pau Monné wrote: > >>> On Thu, Oct 22, 2020 at 09:33:27AM +0200, Jan Beulich wrote: > On 2

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Roger Pau Monné
On Tue, Oct 20, 2020 at 04:08:13PM +0200, Jan Beulich wrote: > There's no global lock around the updating of this global piece of data. > Make use of cmpxchgptr() to avoid two entities racing with their > updates. > > While touching the functionality, mark xen_consumers[] read-mostly (or > else th

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Jan Beulich
On 22.10.2020 10:29, Roger Pau Monné wrote: > On Thu, Oct 22, 2020 at 10:15:45AM +0200, Jan Beulich wrote: >> On 22.10.2020 10:11, Roger Pau Monné wrote: >>> On Thu, Oct 22, 2020 at 09:33:27AM +0200, Jan Beulich wrote: On 21.10.2020 17:46, Roger Pau Monné wrote: > On Tue, Oct 20, 2020 at 0

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Roger Pau Monné
On Thu, Oct 22, 2020 at 10:15:45AM +0200, Jan Beulich wrote: > On 22.10.2020 10:11, Roger Pau Monné wrote: > > On Thu, Oct 22, 2020 at 09:33:27AM +0200, Jan Beulich wrote: > >> On 21.10.2020 17:46, Roger Pau Monné wrote: > >>> On Tue, Oct 20, 2020 at 04:08:13PM +0200, Jan Beulich wrote: > @@ -

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Jan Beulich
On 22.10.2020 10:11, Roger Pau Monné wrote: > On Thu, Oct 22, 2020 at 09:33:27AM +0200, Jan Beulich wrote: >> On 21.10.2020 17:46, Roger Pau Monné wrote: >>> On Tue, Oct 20, 2020 at 04:08:13PM +0200, Jan Beulich wrote: @@ -80,8 +81,9 @@ static uint8_t get_xen_consumer(xen_even

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Roger Pau Monné
On Thu, Oct 22, 2020 at 09:33:27AM +0200, Jan Beulich wrote: > On 21.10.2020 17:46, Roger Pau Monné wrote: > > On Tue, Oct 20, 2020 at 04:08:13PM +0200, Jan Beulich wrote: > >> There's no global lock around the updating of this global piece of data. > >> Make use of cmpxchgptr() to avoid two entiti

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-22 Thread Jan Beulich
On 21.10.2020 17:46, Roger Pau Monné wrote: > On Tue, Oct 20, 2020 at 04:08:13PM +0200, Jan Beulich wrote: >> There's no global lock around the updating of this global piece of data. >> Make use of cmpxchgptr() to avoid two entities racing with their >> updates. >> >> While touching the functionali

Re: [PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-21 Thread Roger Pau Monné
On Tue, Oct 20, 2020 at 04:08:13PM +0200, Jan Beulich wrote: > There's no global lock around the updating of this global piece of data. > Make use of cmpxchgptr() to avoid two entities racing with their > updates. > > While touching the functionality, mark xen_consumers[] read-mostly (or > else th

[PATCH v2 1/8] evtchn: avoid race in get_xen_consumer()

2020-10-20 Thread Jan Beulich
There's no global lock around the updating of this global piece of data. Make use of cmpxchgptr() to avoid two entities racing with their updates. While touching the functionality, mark xen_consumers[] read-mostly (or else the if() condition could use the result of cmpxchgptr(), writing to the slo