Re: [KVM-RFC PATCH 2/2] kvm: use POLLHUP to close an irqfd instead of an explicit ioctl

2009-06-02 Thread Paul E. McKenney
irqfd specific ABI without taking the normal > precautions, such as CAP bits. A few questions and suggestions interspersed below. Thanx, Paul > Signed-off-by: Gregory Haskins > CC: Davide Libenzi > CC: Michael S. Tsirkin

Re: [KVM-RFC PATCH 2/2] kvm: use POLLHUP to close an irqfd instead of an explicit ioctl

2009-06-02 Thread Paul E. McKenney
On Tue, Jun 02, 2009 at 02:23:14PM -0400, Gregory Haskins wrote: > Paul E. McKenney wrote: > > On Tue, Jun 02, 2009 at 11:15:38AM -0400, Gregory Haskins wrote: > > > >> Assigning an irqfd object to a kvm object creates a relationship that we > >> currently manag

Re: [KVM-RFC PATCH 2/2] kvm: use POLLHUP to close an irqfd instead of an explicit ioctl

2009-06-03 Thread Paul E. McKenney
On Tue, Jun 02, 2009 at 09:53:29PM -0400, Gregory Haskins wrote: > Paul E. McKenney wrote: > > On Tue, Jun 02, 2009 at 02:23:14PM -0400, Gregory Haskins wrote: > > > >> Paul E. McKenney wrote: > >> > >>> On Tue, Jun 02, 20

Re: [KVM PATCH v5 2/2] kvm: add iosignalfd support

2009-06-03 Thread Paul E. McKenney
On Wed, Jun 03, 2009 at 04:17:49PM -0400, Gregory Haskins wrote: > iosignalfd is a mechanism to register PIO/MMIO regions to trigger an eventfd > signal when written to by a guest. Host userspace can register any arbitrary > IO address with a corresponding eventfd and then pass the eventfd to a >

Re: [RFC PATCH v2 00/19] virtual-bus

2009-06-04 Thread Paul E. McKenney
On Fri, Jun 05, 2009 at 02:25:01PM +0930, Rusty Russell wrote: > On Fri, 5 Jun 2009 04:19:17 am Gregory Haskins wrote: > > Avi Kivity wrote: > > > Gregory Haskins wrote: > > > One idea is similar to signalfd() or eventfd() > > > > And thus the "kvm-eventfd" (irqfd/iosignalfd) interface project was

Re: [RFC PATCH v2 00/19] virtual-bus

2009-06-05 Thread Paul E. McKenney
On Sat, Jun 06, 2009 at 12:25:57AM +0930, Rusty Russell wrote: > On Fri, 5 Jun 2009 03:00:10 pm Paul E. McKenney wrote: > > On Fri, Jun 05, 2009 at 02:25:01PM +0930, Rusty Russell wrote: > > > + /* lg->eventfds is RCU-protected */ > > > + preempt_disable(

Re: array of pointers with rcu

2009-06-28 Thread Paul E. McKenney
On Sun, Jun 28, 2009 at 04:22:24PM +0300, Michael S. Tsirkin wrote: > Paul, > I'd like to implement a static array of pointers with rcu. > (Note that Documentation/RCU/arrayRCU.txt addresses only the case of > static arrays where the data (rather than a pointer to the data) is > located in each arr

Re: array of pointers with rcu

2009-06-28 Thread Paul E. McKenney
On Sun, Jun 28, 2009 at 10:06:36PM +0300, Michael S. Tsirkin wrote: > On Sun, Jun 28, 2009 at 09:14:11AM -0700, Paul E. McKenney wrote: > > On Sun, Jun 28, 2009 at 04:22:24PM +0300, Michael S. Tsirkin wrote: > > > Paul, > > > I'd like to implement a static array o

Re: [PATCH 4/4] Convert irq notifiers lists to RCU locking.

2009-07-13 Thread Paul E. McKenney
On Mon, Jul 13, 2009 at 04:40:59PM +0300, Michael S. Tsirkin wrote: > On Mon, Jul 13, 2009 at 04:32:34PM +0300, Gleb Natapov wrote: > > Yeah I understand that other RCU read section may introduce delays too. > > The question is how big the delay may be. > > I recall seeing the number "at least 3 j

Re: [PATCH 4/4] Convert irq notifiers lists to RCU locking.

2009-07-14 Thread Paul E. McKenney
On Tue, Jul 14, 2009 at 08:46:12AM +0300, Gleb Natapov wrote: > On Mon, Jul 13, 2009 at 12:31:39PM -0700, Paul E. McKenney wrote: > > On Mon, Jul 13, 2009 at 04:40:59PM +0300, Michael S. Tsirkin wrote: > > > On Mon, Jul 13, 2009 at 04:32:34PM +0300, Gleb Natapov wrote: > &g

Re: [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-12 Thread Paul E. McKenney
On Fri, Aug 12, 2011 at 09:55:20AM +0800, Jason Wang wrote: > With the abstraction that each socket were a backend of a > queue for userspace, this patch adds multiqueue support for > tap device by allowing multiple sockets to be attached to a > tap device. Then we could parallize the transmission

RCU treating guest mode just like it does user-mode execution

2011-08-17 Thread Paul E. McKenney
Hello, Gleb, I was looking at KVM's call to rcu_virt_note_context_switch() in kvm_guest_enter(), and noting the comment talking about treating guest mode like user-mode execution is. One difference between RCU's treatment of KVM guest execution and user-mode execution is that RCU notes a context

Re: RCU treating guest mode just like it does user-mode execution

2011-08-17 Thread Paul E. McKenney
On Thu, Aug 18, 2011 at 12:50:15AM +0300, Gleb Natapov wrote: > On Wed, Aug 17, 2011 at 01:43:27PM -0700, Paul E. McKenney wrote: > > Hello, Gleb, > > > > I was looking at KVM's call to rcu_virt_note_context_switch() > > in kvm_guest_enter(), and noting th

Re: RCU treating guest mode just like it does user-mode execution

2011-08-17 Thread Paul E. McKenney
On Thu, Aug 18, 2011 at 02:55:29AM +0300, Gleb Natapov wrote: > On Wed, Aug 17, 2011 at 03:05:20PM -0700, Paul E. McKenney wrote: > > On Thu, Aug 18, 2011 at 12:50:15AM +0300, Gleb Natapov wrote: > > > On Wed, Aug 17, 2011 at 01:43:27PM -0700, Paul E. McKenney wrote: &

Re: RCU treating guest mode just like it does user-mode execution

2011-08-17 Thread Paul E. McKenney
On Wed, Aug 17, 2011 at 05:28:46PM -0700, Avi Kivity wrote: > On 08/17/2011 05:25 PM, Paul E. McKenney wrote: > >> > > >> Wouldn't scheduling-clock interrupt kick vcpu out of a guest mode much > >> earlier then 30 seconds? > > > >The scheduli

Re: Testing tracer wakeup_rt: .. no entries found ..FAILED!

2012-07-31 Thread Paul E. McKenney
On Tue, Jul 31, 2012 at 07:51:39PM -0400, Steven Rostedt wrote: > On Wed, 2012-08-01 at 07:43 +0800, Fengguang Wu wrote: > > On Tue, Jul 31, 2012 at 09:13:39AM -0400, Steven Rostedt wrote: > > > On Tue, 2012-07-31 at 15:50 +0300, Avi Kivity wrote: > > > > On 07/31/2012 03:43 PM, Steven Rostedt wrot

Re: Testing tracer wakeup_rt: .. no entries found ..FAILED!

2012-07-31 Thread Paul E. McKenney
On Tue, Jul 31, 2012 at 08:09:38PM -0400, Steven Rostedt wrote: > On Tue, 2012-07-31 at 16:57 -0700, Paul E. McKenney wrote: > > > > What was the next lines? I bet you it was "PASSED". Which means it did > > > not fail. This is the second bug you found that has

Re: [PATCH] vhost: rcu annotation fixup

2011-01-18 Thread Paul E. McKenney
On Tue, Jan 18, 2011 at 01:08:45PM +0200, Michael S. Tsirkin wrote: > When built with rcu checks enabled, vhost triggers > bogus warnings as vhost features are read without > dev->mutex sometimes. > Fixing it properly is not trivial as vhost.h does not > know which lockdep classes it will be used u

Re: [PATCH] vhost: rcu annotation fixup

2011-01-18 Thread Paul E. McKenney
On Tue, Jan 18, 2011 at 07:55:00PM +0200, Michael S. Tsirkin wrote: > On Tue, Jan 18, 2011 at 09:48:34AM -0800, Paul E. McKenney wrote: > > On Tue, Jan 18, 2011 at 01:08:45PM +0200, Michael S. Tsirkin wrote: > > > When built with rcu checks enabled, vhost triggers > > &

Re: [PATCH] vhost: rcu annotation fixup

2011-01-18 Thread Paul E. McKenney
On Tue, Jan 18, 2011 at 10:10:31PM +0200, Michael S. Tsirkin wrote: > On Tue, Jan 18, 2011 at 11:02:33AM -0800, Paul E. McKenney wrote: > > On Tue, Jan 18, 2011 at 07:55:00PM +0200, Michael S. Tsirkin wrote: > > > On Tue, Jan 18, 2011 at 09:48:34AM -0800, Paul E. McKenney wro

Re: [RFC][PATCH] srcu: Implement call_srcu()

2012-01-31 Thread Paul E. McKenney
On Tue, Jan 31, 2012 at 02:50:07PM +0100, Peter Zijlstra wrote: > On Tue, 2012-01-31 at 15:47 +0200, Avi Kivity wrote: > > > They really need to return quickly to userspace, and they really need to > > perform some operation between rcu_assign_pointer() and returning, so no. > > Bugger :/ > > >

Re: [RFC][PATCH] srcu: Implement call_srcu()

2012-02-01 Thread Paul E. McKenney
On Wed, Feb 01, 2012 at 11:22:29AM +0100, Peter Zijlstra wrote: > On Tue, 2012-01-31 at 14:24 -0800, Paul E. McKenney wrote: > > > > > Can we get it back to speed by scheduling a work function on all cpus? > > > > wouldn't that force a quiescent

Re: async pf: INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected

2012-04-27 Thread Paul E. McKenney
On Thu, Apr 26, 2012 at 04:50:35PM +0200, Sasha Levin wrote: > Hi all. > > I got a "INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected" warning > while running LTP inside a KVM guest using the recent -next kernel. > > It seems that it was initially originated from rcu_torture_rea(), but I >

Re: async pf: INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected

2012-04-27 Thread Paul E. McKenney
On Fri, Apr 27, 2012 at 08:05:15PM +0200, Sasha Levin wrote: > On Fri, Apr 27, 2012 at 5:23 PM, Paul E. McKenney > wrote: > > > > On Thu, Apr 26, 2012 at 04:50:35PM +0200, Sasha Levin wrote: > > > Hi all. > > > > > > I got a "INFO: SOFTIRQ-safe -&

Re: [RFC PATCH v1 3/5] KVM: Add paravirt kvm_flush_tlb_others

2012-05-01 Thread Paul E. McKenney
On Tue, May 01, 2012 at 06:16:46PM +0200, Peter Zijlstra wrote: > On Tue, 2012-05-01 at 18:36 +0300, Avi Kivity wrote: > > > > > What bounds the amount of memory waiting to be freed during an rcu grace > > > > period? > > > > > > Most RCU implementations don't have limits, so that could be quite a

Re: possible circular locking dependency

2012-05-06 Thread Paul E. McKenney
On Sun, May 06, 2012 at 11:55:30AM +0300, Avi Kivity wrote: > On 05/03/2012 11:02 PM, Sergey Senozhatsky wrote: > > Hello, > > 3.4-rc5 > > Whoa. > > Looks like inconsistent locking between cpufreq and > synchronize_srcu_expedited(). kvm triggered this because it is one of > the few users of sync

Re: possible circular locking dependency

2012-05-06 Thread Paul E. McKenney
On Sun, May 06, 2012 at 11:34:39PM +0300, Sergey Senozhatsky wrote: > On (05/06/12 09:42), Paul E. McKenney wrote: > > On Sun, May 06, 2012 at 11:55:30AM +0300, Avi Kivity wrote: > > > On 05/03/2012 11:02 PM, Sergey Senozhatsky wrote: > > > > Hello, >

Re: kvm: RCU warning in async pf

2012-04-03 Thread Paul E. McKenney
On Mon, Apr 02, 2012 at 08:54:32PM -0400, Sasha Levin wrote: > Hi all, > > I got the spew at the bottom of the mail in a KVM guest using the KVM tools > and running trinity. > > I'm not quite sure how default_idle managed to trigger a pagefault, so that > part looks odd to me. Wrapping the off

Re: kvm: RCU warning in async pf

2012-04-04 Thread Paul E. McKenney
gt; > > The patch below solves it for me: > > "Page ready" async PF can kick vcpu out of idle state much like IRQ. > We need to tell RCU about this. This is invoked from an exception or interrupt handler, not from process-level code? If so: Reviewed-by: Paul E. McKe

Re: [PATCH 1/2] vhost test module

2010-12-02 Thread Paul E. McKenney
On Mon, Nov 29, 2010 at 07:09:01PM +0200, Michael S. Tsirkin wrote: > This adds a test module for vhost infrastructure. > Intentionally not tied to kbuild to prevent people > from installing and loading it accidentally. > > Signed-off-by: Michael S. Tsirkin On question below. > --- > > diff --

Re: [PATCH 1/2] vhost test module

2010-12-02 Thread Paul E. McKenney
On Thu, Dec 02, 2010 at 09:11:30PM +0200, Michael S. Tsirkin wrote: > On Thu, Dec 02, 2010 at 11:00:37AM -0800, Paul E. McKenney wrote: > > On Mon, Nov 29, 2010 at 07:09:01PM +0200, Michael S. Tsirkin wrote: > > > This adds a test module for vhost infrastructure. > > >

Re: [PATCH 1/2] vhost test module

2010-12-02 Thread Paul E. McKenney
On Thu, Dec 02, 2010 at 09:47:09PM +0200, Michael S. Tsirkin wrote: > On Thu, Dec 02, 2010 at 11:26:16AM -0800, Paul E. McKenney wrote: > > On Thu, Dec 02, 2010 at 09:11:30PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Dec 02, 2010 at 11:00:37AM -0800, Paul E. McKenney wro

Re: [PATCH 1/2] vhost test module

2010-12-02 Thread Paul E. McKenney
On Fri, Dec 03, 2010 at 01:18:18AM +0200, Michael S. Tsirkin wrote: > On Thu, Dec 02, 2010 at 03:13:03PM -0800, Paul E. McKenney wrote: > > On Thu, Dec 02, 2010 at 09:47:09PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Dec 02, 2010 at 11:26:16AM -0800, Paul E. McKenney wro

Re: [PATCH 1/2] vhost test module

2010-12-04 Thread Paul E. McKenney
On Thu, Dec 02, 2010 at 03:56:56PM -0800, Paul E. McKenney wrote: > On Fri, Dec 03, 2010 at 01:18:18AM +0200, Michael S. Tsirkin wrote: > > On Thu, Dec 02, 2010 at 03:13:03PM -0800, Paul E. McKenney wrote: > > > On Thu, Dec 02, 2010 at 09:47:09PM +0200, Michael S. Tsirkin wro

Re: RCU+KVM: making CPU guest mode a quiescent state.

2011-04-26 Thread Paul E. McKenney
On Tue, Apr 26, 2011 at 03:38:24PM +0300, Gleb Natapov wrote: > Hello Paul, > > I have a question about RCU + KVM. KVM does not hold any references to RCU > protected data when it switches CPU into a guest mode. In fact switching > to a guest mode is very similar to exiting to userspase from RCU p

Re: RCU+KVM: making CPU guest mode a quiescent state.

2011-04-27 Thread Paul E. McKenney
On Wed, Apr 27, 2011 at 10:47:04AM +0300, Avi Kivity wrote: > On 04/26/2011 06:55 PM, Paul E. McKenney wrote: > >On Tue, Apr 26, 2011 at 03:38:24PM +0300, Gleb Natapov wrote: > >> Hello Paul, > >> > >> I have a question about RCU + KVM. KVM does not hold a

Re: RCU+KVM: making CPU guest mode a quiescent state.

2011-04-27 Thread Paul E. McKenney
On Wed, Apr 27, 2011 at 03:41:41PM +0300, Gleb Natapov wrote: > On Tue, Apr 26, 2011 at 08:55:28AM -0700, Paul E. McKenney wrote: > > On Tue, Apr 26, 2011 at 03:38:24PM +0300, Gleb Natapov wrote: > > > Hello Paul, > > > > > > I have a question about RCU + KVM.

Re: [PATCH 1/2] rcu: export rcu_note_context_switch() function

2011-04-29 Thread Paul E. McKenney
On Fri, Apr 29, 2011 at 01:36:18AM -0700, Paul E. McKenney wrote: > On Thu, Apr 28, 2011 at 12:52:02PM +0300, Gleb Natapov wrote: > > Hmmm This is interesting. KVM being a module, we either expand > TINY_RCU's size a bit by making rcu_note_context_switch() be a real > f

Re: [PATCH 1/2] rcu: export rcu_note_context_switch() function

2011-04-29 Thread Paul E. McKenney
On Thu, Apr 28, 2011 at 12:52:02PM +0300, Gleb Natapov wrote: Hmmm This is interesting. KVM being a module, we either expand TINY_RCU's size a bit by making rcu_note_context_switch() be a real function in rcutiny.c and adding an export, or we expand it by adding two exports. I would like to

Re: [PATCH 1/2] rcu: export rcu_note_context_switch() function

2011-04-30 Thread Paul E. McKenney
On Fri, Apr 29, 2011 at 09:02:39PM +0300, Gleb Natapov wrote: > On Fri, Apr 29, 2011 at 01:39:04AM -0700, Paul E. McKenney wrote: > > On Fri, Apr 29, 2011 at 01:36:18AM -0700, Paul E. McKenney wrote: > > > On Thu, Apr 28, 2011 at 12:52:02PM +0300, Gleb Natapov wrote: > > &g

Re: [PATCH 1/2] rcu: export rcu_note_context_switch() function

2011-05-02 Thread Paul E. McKenney
On Mon, May 02, 2011 at 01:56:12PM +0300, Gleb Natapov wrote: > On Sat, Apr 30, 2011 at 05:59:28AM -0700, Paul E. McKenney wrote: > > On Fri, Apr 29, 2011 at 09:02:39PM +0300, Gleb Natapov wrote: > > > On Fri, Apr 29, 2011 at 01:39:04AM -0700, Paul E. McKenney wrote: > >

Re: [PATCH 1/2] rcu: export rcu_note_context_switch() function

2011-05-03 Thread Paul E. McKenney
On Mon, May 02, 2011 at 05:10:03PM +0300, Gleb Natapov wrote: > On Mon, May 02, 2011 at 06:36:08AM -0700, Paul E. McKenney wrote: > > On Mon, May 02, 2011 at 01:56:12PM +0300, Gleb Natapov wrote: > > > On Sat, Apr 30, 2011 at 05:59:28AM -0700, Paul E. McKenney wrote: > >

Re: [PATCH 1/2] rcu: provide rcu_virt_note_context_switch() function.

2011-05-04 Thread Paul E. McKenney
On Wed, May 04, 2011 at 04:31:03PM +0300, Gleb Natapov wrote: > Provide rcu_virt_note_context_switch() for vitalization use to note > quiescent state during guest entry. Very good, queued on -rcu. Unless you tell me otherwise, I will assume that you want to carry the patch modifying KVM to use th

Re: [PATCH 1/2] rcu: provide rcu_virt_note_context_switch() function.

2011-05-09 Thread Paul E. McKenney
On Mon, May 09, 2011 at 11:51:34AM +0300, Avi Kivity wrote: > On 05/04/2011 07:35 PM, Paul E. McKenney wrote: > >On Wed, May 04, 2011 at 04:31:03PM +0300, Gleb Natapov wrote: > >> Provide rcu_virt_note_context_switch() for vitalization use to note > >> quiesce

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-26 Thread Paul E. McKenney
On Thu, May 26, 2011 at 07:05:08PM -0400, Mathieu Desnoyers wrote: > * Ingo Molnar (mi...@elte.hu) wrote: > > > > * Pekka Enberg wrote: > > > > > On Thu, May 26, 2011 at 9:11 PM, Avi Kivity wrote: > > > > On 05/26/2011 09:05 PM, Ingo Molnar wrote: > > > >> > > > >> > > > > >> >  I've added some

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-27 Thread Paul E. McKenney
On Fri, May 27, 2011 at 11:12:20AM +0200, Ingo Molnar wrote: > > * Paul E. McKenney wrote: > > > > > > I'm CC'ing Paul and Mathieu as well for urcu. > > > > I am hoping we can get better convergence between the user-level > > and kernel-le

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-28 Thread Paul E. McKenney
On Sat, May 28, 2011 at 05:24:08PM +0200, Ingo Molnar wrote: > > * Sasha Levin wrote: > > > So the basic plan here is to allocate a futex(?) for each VCPU > > thread, and have the writer thread lock all futexes when it needs > > to write? > > > > If we assume we only have one writer thread, i

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-29 Thread Paul E. McKenney
On Sun, May 29, 2011 at 09:19:48AM +0200, Ingo Molnar wrote: > > * Avi Kivity wrote: > > > Yes, this is equivalent to the kernel's stop_machine_run(). It's a > > heavyweight method but it should work just fine. > > Yeah. It is fine for reconfiguration/configuration-only kind of write > paths

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-29 Thread Paul E. McKenney
On Sun, May 29, 2011 at 06:00:00PM +0300, Avi Kivity wrote: > On 05/29/2011 05:27 PM, Ingo Molnar wrote: > >* Avi Kivity wrote: > > > >> I don't understand how you expect per_cpu to work in userspace. As > >> soon as you calculate the per-cpu address, it can be invalidated. > >> It doesn't hel

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-29 Thread Paul E. McKenney
On Sun, May 29, 2011 at 08:31:30AM -0700, Paul E. McKenney wrote: > On Sun, May 29, 2011 at 09:19:48AM +0200, Ingo Molnar wrote: > > > > * Avi Kivity wrote: > > > > > Yes, this is equivalent to the kernel's stop_machine_run(). It's a > > >

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-29 Thread Paul E. McKenney
On Sun, May 29, 2011 at 09:33:27PM +0200, Ingo Molnar wrote: > > * Paul E. McKenney wrote: > > > On Sun, May 29, 2011 at 06:00:00PM +0300, Avi Kivity wrote: > > > On 05/29/2011 05:27 PM, Ingo Molnar wrote: > > > >* Avi Kivity wrote: > > > > >

Re: [PATCH 4/6] kvm tools: Add rwlock wrapper

2011-05-29 Thread Paul E. McKenney
On Sun, May 29, 2011 at 09:54:50PM +0200, Ingo Molnar wrote: > > * Paul E. McKenney wrote: > > > And the other reason that you want to mark the readers is for debug > > purposes. Murphy being who he is, you will some day need to check > > for someone calling the &q

Re: RCU red-black tree (was: Re: [PATCH 4/6] kvm tools: Add rwlock wrapper)

2011-05-29 Thread Paul E. McKenney
On Sun, May 29, 2011 at 01:01:04PM -0400, Mathieu Desnoyers wrote: > * Mathieu Desnoyers (mathieu.desnoy...@efficios.com) wrote: > > * Sasha Levin (levinsasha...@gmail.com) wrote: > [...] > > > Hi Mathieu! > > > > > > In tools/kvm/ we use a rb-tree (same one used by the kernel) with the > > > augm

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-03 Thread Paul E. McKenney
.37, I've looked into it to > > > find what might have caused this issue. > > > > > > I've bisected guest kernels and found that the problem starts with: > > > > > > a26ac2455ffcf3be5c6ef92bc6df7182700f2114 is the first bad commit > > &

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-03 Thread Paul E. McKenney
On Fri, Jun 03, 2011 at 10:56:20PM +0300, Sasha Levin wrote: > On Fri, 2011-06-03 at 12:31 -0700, Paul E. McKenney wrote: > > On Fri, Jun 03, 2011 at 10:54:19AM +0300, Sasha Levin wrote: > > > On Fri, 2011-06-03 at 09:34 +0200, Ingo Molnar wrote: > >

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-03 Thread Paul E. McKenney
On Sat, Jun 04, 2011 at 12:03:59AM +0300, Sasha Levin wrote: > On Fri, 2011-06-03 at 13:22 -0700, Paul E. McKenney wrote: > > On Fri, Jun 03, 2011 at 10:56:20PM +0300, Sasha Levin wrote: > > > On Fri, 2011-06-03 at 12:31 -0700, Paul E. McKenney wrote: > > > > On F

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-03 Thread Paul E. McKenney
On Sat, Jun 04, 2011 at 01:54:45AM +0300, Sasha Levin wrote: > On Fri, 2011-06-03 at 14:20 -0700, Paul E. McKenney wrote: > > On Sat, Jun 04, 2011 at 12:03:59AM +0300, Sasha Levin wrote: > > > On Fri, 2011-06-03 at 13:22 -0700, Paul E. McKenney wrote: > > > > On F

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-04 Thread Paul E. McKenney
On Sat, Jun 04, 2011 at 09:26:15AM +0300, Sasha Levin wrote: > On Fri, 2011-06-03 at 16:05 -0700, Paul E. McKenney wrote: > > On Sat, Jun 04, 2011 at 01:54:45AM +0300, Sasha Levin wrote: > > > On Fri, 2011-06-03 at 14:20 -0700, Paul E. McKenney wrote: > > > > On S

Re: [PATCH 10/15] KVM: MMU: lockless walking shadow page table

2011-06-09 Thread Paul E. McKenney
On Tue, Jun 07, 2011 at 09:04:34PM +0800, Xiao Guangrong wrote: > Using rcu to protect shadow pages table to be freed, so we can safely walk it, > it should run fast and is needed by mmio page fault A couple of question below. Thanx, Paul >

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-14 Thread Paul E. McKenney
massive scheduler lock contention, which might well be the cause of the problems that you are seeing. Thanx, Paul > On Sat, 2011-06-04 at 09:30 -0700, Paul E. McKenney wrote: > > On Sat, Jun 04, 2011 at 09:26:15AM +0300, Sasha Levi

Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper

2011-06-14 Thread Paul E. McKenney
On Tue, Jun 14, 2011 at 09:25:22PM -0400, Sasha Levin wrote: > On Tue, 2011-06-14 at 16:42 -0700, Paul E. McKenney wrote: > > On Tue, Jun 14, 2011 at 06:26:01PM -0400, Sasha Levin wrote: > > > Sorry for the delay on this. > > > > Actually, you might have ha

Re: [PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

2013-04-11 Thread Paul E. McKenney
On Mon, Mar 18, 2013 at 08:26:48AM +1100, Paul Mackerras wrote: > On Sat, Mar 16, 2013 at 12:50:49AM +0800, Lai Jiangshan wrote: > > At the point of up_out label in kvmppc_hv_setup_htab_rma(), > > srcu read lock is still held. > > > > We have to release it before return. > > > > Signed-off-by: La

[PATCH tip/core/rcu 2/2] powerpc,kvm: Fix unbalanced srcu_read_[un]lock()

2013-04-12 Thread Paul E. McKenney
Mackerras Cc: kvm@vger.kernel.org Cc: kvm-...@vger.kernel.org Signed-off-by: Paul E. McKenney --- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 80dcc53..c26740e 100644 --- a/arch/powerpc

Re: [PATCH] [RFC] s390/kvm: note a quiescing state if we interupt guest mode

2013-05-02 Thread Paul E. McKenney
gt; RCU working properly again. > > Long term we might want to use proper state tracking (just like > the dynticks folks) and mark guest state similar to user space > as an extended grace period, but this is not ready yet. > > Signed-off-by: Christian Borntraeger > Cc: Cornelia Huck

[PATCH tip/core/rcu 2/2] powerpc,kvm: fix imbalance srcu_read_[un]lock()

2013-05-20 Thread Paul E. McKenney
@vger.kernel.org Cc: kvm-...@vger.kernel.org Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 9de24f8..ec4c28a 100644 --- a

Re: compiler bug gcc4.6/4.7 with ACCESS_ONCE and workarounds

2014-11-10 Thread Paul E. McKenney
On Mon, Nov 10, 2014 at 01:07:33PM -0800, Linus Torvalds wrote: > On Mon, Nov 10, 2014 at 12:18 PM, Christian Borntraeger > wrote: > > > > Now: I can reproduces belows miscompile on gcc46 and gcc 47 > > gcc 45 seems ok, gcc 48 is fixed. This makes blacklisting > > a bit hard, especially since it

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-30 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 09:09:29PM +0200, Michael S. Tsirkin wrote: > I noticed that srcu_read_lock/unlock both have a memory barrier, > so just by moving srcu_read_unlock earlier we can get rid of > one call to smp_mb(). > > Unsurprisingly, the gain is small but measureable using the unit test >

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-30 Thread Paul E. McKenney
On Thu, Oct 31, 2013 at 01:26:05AM +0200, Michael S. Tsirkin wrote: > > > Paul, could you review this patch please? > > > Documentation/memory-barriers.txt says that unlock has a weaker > > > uni-directional barrier, but in practice srcu_read_unlock calls > > > smp_mb(). > > > > > > Is it OK to re

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-11-01 Thread Paul E. McKenney
On Thu, Oct 31, 2013 at 03:57:14PM +0200, Michael S. Tsirkin wrote: > On Wed, Oct 30, 2013 at 09:56:29PM -0700, Paul E. McKenney wrote: > > On Thu, Oct 31, 2013 at 01:26:05AM +0200, Michael S. Tsirkin wrote: > > > > > Paul, could you review this patch please? > &

Re: [PATCHv2] KVM: optimize apic interrupt delivery

2013-11-26 Thread Paul E. McKenney
On Tue, Nov 26, 2013 at 06:24:13PM +0200, Michael S. Tsirkin wrote: > On Wed, Sep 12, 2012 at 08:13:54AM -0700, Paul E. McKenney wrote: > > On Wed, Sep 12, 2012 at 03:44:26PM +0300, Gleb Natapov wrote: > > > On Wed, Sep 12, 2012 at 03:36:57PM +0300, Avi Kivity wrote: > > &g

Re: [PATCHv2] KVM: optimize apic interrupt delivery

2013-11-27 Thread Paul E. McKenney
On Wed, Nov 27, 2013 at 10:00:09AM +0200, Gleb Natapov wrote: > On Tue, Nov 26, 2013 at 11:35:06AM -0800, Paul E. McKenney wrote: > > On Tue, Nov 26, 2013 at 06:24:13PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Sep 12, 2012 at 08:13:54AM -0700, Paul E. McKenney wrote: >

Re: [PATCHv2] KVM: optimize apic interrupt delivery

2013-12-05 Thread Paul E. McKenney
On Thu, Nov 28, 2013 at 10:55:06AM +0200, Gleb Natapov wrote: > On Wed, Nov 27, 2013 at 09:06:36AM -0800, Paul E. McKenney wrote: > > On Wed, Nov 27, 2013 at 10:00:09AM +0200, Gleb Natapov wrote: > > > On Tue, Nov 26, 2013 at 11:35:06AM -0800, Paul E. McKenney wrote: > >

Re: [PATCHv2] KVM: optimize apic interrupt delivery

2012-09-11 Thread Paul E. McKenney
On Tue, Sep 11, 2012 at 05:10:23PM +0300, Michael S. Tsirkin wrote: > On Tue, Sep 11, 2012 at 04:02:25PM +0300, Gleb Natapov wrote: > > Most interrupt are delivered to only one vcpu. Use pre-build tables to > > find interrupt destination instead of looping through all vcpus. In case > > of logical

Re: [PATCHv2] KVM: optimize apic interrupt delivery

2012-09-11 Thread Paul E. McKenney
On Wed, Sep 12, 2012 at 01:33:37AM +0300, Michael S. Tsirkin wrote: > On Tue, Sep 11, 2012 at 10:13:00AM -0700, Paul E. McKenney wrote: > > On Tue, Sep 11, 2012 at 05:10:23PM +0300, Michael S. Tsirkin wrote: > > > On Tue, Sep 11, 2012 at 04:02:25PM +0300, Gleb Natapov wrote: >

Re: [PATCHv2] KVM: optimize apic interrupt delivery

2012-09-12 Thread Paul E. McKenney
On Wed, Sep 12, 2012 at 03:44:26PM +0300, Gleb Natapov wrote: > On Wed, Sep 12, 2012 at 03:36:57PM +0300, Avi Kivity wrote: > > On 09/12/2012 03:34 PM, Gleb Natapov wrote: > > > On Wed, Sep 12, 2012 at 10:45:22AM +0300, Avi Kivity wrote: > > >> On 09/12/2012 04

Re: [RFC v2 PATCH 04/21] x86: Avoid RCU warnings on slave CPUs

2012-09-20 Thread Paul E. McKenney
On Thu, Sep 06, 2012 at 08:27:40PM +0900, Tomoki Sekiyama wrote: > Initialize rcu related variables to avoid warnings about RCU usage while > slave CPUs is running specified functions. Also notify RCU subsystem before > the slave CPU is entered into idle state. Hello, Tomoki, A few questions and

Re: [PATCH] kvm, async_pf: exit idleness when handling KVM_PV_REASON_PAGE_NOT_PRESENT

2012-10-19 Thread Paul E. McKenney
_exclusive_wait+0xb0/0xb0 > [ 732.790032] [] ? prepare_to_wait+0x25/0x90 > [ 732.790032] [] do_async_page_fault+0x56/0xa0 > [ 732.790032] [] async_page_fault+0x28/0x30 > > Signed-off-by: Sasha Levin Acked-by: Paul E. McKenney > --- > arch/x86/kernel/kvm.c | 3 +++ > 1 file ch

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Paul E. McKenney
On Wed, Aug 12, 2009 at 04:25:40PM +0300, Michael S. Tsirkin wrote: > On Wed, Aug 12, 2009 at 09:01:35AM -0400, Gregory Haskins wrote: > > I think I understand what your comment above meant: You don't need to > > do synchronize_rcu() because you can flush the workqueue instead to > > ensure that a

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Paul E. McKenney
On Wed, Aug 12, 2009 at 05:15:59PM +0300, Michael S. Tsirkin wrote: > On Wed, Aug 12, 2009 at 07:11:07AM -0700, Paul E. McKenney wrote: > > On Wed, Aug 12, 2009 at 04:25:40PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Aug 12, 2009 at 09:01:35AM -0400, Gregory Haskins wrote:

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Paul E. McKenney
On Wed, Aug 12, 2009 at 06:51:54PM +0300, Michael S. Tsirkin wrote: > On Wed, Aug 12, 2009 at 08:26:39AM -0700, Paul E. McKenney wrote: > > On Wed, Aug 12, 2009 at 05:15:59PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Aug 12, 2009 at 07:11:07AM -0700, Paul E. McKenney wro

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Paul E. McKenney
On Mon, Aug 10, 2009 at 09:53:40PM +0300, Michael S. Tsirkin wrote: > What it is: vhost net is a character device that can be used to reduce > the number of system calls involved in virtio networking. > Existing virtio net code is used in the guest without modification. > > There's similarity with

Re: [PATCH v3 7/8] Move IO APIC to its own lock.

2009-08-13 Thread Paul E. McKenney
On Thu, Aug 13, 2009 at 01:44:06PM +0300, Avi Kivity wrote: > On 08/13/2009 01:09 PM, Gleb Natapov wrote: >>> There's also srcu. >>> >> What are the disadvantages? There should be some, otherwise why not use >> it all the time. > > I think it incurs an atomic op in the read path, but not much

Re: [RFC] KVM: x86: conditionally acquire/release slots_lock on entry/exit

2009-09-13 Thread Paul E. McKenney
On Sun, Sep 13, 2009 at 06:42:49PM +0300, Avi Kivity wrote: > On 09/11/2009 01:30 AM, Marcelo Tosatti wrote: >> >>> We don't need to stop vcpus, just kick them out of guest mode to let >>> them notice the new data. SRCU does that well. >>> >> Two problems: >> >> 1. The removal of memslots/al

Re: [patch 07/10] KVM: introduce kvm->srcu and convert kvm_set_memory_region to SRCU update

2009-09-24 Thread Paul E. McKenney
On Thu, Sep 24, 2009 at 11:06:51AM -0300, Marcelo Tosatti wrote: > On Mon, Sep 21, 2009 at 08:37:18PM -0300, Marcelo Tosatti wrote: > > Use two steps for memslot deletion: mark the slot invalid (which stops > > instantiation of new shadow pages for that slot, but allows destruction), > > then inst

Re: [PATCH] kvm: use the correct RCU API

2010-04-19 Thread Paul E. McKenney
On Mon, Apr 19, 2010 at 12:49:04PM +0300, Avi Kivity wrote: > On 04/19/2010 12:41 PM, Lai Jiangshan wrote: > >The RCU/SRCU API have already changed for proving RCU usage. > > > >I got the following dmesg when PROVE_RCU=y because we used incorrect API. > >This patch coverts rcu_deference() to srcu_d

Re: [PATCH] kvm: use the correct RCU API

2010-04-20 Thread Paul E. McKenney
On Tue, Apr 20, 2010 at 10:09:57AM +0800, Lai Jiangshan wrote: > Paul E. McKenney wrote: > > On Mon, Apr 19, 2010 at 12:49:04PM +0300, Avi Kivity wrote: > >> On 04/19/2010 12:41 PM, Lai Jiangshan wrote: > >>> The RCU/SRCU API have already changed for proving RC

Re: [PATCH] kvm: use the correct RCU API

2010-04-20 Thread Paul E. McKenney
On Mon, Apr 19, 2010 at 05:41:23PM +0800, Lai Jiangshan wrote: > The RCU/SRCU API have already changed for proving RCU usage. > > I got the following dmesg when PROVE_RCU=y because we used incorrect API. > This patch coverts rcu_deference() to srcu_dereference() or family API. > > ===

Re: [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held

2010-04-20 Thread Paul E. McKenney
On Tue, Apr 20, 2010 at 02:29:29PM +0800, Lai Jiangshan wrote: > Marcelo Tosatti wrote: > > On Mon, Apr 19, 2010 at 01:08:29PM +0300, Avi Kivity wrote: > >> On 04/19/2010 12:58 PM, Lai Jiangshan wrote: > >>> Applied the patch I just sent and let CONFIG_PROVE_RCU=y, > >>> we can got the following dm

Re: [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held

2010-04-21 Thread Paul E. McKenney
On Wed, Apr 21, 2010 at 11:17:22AM +0300, Avi Kivity wrote: > On 04/21/2010 01:21 AM, Paul E. McKenney wrote: > > > >>Subject: [PATCH] kvm: add missing srcu_read_lock() > >> > >>I got this dmesg due to srcu_read_lock() is mis

Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-06-01 Thread Paul E. McKenney
On Mon, May 31, 2010 at 06:22:21PM +0300, Michael S. Tsirkin wrote: > On Sun, May 30, 2010 at 10:24:01PM +0200, Tejun Heo wrote: > > Replace vhost_workqueue with per-vhost kthread. Other than callback > > argument change from struct work_struct * to struct vhost_poll *, > > there's no visible chan

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-08 Thread Paul E. McKenney
On Fri, May 08, 2009 at 08:43:40AM -0400, Gregory Haskins wrote: > Marcelo Tosatti wrote: > > On Fri, May 08, 2009 at 10:59:00AM +0300, Avi Kivity wrote: > > > >> Marcelo Tosatti wrote: > >> > >>> I think comparison is not entirely fair. You're using > >>> KVM_HC_VAPIC_POLL_IRQ ("null" hype

Re: [KVM PATCH v3 1/3] KVM: fix race in irq_routing logic

2009-10-26 Thread Paul E. McKenney
On Mon, Oct 26, 2009 at 12:21:57PM -0400, Gregory Haskins wrote: > The current code suffers from the following race condition: > > thread-1thread-2 > --- > > kvm_set_irq() { >rcu_read_lock() >irq_r

Re: [KVM PATCH v3 1/3] KVM: fix race in irq_routing logic

2009-10-27 Thread Paul E. McKenney
On Tue, Oct 27, 2009 at 04:02:37PM +0200, Gleb Natapov wrote: > On Tue, Oct 27, 2009 at 09:39:03AM -0400, Gregory Haskins wrote: [ . . . ] > > standard RCU RSCS, which is what SRCU is designed for. So rather than > > inventing an awkward two-phased stack based solution, it's better to > > reuse

Re: [KVM PATCH v3 1/3] KVM: fix race in irq_routing logic

2009-10-27 Thread Paul E. McKenney
On Tue, Oct 27, 2009 at 09:34:41AM -0400, Gregory Haskins wrote: > Hi Paul, > > Paul E. McKenney wrote: > > On Mon, Oct 26, 2009 at 12:21:57PM -0400, Gregory Haskins wrote: > >> The current code suffers from the following race condi

Re: [KVM PATCH v3 1/3] KVM: fix race in irq_routing logic

2009-10-27 Thread Paul E. McKenney
On Tue, Oct 27, 2009 at 11:02:23AM -0400, Gregory Haskins wrote: > Thanks for this, Paul. > > Some questions and statements below. > > Paul E. McKenney wrote: > > On Tue, Oct 27, 2009 at 04:02:37PM +0200, Gleb Natapov wrote: > >> On Tue, Oct 27, 2009 at 09:39:03A

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Paul E. McKenney
On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: > Gregory Haskins wrote: > > Eric Dumazet wrote: > >> Michael S. Tsirkin a écrit : > >>> +static void handle_tx(struct vhost_net *net) > >>> +{ > >>> + struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; > >>> + unsigned head

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Paul E. McKenney
On Wed, Nov 04, 2009 at 01:57:29PM +0200, Michael S. Tsirkin wrote: > On Tue, Nov 03, 2009 at 03:57:44PM -0800, Paul E. McKenney wrote: > > On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: > > > Gregory Haskins wrote: > > > > Eric Dumazet wrote: >

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-08 Thread Paul E. McKenney
On Sun, Nov 08, 2009 at 02:39:59PM +1030, Rusty Russell wrote: > On Sat, 7 Nov 2009 03:00:07 am Paul E. McKenney wrote: > > On Fri, Nov 06, 2009 at 03:31:20PM +1030, Rusty Russell wrote: > > > But it's still nasty to use half an API. If it were a few places I would > >

Re: qemu-kvm.git build problem

2010-01-11 Thread Paul E. McKenney
On Tue, Jan 12, 2010 at 01:23:15AM +0100, Jan Kiszka wrote: > Jan Kiszka wrote: > > Avi Kivity wrote: > >> On 01/11/2010 12:13 PM, Jan Kiszka wrote: > >>> BTW, does anybody know how to back-port synchronize_srcu_expedited best? > >>> It looked like a simple mapping to synchronize_srcu was not suffi

Re: qemu-kvm.git build problem

2010-01-12 Thread Paul E. McKenney
On Tue, Jan 12, 2010 at 09:28:15AM +0100, Jan Kiszka wrote: > Paul E. McKenney wrote: > > On Tue, Jan 12, 2010 at 01:23:15AM +0100, Jan Kiszka wrote: > >> Jan Kiszka wrote: > >>> Avi Kivity wrote: > >>>> On 01/11/2010 12:13 PM, Jan Kiszka wrote: &g

  1   2   >