Re: [PATCH v2] kvm/x86: Handle async PF in RCU read-side critical sections

2017-10-02 Thread Paul E. McKenney
On Mon, Oct 02, 2017 at 05:11:07PM -0400, Paolo Bonzini wrote: > > - Paul E. McKenney wrote: > > Actually, we should be able to do a little bit better than that. > > If PREEMPT=n but PREEMPT_COUNT=y, then preempt_count() will know > > about RCU read-side critical sections via preempt_disable(

Re: [PATCH v2] kvm/x86: Handle async PF in RCU read-side critical sections

2017-10-02 Thread Paolo Bonzini
- Paul E. McKenney wrote: > Actually, we should be able to do a little bit better than that. > If PREEMPT=n but PREEMPT_COUNT=y, then preempt_count() will know > about RCU read-side critical sections via preempt_disable(). > > So maybe something like this? > > n.halted = is_idle_task(

Re: [PATCH v2] kvm/x86: Handle async PF in RCU read-side critical sections

2017-10-02 Thread Paul E. McKenney
On Mon, Oct 02, 2017 at 10:43:00PM +0800, Boqun Feng wrote: > On Mon, Oct 02, 2017 at 01:41:03PM +, Paolo Bonzini wrote: > [...] > > > > > > Wanpeng, the callsite of kvm_async_pf_task_wait() in > > > kvm_handle_page_fault() is for nested scenario, right? I take it we > > > should handle it as

Re: [PATCH v2] kvm/x86: Handle async PF in RCU read-side critical sections

2017-10-02 Thread Boqun Feng
On Mon, Oct 02, 2017 at 01:41:03PM +, Paolo Bonzini wrote: [...] > > > > Wanpeng, the callsite of kvm_async_pf_task_wait() in > > kvm_handle_page_fault() is for nested scenario, right? I take it we > > should handle it as if the fault happens when l1 guest is running in > > kernel mode, so @us

Re: [PATCH v2] kvm/x86: Handle async PF in RCU read-side critical sections

2017-10-02 Thread Paolo Bonzini
On 01/10/2017 03:31, Boqun Feng wrote: > Sasha Levin reported a WARNING: > > | WARNING: CPU: 0 PID: 6974 at kernel/rcu/tree_plugin.h:329 > | rcu_preempt_note_context_switch kernel/rcu/tree_plugin.h:329 [inline] > | WARNING: CPU: 0 PID: 6974 at kernel/rcu/tree_plugin.h:329 > | rcu_note_context_swit

[PATCH v2] kvm/x86: Handle async PF in RCU read-side critical sections

2017-09-30 Thread Boqun Feng
Sasha Levin reported a WARNING: | WARNING: CPU: 0 PID: 6974 at kernel/rcu/tree_plugin.h:329 | rcu_preempt_note_context_switch kernel/rcu/tree_plugin.h:329 [inline] | WARNING: CPU: 0 PID: 6974 at kernel/rcu/tree_plugin.h:329 | rcu_note_context_switch+0x16c/0x2210 kernel/rcu/tree.c:458 ... | CPU: 0