Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-17 Thread Alex Bligh
On 17 Feb 2014, at 16:13, Mike Day wrote: >> 1. You seem to be removing the use of the active_timers_lock and replacing >> it by >> rcu (fine). However, you seem to have left the qemu_mutex_destroy in >> timerlist_free, and left the mutex in QEMUTimerList. Any reason why we >> need both? >

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-17 Thread Mike Day
> 1. You seem to be removing the use of the active_timers_lock and replacing it > by >rcu (fine). However, you seem to have left the qemu_mutex_destroy in >timerlist_free, and left the mutex in QEMUTimerList. Any reason why we > need both? > I responded incorrectly to this yesterday. We

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-15 Thread Alex Bligh
Mike, On 15 Feb 2014, at 20:33, Mike Day wrote: >> >> 2. You have introduced rcu not only to protect active_timers, the list of >> active timers within one timerlist, but also to protect (I think) >> the list of timerlists, as evidenced by the fact you have >> reclaim_timer_list as well as

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-15 Thread Mike Day
Alex Bligh writes: > Some comments: Thanks for the thorough review! > 1. You seem to be removing the use of the active_timers_lock and replacing it > by >rcu (fine). However, you seem to have left the qemu_mutex_destroy in >timerlist_free, and left the mutex in QEMUTimerList. Any reason

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-15 Thread Alex Bligh
Mike, Some comments: 1. You seem to be removing the use of the active_timers_lock and replacing it by rcu (fine). However, you seem to have left the qemu_mutex_destroy in timerlist_free, and left the mutex in QEMUTimerList. Any reason why we need both? 2. You have introduced rcu not onl

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-13 Thread Alex Bligh
On 13 Feb 2014, at 12:06, Mike Day wrote: >> I think that, more than contention, it tries to reduce the cost of >> synchronization primitives, especially the locking and unlocking of the list >> around the invocation of timer callbacks. > > Yes, the assumption is that the active timers are a rea

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-13 Thread Mike Day
On Thu, Feb 13, 2014 at 4:25 AM, Paolo Bonzini wrote: > Il 13/02/2014 10:11, Alex Bligh ha scritto: >> >> I'll certainly have a look through this. However before I do, what >> problem is this trying to solve? Do we think there is possibility >> of contention on the active timers lock? I used to th

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-13 Thread Paolo Bonzini
Il 13/02/2014 10:11, Alex Bligh ha scritto: Mike, On 12 Feb 2014, at 19:09, Mike Day wrote: Allow readers to use RCU when reading Qemu timer lists. Applies to Paolo Bonzini's RCU branch, https://github.com/bonzini/qemu/tree/rcu. This patch is for comment and review only. The rcu branch needs

Re: [Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-13 Thread Alex Bligh
Mike, On 12 Feb 2014, at 19:09, Mike Day wrote: > Allow readers to use RCU when reading Qemu timer lists. Applies to > Paolo Bonzini's RCU branch, https://github.com/bonzini/qemu/tree/rcu. > > This patch is for comment and review only. The rcu branch needs to be > rebased on upstream. I'll cer

[Qemu-devel] [PATCH] [RFC] Convert Qemu Timer List and Active Timers to RCU

2014-02-12 Thread Mike Day
Allow readers to use RCU when reading Qemu timer lists. Applies to Paolo Bonzini's RCU branch, https://github.com/bonzini/qemu/tree/rcu. This patch is for comment and review only. The rcu branch needs to be rebased on upstream. Signed-off-by: Mike Day --- include/qemu/timer.h | 9 +- qem