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 missing in kvm_mmu_notifier_release

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 RCU usage. I got the following dmesg when

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 dmesg. And we

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

Re: qemu-kvm.git build problem

2010-01-17 Thread Paul E. McKenney
On Fri, Jan 15, 2010 at 09:58:40AM +0100, Jan Kiszka wrote: Paul E. McKenney wrote: On Thu, Jan 14, 2010 at 01:11:33AM +0100, Jan Kiszka wrote: Paul E. McKenney wrote: On Tue, Jan 12, 2010 at 09:28:15AM +0100, Jan Kiszka wrote: If so, I will try to write something like this the next days

Re: qemu-kvm.git build problem

2010-01-14 Thread Paul E. McKenney
On Thu, Jan 14, 2010 at 01:11:33AM +0100, Jan Kiszka wrote: Paul E. McKenney wrote: On Tue, Jan 12, 2010 at 09:28:15AM +0100, Jan Kiszka wrote: If so, I will try to write something like this the next days. Will surely appreciate your review afterwards! Sounds good! Here we go

Re: qemu-kvm.git build problem

2010-01-13 Thread Paul E. McKenney
On Thu, Jan 14, 2010 at 01:11:33AM +0100, Jan Kiszka wrote: Paul E. McKenney wrote: On Tue, Jan 12, 2010 at 09:28:15AM +0100, Jan Kiszka wrote: If so, I will try to write something like this the next days. Will surely appreciate your review afterwards! Sounds good! Here we go

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: BTW, does anybody know how to back-port

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 sufficient to

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 have open-coded it with a comment

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: Michael S. Tsirkin a écrit : +static

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, out, in, s; +

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 the

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 condition: thread-1thread-2

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:03AM -0400, Gregory Haskins wrote

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_rt =

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

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/aliases and zapping

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 overhead

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 all

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: I think I understand

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 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: Yeah I understand that other

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 jiffies

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 array

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 of pointers with rcu. (Note

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(); Suggest changing to rcu_read_lock() to match

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 born. ;)

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, 2009 at 11:15:38AM -0400, Gregory Haskins wrote: Assigning an irqfd

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: [KVM-RFC PATCH 2/2] kvm: use POLLHUP to close an irqfd instead of an explicit ioctl

2009-06-02 Thread Paul E. McKenney
interspersed below. Thanx, Paul Signed-off-by: Gregory Haskins ghask...@novell.com CC: Davide Libenzi davi...@xmailserver.org CC: Michael S. Tsirkin m...@redhat.com CC: Paul E. McKenney paul...@linux.vnet.ibm.com --- include/linux

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 hypercall) and the

<    1   2