Re: [PATCH v1 3/5] Add use of RCU for qemu_logfile.

2019-11-13 Thread Alex Bennée
Robert Foley writes: > On Tue, 12 Nov 2019 at 12:36, Alex Bennée wrote: >> >> >> > } >> > +atomic_rcu_set(_logfile, logfile); >> > } >> > -qemu_mutex_unlock(_logfile_mutex); >> > +logfile = qemu_logfile; >> >> Isn't this read outside of the protection of both

Re: [PATCH v1 3/5] Add use of RCU for qemu_logfile.

2019-11-12 Thread Robert Foley
On Tue, 12 Nov 2019 at 12:36, Alex Bennée wrote: > > > > } > > +atomic_rcu_set(_logfile, logfile); > > } > > -qemu_mutex_unlock(_logfile_mutex); > > +logfile = qemu_logfile; > > Isn't this read outside of the protection of both rcu_read_lock() and > the mutex? Could

Re: [PATCH v1 3/5] Add use of RCU for qemu_logfile.

2019-11-12 Thread Alex Bennée
Robert Foley writes: > This now allows changing the logfile while logging is active, > and also solves the issue of a seg fault while changing the logfile. > > Any read access to the qemu_logfile handle will use > the rcu_read_lock()/unlock() around the use of the handle. > To fetch the handle

[PATCH v1 3/5] Add use of RCU for qemu_logfile.

2019-11-12 Thread Robert Foley
This now allows changing the logfile while logging is active, and also solves the issue of a seg fault while changing the logfile. Any read access to the qemu_logfile handle will use the rcu_read_lock()/unlock() around the use of the handle. To fetch the handle we will use atomic_rcu_read(). We