[Qemu-devel] [QEMU v2 7/9] bitmap: Add a new bitmap_move function

2016-07-14 Thread Liang Li
Sometimes, it is need to move a portion of bitmap to another place in a large bitmap, if overlap happens, the bitmap_copy can't not work correctly, we need a new function to do this work. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/qemu/bitmap.h | 13 + 1 file c

[Qemu-devel] [QEMU v2 9/9] migration: skip free pages during live migration

2016-07-14 Thread Liang Li
will not be filtered out in this case. The current implementation can not work with post copy, if post copy is enabled, we simply ignore the free pages. Will make it work later. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [QEMU v2 6/9] balloon: migrate vq elem to destination

2016-07-14 Thread Liang Li
m' should be migrated to destination too. Michael has other idea to solve this issue, but he is busy at the moment, this patch can be used for test before his patch is ready. Signed-off-by: Liang Li <liang.z...@intel.com> --- hw/virtio/virtio-balloon.c | 36 ++-- 1 f

[Qemu-devel] [QEMU v2 4/9] virtio-balloon: update linux head file for new feature

2016-07-14 Thread Liang Li
Update the new feature bit definition for the new virt queue and the request header struct to keep consistent with kernel side. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/standard-headers/linux/virtio_balloon.h | 22 ++ 1 file changed, 22 insertions(+)

[Qemu-devel] [QEMU v2 2/9] virtio-balloon: update linux head file

2016-07-14 Thread Liang Li
Update the new feature bit definition and the page bitmap header struct to keep consistent with kernel side. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/standard-headers/linux/virtio_balloon.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/i

[Qemu-devel] [QEMU v2 1/9] virtio-balloon: Remove needless precompiled directive

2016-07-14 Thread Liang Li
Since there in wrapper around madvise(), the virtio-balloon code is able to work without the precompiled directive, the directive can be removed. Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Thomas Huth <th...@redhat.com> --- hw/virtio/virtio-balloon.c | 2 -- 1 fil

[Qemu-devel] [QEMU v2 8/9] kvm: Add two new arch specific functions

2016-07-14 Thread Liang Li
Add a new function to get the vm's max pfn and a new function to filter out the holes in the undressed free page bitmap to get a tight free page bitmap. They are implemented on X86 and should be implemented on other arches for live migration optimization. Signed-off-by: Liang Li <lian

[Qemu-devel] [QEMU v2 3/9] virtio-balloon: speed up inflating & deflating process

2016-07-14 Thread Liang Li
ture, inflating the balloon to 7GB of a 8GB idle guest only takes 590ms, the performance improvement is about 85%. TODO: optimize stage a by allocating/freeing a chunk of pages instead of a single page at a time. Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Michael S. Tsirkin <m.

[Qemu-devel] [QEMU v2 0/9] Fast (de)inflating & fast live migration

2016-07-14 Thread Liang Li
to request free pages and query the status. * Changed the virtio balloon interface. * Addressed some of the comments of v1. Liang Li (9): virtio-balloon: Remove needless precompiled directive virtio-balloon: update linux head file virtio-balloon: speed up inflating & deflating pro

[Qemu-devel] [PATCH v2] balloon: Fix failure of updating guest memory status

2016-07-05 Thread Liang Li
rom executing. So guest will not update the memory status. Commit 4eae2a657d is doing the right thing, but 's->stats_vq_elem' should be treated as part of balloon device state and migrated to destination if it's not NULL to make everything works well. Signed-off-by: Liang Li <liang.z...@

[Qemu-devel] [PATCH] balloon: Fix failure of updating guest memory status

2016-06-30 Thread Liang Li
rom executing. So guest will not update the memory status. Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Ladi Prosek <lpro...@redhat.com> Cc: Paolo Bonzini <pbonz...@redhat.com> --- hw/virtio/virtio-balloon.c | 8 +++- 1 file

[Qemu-devel] [PATCH v2 kernel 7/7] virtio-balloon: tell host vm's free page info

2016-06-29 Thread Liang Li
Support the request for vm's free page information, response with a page bitmap. QEMU can make use of this free page bitmap to speed up live migration process by skipping process the free pages. Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com&g

[Qemu-devel] [PATCH v2 kernel 1/7] virtio-balloon: rework deflate to add page to a list

2016-06-29 Thread Liang Li
will allow faster notifications using a bitmap down the road. balloon_pfn_to_page() can be removed because it's useless. Signed-off-by: Liang Li <liang.z...@intel.com> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Cc: Paolo Bonzini <pbonz...@redhat.com> Cc: Corneli

[Qemu-devel] [PATCH v2 kernel 3/7] mm: add a function to get the max pfn

2016-06-29 Thread Liang Li
Expose the function to get the max pfn, so it can be used in the virtio-balloon device driver. Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Mel Gorman <mgor...@techsingularity.net> Cc: Michael S. Tsirkin <m...@redhat.c

[Qemu-devel] [PATCH v2 kernel 6/7] mm: add the related functions to get free page info

2016-06-29 Thread Liang Li
Save the free page info into a page bitmap, will be used in virtio balloon device driver. Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Mel Gorman <mgor...@techsingularity.net> Cc: Michael S. Tsirkin <m...@redhat.com>

[Qemu-devel] [PATCH v2 kernel 4/7] virtio-balloon: speed up inflate/deflate process

2016-06-29 Thread Liang Li
ture, inflating the balloon to 7GB of a 8GB idle guest only takes 590ms, the performance improvement is about 85%. TODO: optimize stage a by allocating/freeing a chunk of pages instead of a single page at a time. Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Michael S. Tsirkin <m.

[Qemu-devel] [PATCH v2 kernel 5/7] virtio-balloon: define feature bit and head for misc virt queue

2016-06-29 Thread Liang Li
. And the VMM hypervisor can get some of guest's runtime information through this virtual queue, e.g. the guest's free page information, which can be used for live migration optimization. Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Paolo Bo

[Qemu-devel] [PATCH v2 kernel 2/7] virtio-balloon: define new feature bit and page bitmap head

2016-06-29 Thread Liang Li
about the page bitmap. e.g. the page size, page bitmap length and start pfn. Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Paolo Bonzini <pbonz...@redhat.com> Cc: Cornelia Huck <cornelia.h...@de.ibm.com> Cc: Amit Shah <amit.s.

[Qemu-devel] [PATCH v2 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-06-29 Thread Liang Li
o v2: * Abandon the patch for dropping page cache. * Put some structures to uapi head file. * Use a new way to determine the page bitmap size. * Use a unified way to send the free page information with the bitmap * Address the issues referred in MST's comments Liang Li (7): vi

[Qemu-devel] [QEMU 7/7] migration: skip free pages during live migration

2016-06-13 Thread Liang Li
will not be filtered out in this case. The current implementation can not work with post copy, if post copy is enabled, we simply ignore the free pages. Will make it work later. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [QEMU 5/7] bitmap: Add a new bitmap_move function

2016-06-13 Thread Liang Li
Sometimes, it is need to move a portion of bitmap to another place in a large bitmap, if overlap happens, the bitmap_copy can't not work correctly, we need a new function to do this work. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/qemu/bitmap.h | 13 + 1 file c

[Qemu-devel] [QEMU 6/7] kvm: Add two new arch specific functions

2016-06-13 Thread Liang Li
Add a new function to get the vm's max pfn and a new function to filter out the holes to get a tight free page bitmap. They are implemented on X86, and all the arches should implement them for live migration optimization. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/sysemu

[Qemu-devel] [QEMU 4/7] balloon: get free page info from guest

2016-06-13 Thread Liang Li
-off-by: Liang Li <liang.z...@intel.com> --- balloon.c | 24 +++- hw/virtio/virtio-balloon.c | 75 +- include/hw/virtio/virtio-balloon.h | 4 ++ include/sysemu/balloon.h | 8 4 files changed, 108 inse

[Qemu-devel] [QEMU 3/7] Add the hmp and qmp interface for dropping cache

2016-06-13 Thread Liang Li
Add the hmp and qmp interface to drop vm's page cache, users can control the type of cache they want vm to drop. Signed-off-by: Liang Li <liang.z...@intel.com> --- balloon.c| 19 +++ hmp-commands.hx | 15 +++ hmp.c

[Qemu-devel] [QEMU 2/7] virtio-balloon: add drop cache support

2016-06-13 Thread Liang Li
the exact amount of memroy that can be reclaimed. This patch add a new feature to the balloon device to support this operation, hypervisor can request the VM to drop it's cache, so as to reclaim more memory. Signed-off-by: Liang Li <liang.z...@intel.com> --- bal

[Qemu-devel] [QEMU 0/7] Fast balloon and fast live migration

2016-06-13 Thread Liang Li
This patch set is intended to speed up the inflating/deflating process of virtio-balloon and speed up live migration by skipping process guest's free pages. The virtio-balloon is extended to support some new features, so as to make things faster. Liang Li (7): balloon: speed up inflating

[Qemu-devel] [QEMU 1/7] balloon: speed up inflating & deflating process

2016-06-13 Thread Liang Li
ture to the virtio-balloon device. And now, inflating the balloon to 3GB of a 4GB idle guest only takes 210ms, it's about 8 times as fast as before. TODO: optimize stage a by allocating/freeing a chunk of pages instead of a single page at a time. Signed-off-by: Liang Li <liang.z...@intel.com> --- hw/vir

[Qemu-devel] [PATCH RFC v2 QEMU] balloon: speed up inflating & deflating process

2016-05-27 Thread Liang Li
ture to the virtio-balloon device. And now, inflating the balloon to 3GB of a 4GB idle guest only takes 210ms, it's about 8 times as fast as before. TODO: optimize stage a by allocating/freeing a chunk of pages instead of a single page at a time. v2 changes: change the interface Signed-off-by: Lian

[Qemu-devel] [PATCH RFC v2 kernel] balloon: speed up inflating/deflating process

2016-05-27 Thread Liang Li
one. 2. Address some of comments of v1. Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Michael S. Tsirkin <m...@redhat.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Paolo Bonzini <pbonz...@redhat.com> Cc: Cornelia Huck <cornelia.h...@de.ibm.com> C

[Qemu-devel] [PATCH RFC kernel] balloon: speed up inflating/deflating process

2016-05-20 Thread Liang Li
ture to the virtio-balloon device. And now, inflating the balloon to 3GB of a 4GB idle guest only takes 175ms, it's about 9 times as fast as before. TODO: optimize stage a by allocating/freeing a chunk of pages instead of a single page at a time. Signed-off-by: Liang Li <liang.z...@intel.com> --- driv

[Qemu-devel] [PATCH RFC QEMU] balloon: speed up inflating & deflating process

2016-05-20 Thread Liang Li
ture to the virtio-balloon device. And now, inflating the balloon to 3GB of a 4GB idle guest only takes 175ms, it's about 9 times as fast as before. TODO: optimize stage a by allocating/freeing a chunk of pages instead of a single page at a time. Signed-off-by: Liang Li <liang.z...@intel.com> --- hw/vir

[Qemu-devel] [PATCH v2 9/9] migration: code clean up

2016-05-05 Thread Liang Li
Use 'QemuMutex comp_done_lock' and 'QemuCond comp_done_cond' instead of 'QemuMutex *comp_done_lock' and 'QemuCond comp_done_cond'. To keep consistent with 'QemuMutex decomp_done_lock' and 'QemuCond comp_done_cond'. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [PATCH v2 5/9] migration: refine ram_save_compressed_page

2016-05-05 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, at the same time, add code to check if the compression is successful. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [PATCH v2 4/9] qemu-file: Fix qemu_put_compression_data flaw

2016-05-05 Thread Liang Li
Current qemu_put_compression_data can only work with no writable QEMUFile, and can't work with the writable QEMUFile. But it does not provide any measure to prevent users from using it with a writable QEMUFile. We should fix this flaw to make it works with writable QEMUFile. Signed-off-by: Liang

[Qemu-devel] [PATCH v2 6/9] migration: protect the quit flag by lock

2016-05-05 Thread Liang Li
quit_comp_thread and quit_decomp_thread are accessed by several thread, it's better to protect them with locks. We use a per thread flag to replace the global one, and the new flag is protected by a lock. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [PATCH v2 3/9] migration: remove useless code

2016-05-05 Thread Liang Li
page_buffer is set twice repeatedly, remove the previous set. Signed-off-by: Liang Li <liang.z...@intel.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Reviewed-by: Juan Quintela <quint...@redhat.com> --- migration/ram.c | 1 - 1 file changed, 1 deletion(-) diff

[Qemu-devel] [PATCH v2 7/9] migration: refine the compression code

2016-05-05 Thread Liang Li
The current code for multi-thread compression is not clear, especially in the aspect of using lock. Refine the code to make it clear. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 84 +++-- 1 file changed, 40 inse

[Qemu-devel] [PATCH v2 8/9] migration: refine the decompression code

2016-05-05 Thread Liang Li
The current code for multi-thread decompression is not clear, especially in the aspect of using lock. Refine the code to make it clear. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 50 +- 1 file changed, 25 insertions(

[Qemu-devel] [PATCH v2 2/9] migration: Fix a potential issue

2016-05-05 Thread Liang Li
to fix this potential issue. Suggested-by: David Alan Gilbert <dgilb...@redhat.com> Suggested-by: Juan Quintela <quint...@redhat.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/migration

[Qemu-devel] [PATCH v2 1/9] migration: Fix multi-thread compression bug

2016-05-05 Thread Liang Li
ted in the decompression thread. Fix these two issues by following the code pattern for compression. Signed-off-by: Liang Li <liang.z...@intel.com> Reported-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH v2 0/9] live migration bug fix and refine

2016-05-05 Thread Liang Li
. Thanks for Juan's work. Liang Li (9): migration: Fix multi-thread compression bug migration: Fix a potential issue migration: remove useless code qemu-file: Fix qemu_put_compression_data flaw migration: refine ram_save_compressed_page migration: protect the quit flag by lock migration

[Qemu-devel] [PATCH 2/5] migration: Fix a potential issue

2016-05-03 Thread Liang Li
to fix this potential issue. Suggested-by: David Alan Gilbert <dgilb...@redhat.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- include/migration/migration.h | 1 + migration/migration.c | 2 +- migration/ram.c | 20 3 files changed, 2

[Qemu-devel] [PATCH 5/5] migration: refine ram_save_compressed_page

2016-05-03 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, at the same time, add code to check if the compression is successful. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [PATCH 3/5] migration: remove useless code

2016-05-03 Thread Liang Li
page_buffer is set twice repeatedly, remove the previous set. Signed-off-by: Liang Li <liang.z...@intel.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> --- migration/ram.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 4459

[Qemu-devel] [PATCH 4/5] qemu-file: Fix qemu_put_compression_data flaw

2016-05-03 Thread Liang Li
Quintela <quint...@redhat.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/qemu-file.c | 23 +-- migration/ram.c | 6 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c i

[Qemu-devel] [PATCH 1/5] migration: Fix multi-thread compression bug

2016-05-03 Thread Liang Li
ted in the decompression thread. Fix these two issues by following the code pattern for compression. Signed-off-by: Liang Li <liang.z...@intel.com> Reported-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 0/5] live migration bug fix and refine

2016-05-03 Thread Liang Li
This patch set fixed a bug which will block live migration and another potential issue when using multi-thread (de)compression. The last three patches were submitted before, put them here together. Liang Li (5): migration: Fix multi-thread compression bug migration: Fix a potential issue

[Qemu-devel] [PATCH] migration: Fix multi-thread compression bug

2016-05-03 Thread Liang Li
ted in the decompression thread. Fix these two issues by following the code pattern for compression. Reported-by: Daniel P. Berrange <berra...@redhat.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 38 +++--- 1 file changed, 27 insertions(+

[Qemu-devel] [PATCH kernel 1/2] mm: add the related functions to build the free page bitmap

2016-04-19 Thread Liang Li
The free page bitmap will be sent to QEMU through virtio interface and used for live migration optimization. Drop the cache before building the free page bitmap can get more free pages. Whether dropping the cache is decided by user. Signed-off-by: Liang Li <liang.z...@intel.com> -

[Qemu-devel] [PATCH kernel 2/2] virtio-balloon: extend balloon driver to support the new feature

2016-04-19 Thread Liang Li
Extend the virtio balloon to support the new feature VIRTIO_BALLOON_F_GET_FREE_PAGES, so that we can use it to send the free page bitmap from guest to QEMU, the free page bitmap will be used for live migration optimization. Signed-off-by: Liang Li <liang.z...@intel.com> --- drivers/

[Qemu-devel] [PATCH kernel 0/2] speed up live migration by skipping free pages

2016-04-19 Thread Liang Li
ion. Liang Li (2): mm: add the related functions to build the free page bitmap virtio-balloon: extend balloon driver to support the new feature drivers/virtio/virtio_balloon.c | 100 ++-- fs/drop_caches.c| 22 +--- include/linux/f

[Qemu-devel] [PATCH QEMU 2/5] kvm: Add two new arch specific functions

2016-04-19 Thread Liang Li
Add a new function to get the vm's max pfn and a new function to filter out the holes to get a tight free page bitmap. They are implemented on X86, and all the arches should implement them for live migration optimization. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/sysemu

[Qemu-devel] [PATCH QEMU 4/5] migration: filter out free pages during live migration

2016-04-19 Thread Liang Li
will not be filtered out in this case. The current implementation can not work with post copy, if post copy is enabled, we simply ignore the free pages. Will make it work later. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c

[Qemu-devel] [PATCH QEMU 5/5] migration: Add the interface for cache drop control

2016-04-19 Thread Liang Li
Whether drop the cache and drop what kind of cache depend on the user, add the related qmp and hmp interface to query and set the cache control value. Signed-off-by: Liang Li <liang.z...@intel.com> --- hmp.c | 8 include/migration/migration.h | 1 + mig

[Qemu-devel] [PATCH QEMU 3/5] virtio-balloon: Add a new feature to balloon device

2016-04-19 Thread Liang Li
Extend the virtio balloon device to support a new feature, this new feature can help to get guest's free pages information, which can be used for live migration optimzation. Signed-off-by: Liang Li <liang.z...@intel.com> --- balloon.c | 29 ++

[Qemu-devel] [PATCH QEMU 1/5] bitmap: Add a new bitmap_move function

2016-04-19 Thread Liang Li
Sometimes, it is need to move a portion of bitmap to another place in a large bitmap, if overlap happens, the bitmap_copy can't not work correctly, we need a new function to do this work. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/qemu/bitmap.h | 13 + 1 file c

[Qemu-devel] [PATCH QEMU 0/5] spee up live migration by skipping free pages

2016-04-19 Thread Liang Li
914 -- transferred ram(KB) | 1316747 | 421980 == Liang Li (5): bitmap: Add a new bitmap_move function kvm: Add two new arch specific functions virtio-balloon: Add a new feature to balloon device migration: filter

[Qemu-devel] [PATCH] migration: remove useless code

2016-04-18 Thread Liang Li
page_buffer is set twice repeatedly, remove the previous set. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 3f05738..31d40f4 100644 --- a/migration/ram.c +++ b/migration

[Qemu-devel] [RFC Design Doc]Speed up live migration by skipping free pages

2016-03-22 Thread Liang Li
I have sent the RFC version patch set for live migration optimization by skipping processing the free pages in the ram bulk stage and received a lot of comments. The related threads can be found at: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg00715.html

[Qemu-devel] [PATCH v6 2/2] cutils: add avx2 instruction optimization

2016-03-07 Thread Liang Li
, execute the AVX2 instructions, else, execute the original instructions. Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Paolo Bonzini <pbonz...@redhat.com> Suggested-by: Richard Henderson <r...@twiddle.net> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- inc

[Qemu-devel] [PATCH v6 0/2] add avx2 instruction optimization

2016-03-07 Thread Liang Li
uggestion) * Change the configure, detect ifunc and avx2 attributes together v2 -> v3 changes: * Detect the ifunc attribute support (Paolo's suggestion) * Use the ifunc attribute instead of the inline asm (Richard's suggestion) * Change the configure (Juan's suggestion) Liang Li (2): confi

[Qemu-devel] [PATCH v6 1/2] configure: detect ifunc and avx2 attribute

2016-03-07 Thread Liang Li
Detect if the compiler can support the ifun and avx2, if so, set CONFIG_AVX2_OPT which will be used to turn on the avx2 instruction optimization. Suggested-by: Paolo Bonzini <pbonz...@redhat.com> Suggested-by: Peter Maydell <peter.mayd...@linaro.org> Signed-off-by: Liang Li <liang

[Qemu-devel] [RFC kernel 2/2] virtio-balloon: extend balloon driver to support a new feature

2016-03-03 Thread Liang Li
Extend the virio balloon to support the new feature VIRTIO_BALLOON_F_GET_FREE_PAGES, so that we can use it to send the free pages information from guest to QEMU, and then optimize the live migration process. Signed-off-by: Liang Li <liang.z...@intel.com> --- drivers/virtio/virtio_bal

[Qemu-devel] [RFC kernel 1/2] mm: Add the functions used to get free pages information

2016-03-03 Thread Liang Li
get_total_pages_count() tries to get the page count of the system RAM. get_free_pages() is intend to construct a free pages bitmap by traversing the free_list. The free pages information will be sent to QEMU through virtio and used for live migration optimization. Signed-off-by: Liang Li

[Qemu-devel] [RFC qemu 4/4] migration: filter out guest's free pages in ram bulk stage

2016-03-03 Thread Liang Li
Get the free pages information through virtio and filter out the free pages in the ram bulk stage. This can significantly reduce the total live migration time as well as network traffic. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.

[Qemu-devel] [RFC kernel 0/2]A PV solution for KVM live migration optimization

2016-03-03 Thread Liang Li
361375 Liang Li (2): mm: Add the functions used to get free pages information virtio-balloon: extend balloon driver to support a new feature drivers/virtio/virtio_balloon.c | 108 ++-- include/uapi/linux/virtio_balloon.h | 1

[Qemu-devel] [RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device

2016-03-03 Thread Liang Li
Extend the virtio balloon device to support a new feature, this new feature can help to get guest's free pages information, which can be used for live migration optimzation. Signed-off-by: Liang Li <liang.z...@intel.com> --- balloon.c | 30 +++

[Qemu-devel] [RFC qemu 1/4] pc: Add code to get the lowmem form PCMachineState

2016-03-03 Thread Liang Li
The lowmem will be used by the following patch to get a correct free pages bitmap. Signed-off-by: Liang Li <liang.z...@intel.com> --- hw/i386/pc.c | 5 + hw/i386/pc_piix.c| 1 + hw/i386/pc_q35.c | 1 + include/hw/i386/pc.h | 3 ++- 4 files changed, 9 insertions(+), 1 de

[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-03 Thread Liang Li
ion. | original |pv --- total time(ms) | 7436| 552 transferred ram(KB) | 8146291 | 361375 ==== Liang Li (4): pc: Add code to get the low

[Qemu-devel] [RFC qemu 3/4] migration: not set migration bitmap in setup stage

2016-03-03 Thread Liang Li
Set ram_list.dirty_memory instead of migration bitmap, the migration bitmap will be update when doing migration_bitmap_sync(). Set migration_dirty_pages to 0 and it will be updated by migration_dirty_pages() too. The following patch is based on this change. Signed-off-by: Liang Li <lian

[Qemu-devel] [PATCH v3 1/2] qemu-file: Fix qemu_put_compression_data flaw

2016-02-24 Thread Liang Li
Quintela <quint...@redhat.com> Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/qemu-file.c | 23 +-- migration/ram.c |6 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c i

[Qemu-devel] [PATCH v3 2/2] migration: refine ram_save_compressed_page

2016-02-24 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, at the same time, add code to check if the compression is successful. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c

[Qemu-devel] [PATCH v3 0/2] Fix flaw of qemu_put_compression_data

2016-02-24 Thread Liang Li
. ram_save_compressed_page can be refined based on the change of qemu_put_compression_data, very small improvement, but code looks better. Liang Li (2): qemu-file: Fix qemu_put_compression_data flaw migration: refine ram_save_compressed_page migration/qemu-file.c | 23 +-- migration/ram.c

[Qemu-devel] [PATCH v5 1/2] configure: detect ifunc and avx2 attribute

2016-01-26 Thread Liang Li
Detect if the compiler can support the ifun and avx2, if so, set CONFIG_AVX2_OPT which will be used to turn on the avx2 instruction optimization. Suggested-by: Paolo Bonzini <pbonz...@redhat.com> Suggested-by: Peter Maydell <peter.mayd...@linaro.org> Signed-off-by: Liang Li <liang

[Qemu-devel] [PATCH v5 2/2] cutils: add avx2 instruction optimization

2016-01-26 Thread Liang Li
, execute the AVX2 instructions, else, execute the original instructions. Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Paolo Bonzini <pbonz...@redhat.com> Suggested-by: Richard Henderson <r...@twiddle.net> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- inc

[Qemu-devel] [PATCH v5 0/2] add avx2 instruction optimization

2016-01-26 Thread Liang Li
(Paolo's suggestion) * Use the ifunc attribute instead of the inline asm (Richard's suggestion) * Change the configure (Juan's suggestion) Liang Li (2): configure: detect ifunc and avx2 attribute cutils: add avx2 instruction optimization configure | 21 + inc

[Qemu-devel] [PATCH] migration: remove useless code.

2016-01-26 Thread Liang Li
Since 's->state' will be set in migrate_init(), there is no need to set it before calling migrate_init(). The code and the related comments can be removed. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/migration.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/

[Qemu-devel] [PATCH v4 0/3] add avx2 instruction optimization

2016-01-20 Thread Liang Li
Change the configure (Juan's suggestion) Liang Li (2): configure: detect ifunc and avx2 attribute cutils: add avx2 instruction optimization configure | 20 + include/qemu-common.h | 8 +--- util/cutils.c | 118 -- 3

[Qemu-devel] [PATCH v4 2/2] cutils: add avx2 instruction optimization

2016-01-20 Thread Liang Li
, execute the original instructions. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/qemu-common.h | 8 +--- util/cutils.c | 118 -- 2 files changed, 115 insertions(+), 11 deletions(-) diff --git a/include/qemu-common.h b/i

[Qemu-devel] [PATCH v4 1/2] configure: detect ifunc and avx2 attribute

2016-01-20 Thread Liang Li
Detect if the compiler can support the ifun and avx2, if so, set CONFIG_AVX2_OPT which will be used to turn on the avx2 instruction optimization. Signed-off-by: Liang Li <liang.z...@intel.com> --- configure | 20 1 file changed, 20 insertions(+) diff --git a/confi

[Qemu-devel] [PATCH v4 0/2] add avx2 instruction optimization

2016-01-20 Thread Liang Li
Change the configure (Juan's suggestion) Liang Li (2): configure: detect ifunc and avx2 attribute cutils: add avx2 instruction optimization configure | 20 + include/qemu-common.h | 8 +--- util/cutils.c | 118 -- 3

[Qemu-devel] [PATCH RESEND v2 2/2] migration: refine ram_save_compressed_page

2016-01-15 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, but the code looks better. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 20 1 file changed, 8 inse

[Qemu-devel] (no subject)

2016-01-15 Thread Liang Li
. For safety, it should be improved to avoid some issues. ram_save_compressed_page can be refined based on the change of qemu_put_compression_data, very small improvement, but code looks better. Liang Li (2): qemu-file: Fix qemu_put_compression_data flaw migration: refine ram_save_compressed_page

[Qemu-devel] [PATCH RESEND v2 1/2] qemu-file: Fix qemu_put_compression_data flaw

2016-01-15 Thread Liang Li
Current qemu_put_compression_data can only work with no writable QEMUFile, and can't work with the writable QEMUFile. But it does not provide any measure to prevent users from using it with a writable QEMUFile. We should fix this flaw to make it works with writable QEMUFile. Signed-off-by: Liang

[Qemu-devel] [PATCH RESEND v2 0/2] Fix flaw of qemu_put_compression_data

2016-01-15 Thread Liang Li
. ram_save_compressed_page can be refined based on the change of qemu_put_compression_data, very small improvement, but code looks better. Liang Li (2): qemu-file: Fix qemu_put_compression_data flaw migration: refine ram_save_compressed_page migration/qemu-file.c | 23 +-- migration/ram.c

[Qemu-devel] [PATCH] migration: not send zero page header in ram bulk stage

2016-01-15 Thread Liang Li
allocating all the guest's RAM pages in the destination node after live migration. Another benefit is destination QEMU can save lots of CPU cycles for zero page checking. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 10 ++ 1 file changed, 6 insertions

[Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-08 Thread Liang Li
the original code. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/qemu-common.h | 13 +- util/Makefile.objs | 2 ++ util/buffer-zero-avx2.c | 54 util/cutils.c | 65 ++

[Qemu-devel] [v3 3/3] configure: add options to config avx2

2015-12-08 Thread Liang Li
Add the '--enable-avx2' & '--disable-avx2' option so as to config the AVX2 instruction optimization. If '--disable-avx2' is not set, configure will detect if the compiler can support AVX2 option, if yes, AVX2 optimization is eabled, else disabled. Signed-off-by: Liang Li <liang.z...@in

[Qemu-devel] [v3 2/3] configure: detect ifunc attribute

2015-12-08 Thread Liang Li
Detect if the compiler can support the ifunc attribute, the avx2 optimization depends on ifunc attribute. Signed-off-by: Liang Li <liang.z...@intel.com> --- configure | 20 1 file changed, 20 insertions(+) diff --git a/configure b/configure index b9552fd..394db3b

[Qemu-devel] [v3 0/3] add avx2 instruction optimization

2015-12-08 Thread Liang Li
unc attribute instead of the inline asm (Richard's suggestion) * Change the configure (Juan's suggestion) Liang Li (3): cutils: add avx2 instruction optimization configure: detect ifunc attribute configure: add options to config avx2 configure |

[Qemu-devel] [v2 1/2] qemu-file: Fix qemu_put_compression_data flaw

2015-12-07 Thread Liang Li
Current qemu_put_compression_data can only work with no writable QEMUFile, and can't work with the writable QEMUFile. But it does not provide any measure to prevent users from using it with a writable QEMUFile. We should fix this flaw to make it works with writable QEMUFile. Signed-off-by: Liang

[Qemu-devel] [v2 0/2] Fix flaw of qemu_put_compression_data

2015-12-07 Thread Liang Li
. ram_save_compressed_page can be refined based on the change of qemu_put_compression_data, very small improvement, but code looks better. Liang Li (2): qemu-file: Fix qemu_put_compression_data flaw migration: refine ram_save_compressed_page migration/qemu-file.c | 23 +-- migration/ram.c

[Qemu-devel] [v2 2/2] migration: refine ram_save_compressed_page

2015-12-07 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, but the code looks better. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 20 1 file changed, 8 inse

[Qemu-devel] [PATCH 1/2] qemu-file: fix flaws of qemu_put_compression_data

2015-12-03 Thread Liang Li
There are some flaws in qemu_put_compression_data, this patch tries to fix it. Now it can be used by other code. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/qemu-file.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/migration/qemu-fi

[Qemu-devel] [PATCH 0/2] fix the flaws of qemu_put_compression_data

2015-12-03 Thread Liang Li
This patch fixed the flaws in qemu_put_compression_data function. and cleanup the code based on the change. Liang Li (2): qemu-file: fix flaws of qemu_put_compression_data migration: code clean up. migration/qemu-file.c | 10 +- migration/ram.c | 20 2

[Qemu-devel] [PATCH 2/2] migration: code clean up.

2015-12-03 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, but the code looks better. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 20 1 file changed, 8 inse

[Qemu-devel] [PATCH 1/2] qemu-file: fix flaws of qemu_put_compression_data

2015-12-03 Thread Liang Li
There are some flaws in qemu_put_compression_data, this patch tries to fix it. Now it can be used by other code. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/qemu-file.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/migration/qemu-fi

[Qemu-devel] [PATCH 2/2] migration: code clean up.

2015-12-03 Thread Liang Li
Use qemu_put_compression_data to do the compression directly instead of using do_compress_ram_page, avoid some data copy. very small improvement, but the code looks better. Signed-off-by: Liang Li <liang.z...@intel.com> --- migration/ram.c | 20 1 file changed, 8 inse

[Qemu-devel] [PATCH 0/2] fix the flaws of qemu_put_compression_data

2015-12-03 Thread Liang Li
This patch fixed the flaws in qemu_put_compression_data function. and cleanup the code based on the change. Liang Li (2): qemu-file: fix flaws of qemu_put_compression_data migration: code clean up. migration/qemu-file.c | 10 +- migration/ram.c | 20 2

[Qemu-devel] [v2 RESEND 1/2] cutils: add avx2 instruction optimization

2015-11-09 Thread Liang Li
the original code. Signed-off-by: Liang Li <liang.z...@intel.com> --- include/qemu-common.h | 28 +++-- util/Makefile.objs| 2 ++ util/avx2.c | 68 +++ util/cutils.c | 47

<    1   2   3   4   >