Re: [PATCH v2] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Christian Borntraeger
On 04/06/12 03:57, Rusty Russell wrote: Unfortunately, this conflicts with Asias He's deadlock fix, which has us just using the block-layer-supplied spinlock. If we drop the lock around the kick as you suggest, we're playing with fire. All the virtio backends have an atomic notify, so

Re: [Qemu-devel] [PATCH v3 00/16] net: hub-based networking

2012-06-04 Thread Markus Armbruster
Anthony Liguori anth...@codemonkey.ws writes: On 05/29/2012 04:14 PM, Markus Armbruster wrote: Luiz Capitulinolcapitul...@redhat.com writes: On Mon, 28 May 2012 12:17:04 +0100 Stefan Hajnoczistefa...@linux.vnet.ibm.com wrote: What we need to decide is whether it's okay to drop QEMU VLANs

Re: [PATCH] Documentation/kvm : Add documentation on Hypercalls

2012-06-04 Thread Raghavendra K T
On 06/04/2012 09:30 AM, Rob Landley wrote: On 05/31/2012 12:46 PM, H. Peter Anvin wrote: On 05/31/2012 01:01 AM, Raghavendra K T wrote: + +TODO: +1. more information on input and output needed? +2. Add more detail to purpose of hypercalls. 1. definitely, including the hypercall ABI.

Re: [PATCH v2] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Stefan Hajnoczi
On Mon, Jun 04, 2012 at 11:27:39AM +0930, Rusty Russell wrote: On Wed, 30 May 2012 15:39:05 +0200, Christian Borntraeger borntrae...@de.ibm.com wrote: On 30/05/12 15:19, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Asias He
On 06/01/2012 05:13 PM, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and another CPU touches the vblk-lock it will have to spin until virtqueue kick completes. This patch reduces system% CPU utilization in

Re: [PATCH v2] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Asias He
On 06/04/2012 09:57 AM, Rusty Russell wrote: On Wed, 30 May 2012 15:39:05 +0200, Christian Borntraegerborntrae...@de.ibm.com wrote: On 30/05/12 15:19, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and

Re: [PATCH] Documentation/kvm : Add documentation on Hypercalls

2012-06-04 Thread Raghavendra K T
On 05/31/2012 11:14 PM, Randy Dunlap wrote: On 05/31/2012 01:01 AM, Raghavendra K T wrote: From: Raghavendra K Traghavendra...@linux.vnet.ibm.com Thanks Alex for KVM_HC_FEATURES inputs and Jan for VAPIC_POLL_IRQ Signed-off-by: Raghavendra K Traghavendra...@linux.vnet.ibm.com --- diff --git

Re: KVM entry failed, hardware error

2012-06-04 Thread Gleb Natapov
On Sun, Jun 03, 2012 at 06:25:33PM +0200, Johannes Bauer wrote: Therefore, I've uploaded the compressed trace.dat file, so you can maybe have a look why the report tool barfs and interpret it correctly. I can't figure it out. The trace is here: http://spornkuller.de/trace.dat.bz2 I can

Re: [PATCH v2] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Asias He
On 06/04/2012 09:57 AM, Rusty Russell wrote: On Wed, 30 May 2012 15:39:05 +0200, Christian Borntraegerborntrae...@de.ibm.com wrote: On 30/05/12 15:19, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and

Re: KVM entry failed, hardware error

2012-06-04 Thread Avi Kivity
On 06/04/2012 11:53 AM, Gleb Natapov wrote: On Sun, Jun 03, 2012 at 06:25:33PM +0200, Johannes Bauer wrote: Therefore, I've uploaded the compressed trace.dat file, so you can maybe have a look why the report tool barfs and interpret it correctly. I can't figure it out. The trace is here:

[PATCH v2 02/41] arch_init: export RAM_SAVE_xxx flags for postcopy

2012-06-04 Thread Isaku Yamahata
Those constants will be also used by postcopy. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c |7 --- arch_init.h |7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch_init.c b/arch_init.c index 38e0173..bd4e61e 100644 --- a/arch_init.c

[PATCH v2 01/41] arch_init: export sort_ram_list() and ram_save_block()

2012-06-04 Thread Isaku Yamahata
This will be used by postcopy. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c |4 ++-- migration.h |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index a9e8b74..38e0173 100644 --- a/arch_init.c +++ b/arch_init.c @@

[PATCH v2 12/41] arch_init: factor out setting last_block, last_offset

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 13 - arch_init.h |1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arch_init.c b/arch_init.c index 2617478..22d9691 100644 --- a/arch_init.c +++ b/arch_init.c @@ -203,6 +203,12 @@ int

[PATCH v2 18/41] QEMUFile: add qemu_file_fd() for later use

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- qemu-file.h |1 + savevm.c| 12 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/qemu-file.h b/qemu-file.h index 331ac8b..98a8023 100644 --- a/qemu-file.h +++ b/qemu-file.h @@ -71,6 +71,7 @@ QEMUFile

[PATCH v2 21/41] savevm: rename QEMUFileSocket to QEMUFileFD, socket_close to fd_close

2012-06-04 Thread Isaku Yamahata
Later the structure will be shared. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- savevm.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/savevm.c b/savevm.c index 4b560b3..2fb0c3e 100644 --- a/savevm.c +++ b/savevm.c @@ -187,14 +187,14 @@

[PATCH v2 22/41] savevm/QEMUFile: introduce qemu_fopen_fd

2012-06-04 Thread Isaku Yamahata
Introduce nonblocking fd read backend of QEMUFile. This will be used by postcopy live migration. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- qemu-file.h |1 + savevm.c| 40 2 files changed, 41 insertions(+), 0 deletions(-) diff

[PATCH v2 17/41] savevm, buffered_file: introduce method to drain buffer of buffered file

2012-06-04 Thread Isaku Yamahata
Introduce a new method to drain the buffer of QEMUBufferedFile. When postcopy migration, buffer size can increase unboundedly. To keep the buffer size reasonably small, introduce the method to wait for buffer to drain. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- buffered_file.c |

[PATCH v2 20/41] savevm/QEMUFileSocket: drop duplicated member fd

2012-06-04 Thread Isaku Yamahata
fd is already stored in QEMUFile so drop duplicated member QEMUFileSocket::fd. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- savevm.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/savevm.c b/savevm.c index ec9f5d0..4b560b3 100644 --- a/savevm.c +++

[PATCH v2 24/41] migration: export migrate_fd_completed() and migrate_fd_cleanup()

2012-06-04 Thread Isaku Yamahata
This will be used by postcopy migration. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- migration.c |4 ++-- migration.h |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 753addb..48a8f68 100644 --- a/migration.c +++

[PATCH v2 15/41] savevm: export qemu_peek_buffer, qemu_peek_byte, qemu_file_skip

2012-06-04 Thread Isaku Yamahata
Those will be used by postcopy. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- qemu-file.h |3 +++ savevm.c|6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu-file.h b/qemu-file.h index 31b83f6..a285bef 100644 --- a/qemu-file.h +++ b/qemu-file.h

[PATCH v2 33/41] postcopy: introduce -postcopy and -postcopy-flags option

2012-06-04 Thread Isaku Yamahata
This patch prepares for postcopy livemigration. It introduces -postcopy option and its internal flag, migration_postcopy. It introduces -postcopy-flags for chaging the behavior of incoming postcopy mainly for benchmark/debug. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- migration.h

[PATCH v2 35/41] postcopy: introduce helper functions for postcopy

2012-06-04 Thread Isaku Yamahata
This patch introduces helper function for postcopy to access umem char device and to communicate between incoming-qemu and umemd. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- changes v1 - v2: - code simplification - make fault trigger more robust - introduce struct umem_pages ---

[PATCH v2 40/41] migrate: add -m (movebg) option to migrate command

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- hmp-commands.hx |5 +++-- hmp.c|3 ++- migration.c |8 +++- migration.h |1 + qapi-schema.json |2 +- qmp-commands.hx |2 +- savevm.c |1 + 7 files changed, 16 insertions(+), 6

[PATCH v2 37/41] postcopy: implement outgoing part of postcopy live migration

2012-06-04 Thread Isaku Yamahata
This patch implements postcopy live migration for outgoing part Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- Changes v1 - v2: - fix parameter to qemu_fdopen() - handle QEMU_UMEM_REQ_EOC properly when PO_STATE_ALL_PAGES_SENT, QEMU_UMEM_REQ_EOC request was ignored. handle properly

[PATCH v2 38/41] postcopy/outgoing: add forward, backward option to specify the size of prefault

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- hmp-commands.hx | 15 ++- hmp.c|3 +++ migration.c | 20 migration.h |2 ++ qapi-schema.json |3 ++- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git

[PATCH v2 32/41] savevm: add new section that is used by postcopy

2012-06-04 Thread Isaku Yamahata
This is used by postcopy to tell the total length of QEMU_VM_SECTION_FULL and QEMU_VM_SUBSECTION from outgoing to incoming. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- savevm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/savevm.c b/savevm.c index

[PATCH v2 39/41] postcopy/outgoing: implement prefault

2012-06-04 Thread Isaku Yamahata
When page is requested, send surrounding pages are also sent. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- migration-postcopy.c | 56 + 1 files changed, 51 insertions(+), 5 deletions(-) diff --git a/migration-postcopy.c

[PATCH v2 34/41] postcopy outgoing: add -p and -n option to migrate command

2012-06-04 Thread Isaku Yamahata
Added -p option to migrate command for postcopy mode and introduce postcopy parameter for migration to indicate that postcopy mode is enabled. Add -n option for postcopy migration which indicates disabling background transfer. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- Chnages v1 -

[PATCH v2 41/41] migration/postcopy: add movebg mode

2012-06-04 Thread Isaku Yamahata
When movebg mode is enabled, the point to send background page is set to the next page to on-demand page. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- migration-postcopy.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/migration-postcopy.c

[PATCH v2 36/41] postcopy: implement incoming part of postcopy live migration

2012-06-04 Thread Isaku Yamahata
This patch implements postcopy live migration for incoming part Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- Changes v3 - v4: - fork umemd early to address qemu devices touching guest ram via post/pre_load - code clean up on initialization - Makefile.target migration-postcopy.c is

[PATCH v2 10/41] arch_init: simplify a bit by ram_find_block()

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 21 - exec.c | 12 ++-- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/arch_init.c b/arch_init.c index 9981abe..73bf250 100644 --- a/arch_init.c +++ b/arch_init.c @@

[PATCH v3 1/2] export necessary symbols

2012-06-04 Thread Isaku Yamahata
Cc: Andrea Arcangeli aarca...@redhat.com Cc: Avi Kivity a...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- mm/memcontrol.c |1 + mm/mempolicy.c |1 + mm/shmem.c |1 + 3 files changed, 3 insertions(+), 0 deletions(-)

[PATCH v3 0/2] postcopy migration: umem: Linux char device for postcopy

2012-06-04 Thread Isaku Yamahata
This is Linux kernel driver for qemu/kvm postcopy live migration. This is used by qemu/kvm postcopy live migration patch. TODO: - Consider FUSE/CUSE option So far several mmap patches for FUSE/CUSE are floating around. (their purpose isn't different from our purpose, though). They haven't

[PATCH v3 2/2] umem: chardevice for kvm postcopy

2012-06-04 Thread Isaku Yamahata
This is a character device to hook page access. The page fault in the area is propagated to another user process by this chardriver. Then, the process fills the page contents and resolves the page fault. Cc: Andrea Arcangeli aarca...@redhat.com Cc: Avi Kivity a...@redhat.com Cc: Paolo Bonzini

[PATCH v2 28/41] buffered_file: add qemu_file to read/write to buffer in memory

2012-06-04 Thread Isaku Yamahata
This is used by postcopy live migration. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- buffered_file.c | 50 ++ buffered_file.h | 10 ++ 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/buffered_file.c

[PATCH v2 29/41] umem.h: import Linux umem.h

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- linux-headers/linux/umem.h | 42 ++ 1 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 linux-headers/linux/umem.h diff --git a/linux-headers/linux/umem.h

[PATCH v2 31/41] configure: add CONFIG_POSTCOPY option

2012-06-04 Thread Isaku Yamahata
Add enable/disable postcopy mode. No dynamic test yet. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- configure | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 1f338f8..21de4cb 100755 --- a/configure +++ b/configure @@

[PATCH v2 25/41] migration: factor out parameters into MigrationParams

2012-06-04 Thread Isaku Yamahata
Introduce MigrationParams for parameters of migration. Cc: Orit Wasserman owass...@redhat.com Cc: Juan Quintela quint...@redhat.com Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- Changes v1 - v2: - catch up qapi change --- block-migration.c |8 migration.c | 21

[PATCH v2 23/41] migration.c: remove redundant line in migrate_init()

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- migration.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/migration.c b/migration.c index 3f485d3..753addb 100644 --- a/migration.c +++ b/migration.c @@ -367,7 +367,6 @@ static MigrationState *migrate_init(int

[PATCH v2 27/41] buffered_file: Introduce QEMUFileNonblock for nonblock write

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- buffered_file.c | 115 +++ buffered_file.h | 13 ++ 2 files changed, 128 insertions(+), 0 deletions(-) diff --git a/buffered_file.c b/buffered_file.c index 22dd4c9..5198923 100644

[PATCH v2 19/41] savevm/QEMUFile: drop qemu_stdio_fd

2012-06-04 Thread Isaku Yamahata
Now qemu_file_fd() replaces qemu_stdio_fd(). Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- migration-exec.c |4 ++-- migration-fd.c |2 +- qemu-file.h |1 - savevm.c | 12 4 files changed, 3 insertions(+), 16 deletions(-) diff --git

[PATCH v2 30/41] update-linux-headers.sh: teach umem.h to update-linux-headers.sh

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- scripts/update-linux-headers.sh |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 9d2a4bc..2afdd54 100755 --- a/scripts/update-linux-headers.sh

[PATCH v2 26/41] buffered_file: factor out buffer management logic

2012-06-04 Thread Isaku Yamahata
This patch factors out buffer management logic. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- buffered_file.c | 141 +- buffered_file.h |8 +++ 2 files changed, 94 insertions(+), 55 deletions(-) diff --git a/buffered_file.c

[PATCH v2 14/41] exec.c: export last_ram_offset()

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- exec-obsolete.h |1 + exec.c |4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exec-obsolete.h b/exec-obsolete.h index 792c831..fb21dd7 100644 --- a/exec-obsolete.h +++ b/exec-obsolete.h @@ -25,6 +25,7

[PATCH v2 08/41] arch_init/ram_load: refactor ram_load

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 67 +- arch_init.h |1 + 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/arch_init.c b/arch_init.c index c861e30..bb0cd52 100644 --- a/arch_init.c

[PATCH v2 04/41] arch_init: refactor host_from_stream_offset()

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 25 ++--- arch_init.h |7 +++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/arch_init.c b/arch_init.c index 2a53f58..36ece1d 100644 --- a/arch_init.c +++ b/arch_init.c @@ -374,21

[PATCH v2 13/41] exec.c: factor out qemu_get_ram_ptr()

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- cpu-all.h |2 ++ exec.c| 51 +-- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 028528f..ff7f827 100644 --- a/cpu-all.h +++ b/cpu-all.h

[PATCH v2 11/41] arch_init: factor out counting transferred bytes

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 24 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch_init.c b/arch_init.c index 73bf250..2617478 100644 --- a/arch_init.c +++ b/arch_init.c @@ -155,8 +155,9 @@ static int

[PATCH v2 16/41] savevm: qemu_pending_size() to return pending buffered size

2012-06-04 Thread Isaku Yamahata
This will be used later by postcopy migration. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- qemu-file.h |1 + savevm.c|5 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qemu-file.h b/qemu-file.h index a285bef..880ef4b 100644 --- a/qemu-file.h +++

[PATCH v2 05/41] arch_init/ram_save_live: factor out RAM_SAVE_FLAG_MEM_SIZE case

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 21 ++--- migration.h |1 + 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/arch_init.c b/arch_init.c index 36ece1d..28e5abb 100644 --- a/arch_init.c +++ b/arch_init.c @@ -287,6 +287,19 @@

[PATCH v2 07/41] arch_init/ram_save_live: factor out ram_save_limit

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 28 migration.h |1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/arch_init.c b/arch_init.c index 900cc8e..c861e30 100644 --- a/arch_init.c +++ b/arch_init.c @@ -311,9

[PATCH v2 09/41] arch_init: introduce helper function to find ram block with id string

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c | 13 + arch_init.h |1 + 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/arch_init.c b/arch_init.c index bb0cd52..9981abe 100644 --- a/arch_init.c +++ b/arch_init.c @@ -397,6 +397,19 @@ int

[PATCH v2 03/41] arch_init/ram_save: introduce constant for ram save version = 4

2012-06-04 Thread Isaku Yamahata
Introduce RAM_SAVE_VERSION_ID to represent version_id for ram save format. Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- arch_init.c |2 +- arch_init.h |2 ++ vl.c|4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c

[PATCH v2 00/41] postcopy live migration

2012-06-04 Thread Isaku Yamahata
After the long time, we have v2. This is qemu part. The linux kernel part is sent separatedly. Changes v1 - v2: - split up patches for review - buffered file refactored - many bug fixes Espcially PV drivers can work with postcopy - optimization/heuristic Patches 1 - 30: refactoring exsiting

[PATCH v2 06/41] arch_init: refactor ram_save_block()

2012-06-04 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- Chnages v1 - v2: - don't refer last_block which can be NULL. And avoid possible infinite loop. --- arch_init.c | 82 +- arch_init.h |1 + 2 files changed, 48 insertions(+), 35

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Michael S. Tsirkin
On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: Holding the vblk-lock across kick causes poor scalability in SMP guests. If one CPU is doing virtqueue kick and another CPU touches the vblk-lock it will have to spin until virtqueue kick completes. This patch reduces system%

Re: [PATCH v3] virtio_blk: unlock vblk-lock during kick

2012-06-04 Thread Michael S. Tsirkin
On Fri, Jun 01, 2012 at 10:13:06AM +0100, Stefan Hajnoczi wrote: Other block drivers (cciss, rbd, nbd) use spin_unlock_irq() so I followed that. To me this seems wrong: blk_run_queue() uses spin_lock_irqsave() but we enable irqs with spin_unlock_irq(). If the caller of blk_run_queue() had

Re: [PATCH] KVM: Use IRQF_ONESHOT for assigned device MSI interrupts

2012-06-04 Thread Thomas Gleixner
On Sun, 3 Jun 2012, Avi Kivity wrote: On 06/01/2012 09:26 PM, Jan Kiszka wrote: you suggesting we need a request_edge_threaded_only_irq() API? Thanks, I'm just wondering if that restriction for threaded IRQs is really necessary for all use cases we have. Threaded MSIs do not appear

Re: [PATCH] KVM: Use IRQF_ONESHOT for assigned device MSI interrupts

2012-06-04 Thread Jan Kiszka
On 2012-06-04 13:21, Thomas Gleixner wrote: On Sun, 3 Jun 2012, Avi Kivity wrote: On 06/01/2012 09:26 PM, Jan Kiszka wrote: you suggesting we need a request_edge_threaded_only_irq() API? Thanks, I'm just wondering if that restriction for threaded IRQs is really necessary for all use

kvm segfaults and bad page state in 3.4.0

2012-06-04 Thread Fengguang Wu
Hi, I'm running lots of kvm instances for doing kernel boot tests. Unfortunately the test system itself is not stable enough, I got scary errors in both kvm and the host kernel. Like this. [294025.795382] kvm used greatest stack depth: 2896 bytes left [310388.622083] kvm[1864]: segfault at c ip

[PATCH] KVM: do not iterate over all VMs in mmu_shrink()

2012-06-04 Thread Gleb Natapov
mmu_shrink() needlessly iterates over all VMs even though it will not attempt to free mmu pages from more than one on them. Fix that and also check used mmu pages count outside of VM lock to skip inactive VMs faster. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/kvm/mmu.c

Re: kvm segfaults and bad page state in 3.4.0

2012-06-04 Thread Gleb Natapov
On Mon, Jun 04, 2012 at 07:46:03PM +0800, Fengguang Wu wrote: Hi, I'm running lots of kvm instances for doing kernel boot tests. Unfortunately the test system itself is not stable enough, I got scary errors in both kvm and the host kernel. Like this. What do you mean by in both kvm and

Re: [PATCH v2 00/41] postcopy live migration

2012-06-04 Thread Anthony Liguori
On 06/04/2012 05:57 PM, Isaku Yamahata wrote: After the long time, we have v2. This is qemu part. The linux kernel part is sent separatedly. Changes v1 - v2: - split up patches for review - buffered file refactored - many bug fixes Espcially PV drivers can work with postcopy -

Re: [PATCH] KVM: Use IRQF_ONESHOT for assigned device MSI interrupts

2012-06-04 Thread Thomas Gleixner
On Mon, 4 Jun 2012, Jan Kiszka wrote: On 2012-06-04 13:21, Thomas Gleixner wrote: So this shortcut requires some checks before being applied to a specific MSI/MSI-X vector. Taking KVM aside, my general question remains if threaded MSI handlers of all devices really need to apply

Re: [Qemu-devel] [PATCH v3 00/16] net: hub-based networking

2012-06-04 Thread Luiz Capitulino
On Mon, 04 Jun 2012 12:56:41 +0800 Anthony Liguori anth...@codemonkey.ws wrote: On 05/25/2012 08:53 PM, Luiz Capitulino wrote: On Fri, 25 May 2012 13:01:37 +0100 Stefan Hajnoczistefa...@gmail.com wrote: I agree it would be nice to drop entirely but I don't feel happy doing that to

Re: Fwd: [Qemu-devel] [PATCH v2 00/41] postcopy live migration

2012-06-04 Thread Isaku Yamahata
On Mon, Jun 04, 2012 at 05:01:30AM -0700, Chegu Vinod wrote: Hello Isaku Yamahata, Hi. I just saw your patches..Would it be possible to email me a tar bundle of these patches (makes it easier to apply the patches to a copy of the upstream qemu.git) I uploaded them to github for those who

Re: [PATCH] KVM: Use IRQF_ONESHOT for assigned device MSI interrupts

2012-06-04 Thread Jan Kiszka
On 2012-06-04 15:07, Thomas Gleixner wrote: On Mon, 4 Jun 2012, Jan Kiszka wrote: On 2012-06-04 13:21, Thomas Gleixner wrote: So this shortcut requires some checks before being applied to a specific MSI/MSI-X vector. Taking KVM aside, my general question remains if threaded MSI handlers of

Re: [PATCH] KVM: Use IRQF_ONESHOT for assigned device MSI interrupts

2012-06-04 Thread Thomas Gleixner
On Mon, 4 Jun 2012, Jan Kiszka wrote: On 2012-06-04 15:07, Thomas Gleixner wrote: On Mon, 4 Jun 2012, Jan Kiszka wrote: On 2012-06-04 13:21, Thomas Gleixner wrote: So this shortcut requires some checks before being applied to a specific MSI/MSI-X vector. Taking KVM aside, my

Executing script in VM, from KVM

2012-06-04 Thread Michael Johns
Hi list, I have recently started using KVM, and I'm looking to see how I might be able to use and adapt KVM for my own purposes, to do things more easily on some of the virtual machines I use. To this end, I was wondering if it is possible to execute a script or run a command or a process within

Re: [PATCH v2 00/41] postcopy live migration

2012-06-04 Thread Isaku Yamahata
On Mon, Jun 04, 2012 at 08:37:04PM +0800, Anthony Liguori wrote: On 06/04/2012 05:57 PM, Isaku Yamahata wrote: After the long time, we have v2. This is qemu part. The linux kernel part is sent separatedly. Changes v1 - v2: - split up patches for review - buffered file refactored - many

[PULL] qemu-kvm: merge with latest upstream

2012-06-04 Thread Jan Kiszka
The following changes since commit 75b4a94628c5035b5c350eff4a4edf923b5dc33a: pci-assign: Drop kvm_assigned_irq::host_irq initialization (2012-06-01 20:51:10 -0300) are available in the git repository at: git://git.kiszka.org/qemu-kvm.git queues/qemu-merge This is the back-merge of post-1.1

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-04 Thread Kevin Wolf
Am 01.06.2012 10:31, schrieb Kevin Wolf: Am 01.06.2012 09:57, schrieb Ren, Yongjie: -Original Message- From: Marcelo Tosatti [mailto:mtosa...@redhat.com] Sent: Thursday, May 31, 2012 4:28 AM To: Ren, Yongjie Cc: Kevin Wolf; Avi Kivity; kvm@vger.kernel.org; Liu, RongrongX Subject:

Re: Fwd: [Qemu-devel] [PATCH v2 00/41] postcopy live migration

2012-06-04 Thread Chegu Vinod
On 6/4/2012 6:13 AM, Isaku Yamahata wrote: On Mon, Jun 04, 2012 at 05:01:30AM -0700, Chegu Vinod wrote: Hello Isaku Yamahata, Hi. I just saw your patches..Would it be possible to email me a tar bundle of these patches (makes it easier to apply the patches to a copy of the upstream qemu.git)

[Bug 43339] New: Wrong Pci-Bridge Header Type check.

2012-06-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=43339 Summary: Wrong Pci-Bridge Header Type check. Product: Virtualization Version: unspecified Kernel Version: 3.4 Platform: All OS/Version: Linux Tree: Mainline Status:

[PATCH 1/2] kvm tools: Increase AIO_MAX to 256

2012-06-04 Thread Asias He
The queue size for virtio_blk is 256 and AIO_MAX is 32, we might be short of available aio events if guest issues 32 requests simultaneously. Following error is observed when guest running stressed I/O workload. Info: disk_image__read error: total=-11 To fix this, let's increase the aio

[PATCH 2/2] kvm tools: Restart io_submit if it returns EAGAIN

2012-06-04 Thread Asias He
Keep trying if io_submit returns EAGAIN. No need to fail the request. Signed-off-by: Asias He asias.he...@gmail.com --- tools/kvm/util/read-write.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/kvm/util/read-write.c b/tools/kvm/util/read-write.c

Re: Fwd: [Qemu-devel] [PATCH v2 00/41] postcopy live migration

2012-06-04 Thread Isaku Yamahata
On Mon, Jun 04, 2012 at 07:27:25AM -0700, Chegu Vinod wrote: On 6/4/2012 6:13 AM, Isaku Yamahata wrote: On Mon, Jun 04, 2012 at 05:01:30AM -0700, Chegu Vinod wrote: Hello Isaku Yamahata, Hi. I just saw your patches..Would it be possible to email me a tar bundle of these patches (makes it

[PATCH] kvm tools: Simplfy disk read write function name

2012-06-04 Thread Asias He
We read and write in sectors by default. It makes little sense to add the extra _sector string for read and write ops/function name. Signed-off-by: Asias He asias.he...@gmail.com --- tools/kvm/disk/blk.c |4 ++-- tools/kvm/disk/core.c |8

[PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Asias He
All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete and all devices share the single ioeventfd thead, so this might block other device's notify_vq() being called and starve

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Cyrill Gorcunov
On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote: +static void *virtio_blk_thread(void *dev) +{ + struct blk_dev *bdev = dev; + u64 data; + + while (1) { + read(bdev-io_efd, data, sizeof(u64)); + virtio_blk_do_io(bdev-kvm, bdev-vqs[0], bdev);

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Sasha Levin
On Mon, 2012-06-04 at 23:40 +0800, Asias He wrote: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to complete and all devices share the single ioeventfd thead, so this might

Re: kvm segfaults and bad page state in 3.4.0

2012-06-04 Thread Fengguang Wu
On Mon, Jun 04, 2012 at 08:35:30PM +0800, Fengguang Wu wrote: Hi Gleb, On Mon, Jun 04, 2012 at 02:56:50PM +0300, Gleb Natapov wrote: On Mon, Jun 04, 2012 at 07:46:03PM +0800, Fengguang Wu wrote: Hi, I'm running lots of kvm instances for doing kernel boot tests. Unfortunately the

Re: KVM entry failed, hardware error

2012-06-04 Thread Johannes Bauer
On 04.06.2012 10:53, Gleb Natapov wrote: On Sun, Jun 03, 2012 at 06:25:33PM +0200, Johannes Bauer wrote: Therefore, I've uploaded the compressed trace.dat file, so you can maybe have a look why the report tool barfs and interpret it correctly. I can't figure it out. The trace is here:

Re: KVM entry failed, hardware error

2012-06-04 Thread Johannes Bauer
On 04.06.2012 20:28, Johannes Bauer wrote: What is your command line? bin/qemu-system-x86_64 -cpu host -enable-kvm -net nic -net user,smb=Share,restrict=on -drive media=disk,file=Windows7_x32.qcow2,if=virtio -m 2048 -smp 1 -nographic Just noticed that the output I just provided was for the

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Asias He
On Mon, Jun 4, 2012 at 11:48 PM, Cyrill Gorcunov gorcu...@openvz.org wrote: On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote: +static void *virtio_blk_thread(void *dev) +{ +     struct blk_dev *bdev = dev; +     u64 data; + +     while (1) { +             read(bdev-io_efd, data,

Re: [Qemu-devel] [PULL 00/20 1.2] kvm updates

2012-06-04 Thread Andreas Färber
Am 04.06.2012 07:46, schrieb Anthony Liguori: On 05/22/2012 12:37 AM, Avi Kivity wrote: Please pull from: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master Pulled. Thanks. This broke the ppc build. Guys, why wasn't this tested? There's only three KVM targets to test compared

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Asias He
On Tue, Jun 5, 2012 at 12:07 AM, Sasha Levin levinsasha...@gmail.com wrote: On Mon, 2012-06-04 at 23:40 +0800, Asias He wrote: All blk requests are processed in notify_vq() which is in the context of ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may take a long time to

[PATCH 26/74] target-i386: Pass X86CPU to do_cpu_{init,sipi}()

2012-06-04 Thread Andreas Färber
Allows to use cpu_reset() in place of cpu_state_reset(). Signed-off-by: Andreas Färber afaer...@suse.de Reviewed-by: Igor Mammedov imamm...@redhat.com --- cpu-exec.c |4 ++-- target-i386/cpu.h|4 ++-- target-i386/helper.c | 13 - target-i386/kvm.c|6

Re: [RFC PATCH] PCI: Introduce INTx check mask API

2012-06-04 Thread Benjamin Herrenschmidt
On Thu, 2012-05-24 at 09:02 -0300, Jan Kiszka wrote: Since PCI 2.3, this bit is mandatory, and it should be independent of the masking bit. The question is, if your device is supposed to support 2.3, thus is just buggy, It's a PCI Express device :-) or if our detection algorithm is

Re: [RFC PATCH] PCI: Introduce INTx check mask API

2012-06-04 Thread Benjamin Herrenschmidt
Yep, that's what I'd suggest as well, add a blacklist to pci_intx_mask_supported() so this device returns false and we require an exclusive interrupt for it. Thanks, BTW, we should consider supporting an MSI-only option for guests as well: LSIs are a problem for virtualization, especially

Re: [RFC PATCH] PCI: Introduce INTx check mask API

2012-06-04 Thread Alexander Graf
On 05.06.2012, at 03:39, Benjamin Herrenschmidt wrote: Yep, that's what I'd suggest as well, add a blacklist to pci_intx_mask_supported() so this device returns false and we require an exclusive interrupt for it. Thanks, BTW, we should consider supporting an MSI-only option for guests

Re: [Qemu-devel] [PULL 00/20 1.2] kvm updates

2012-06-04 Thread Anthony Liguori
On 06/05/2012 08:52 AM, Andreas Färber wrote: Am 04.06.2012 07:46, schrieb Anthony Liguori: On 05/22/2012 12:37 AM, Avi Kivity wrote: Please pull from: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master Pulled. Thanks. This broke the ppc build. Guys, why wasn't this tested?

Re: [Qemu-devel] [PULL 00/20 1.2] kvm updates

2012-06-04 Thread Andreas Färber
Am 05.06.2012 03:58, schrieb Anthony Liguori: Is build bot running against uq/master? If it's not, maybe we should add it to build bot to catch this sort of thing. That's a question for Stefan and Daniel to answer. Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg,

Re: [RFC PATCH] PCI: Introduce INTx check mask API

2012-06-04 Thread Benjamin Herrenschmidt
On Tue, 2012-06-05 at 03:44 +0200, Alexander Graf wrote: Wouldn't the no LSI setting be a flag to the vfio configuration? So when you set up the device group, you say this group can only do MSI. That way the interface would be sysfs and QEMU wouldn't have anything to do with it :) Sure

Re: AMD KVM Pci Passthrough reports device busy

2012-06-04 Thread Alex Williamson
On Mon, 2012-06-04 at 16:11 -0500, Chris Sanders wrote: Hello, I've been working for several days trying to get Pci Passthrough to work. So far the #kvm IRC channel has helped me with a few suggestions, though that hasn't yet solved the problem. I'm running CentOS 6.2 and was suggested I try

Re: Has any work 3.3 kvm-kmod for rhel 6.2 kernel successfully?

2012-06-04 Thread ya su
Jan: sorry for late response of your suggestion. I have found the patch which produce this problem, it comes from this one: 7850ac5420803996e2960d15b924021f28e0dffc. I change as the following, it works fine. diff -ur -i kvm-kmod-3.4/x86/kvm_main.c kvm-kmod-3.4-fix/x86/kvm_main.c

Re: [Qemu-devel] [PULL 00/20 1.2] kvm updates

2012-06-04 Thread Andreas Färber
Am 04.06.2012 07:46, schrieb Anthony Liguori: On 05/22/2012 12:37 AM, Avi Kivity wrote: Please pull from: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master Pulled. Thanks. This broke the ppc build. Guys, why wasn't this tested? There's only three KVM targets to test compared

Re: [Qemu-devel] [PULL 00/20 1.2] kvm updates

2012-06-04 Thread Andreas Färber
Am 05.06.2012 03:58, schrieb Anthony Liguori: Is build bot running against uq/master? If it's not, maybe we should add it to build bot to catch this sort of thing. That's a question for Stefan and Daniel to answer. Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg,