Thread (1 message) 1 message, 1 author, 2007-10-22

Re: [PATCH] kvm uses smp_call_function_mask() in kvm_flush_remote_tlbs()

From: Avi Kivity <hidden>
Date: 2007-10-22 18:36:04

Avi Kivity wrote:
Carsten Otte wrote:
  
quoted
Laurent Vivier wrote:
  
    
quoted
This patches can be applied only on kvm-updates-2.6.24 and kvm-updates-2.6.25
as it needs smp_call_function_mask().
    
      
There's one thing I don't understand: How is this locked versus cpu 
hotplug? Isn't there an obvious race involved where a cpu unplugged 
after cpu_set()?

  
    
A cpu unplug first evicts all tasks from the victim cpu.  During this 
process, it calls kvm via a hotplug notifier, which notifier calls 
vcpu_clear() for all vcpus that are resident on that cpu.  So after it 
runs, there won't be any vcpus on the dead cpu.

The notifier is called from within stop_machine_run(), which ensures 
that no task is running on any cpu, so by the time the cpu is being 
unplugged, any concurrent call to kvm_flush_remote_tlbs() will have ended.

It's a miracle that it works.

  
Miracle indeed.  We need to disable preemption in 
kvm_flush_remote_tlbs(), otherwise the whole story falls apart.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help