Re: [Qemu-devel] [PATCH v2 00/16] Postcopy: Hugepage support

2017-02-27 Thread Alexey Perevalov
Hi David, On Tue, Feb 21, 2017 at 10:03:14AM +, Dr. David Alan Gilbert wrote: > * Alexey Perevalov (a.pereva...@samsung.com) wrote: > > > > Hello David, > > Hi Alexey, > > > On Tue, Feb 14, 2017 at 07:34:26PM +, Dr. David Alan Gilbert wrote: >

Re: [Qemu-devel] [PATCH v2 00/16] Postcopy: Hugepage support

2017-02-27 Thread Alexey Perevalov
On 02/27/2017 02:26 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: Hi David, On Tue, Feb 21, 2017 at 10:03:14AM +, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: Hello David, Hi Alexey, On Tue, Feb 14, 2017 at

Re: [Qemu-devel] [PATCH v1 2/2] migration: add bitmap for copied page

2017-06-13 Thread Alexey Perevalov
On 06/14/2017 08:12 AM, Peter Xu wrote: On Tue, Jun 13, 2017 at 12:36:33PM +0300, Alexey Perevalov wrote: This patch adds ability to track down already copied pages, it's necessary for calculation vCPU block time in postcopy migration feature, maybe for restore after postcopy migration fa

Re: [Qemu-devel] [PATCH v1 2/2] migration: add bitmap for copied page

2017-06-14 Thread Alexey Perevalov
On 06/14/2017 09:53 AM, Peter Xu wrote: On Wed, Jun 14, 2017 at 09:39:53AM +0300, Alexey Perevalov wrote: On 06/14/2017 08:12 AM, Peter Xu wrote: On Tue, Jun 13, 2017 at 12:36:33PM +0300, Alexey Perevalov wrote: This patch adds ability to track down already copied pages, it's necessar

Re: [Qemu-devel] [PATCH v1 2/2] migration: add bitmap for copied page

2017-06-14 Thread Alexey Perevalov
On 06/13/2017 02:42 PM, Juan Quintela wrote: Alexey Perevalov wrote: Hi I think that it would make things clearer if we do a s/copied/received/ As what we are tracking here are the pages that have already been received. This patch adds ability to track down already copied pages, it&#

[Qemu-devel] [PATCH v2 1/3] migration: postcopy_place_page factoring out

2017-06-15 Thread Alexey Perevalov
Need to mark copied pages as closer as possible to the place where it tracks down. That will be necessary in futher patch. Reviewed-by: Juan Quintela Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13 - migration/postcopy-ram.h | 4 ++-- migration/ram.c

[Qemu-devel] [PATCH v2 2/3] migration: introduce qemu_ufd_copy_ioctl helper

2017-06-15 Thread Alexey Perevalov
Just for placing auxilary operations inside helper, auxilary operations like: track received pages, notify about copying operation in futher patches. Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 35 ++- 1 file changed, 22 insertions(+), 13

[Qemu-devel] [PATCH v2 0/3] Add bitmap for received pages in postcopy migration

2017-06-15 Thread Alexey Perevalov
r" Patchset is based on Juan's patchset: [PATCH v2 0/5] Create setup/cleanup methods for migration incoming side Alexey Perevalov (3): migration: postcopy_place_page factoring out migration: introduce qemu_ufd_copy_ioctl helper migration: add bitmap for received page include

[Qemu-devel] [PATCH v2 3/3] migration: add bitmap for received page

2017-06-15 Thread Alexey Perevalov
ct page is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 2 ++ migration/postcopy-ram.c | 11 --- migration/ram.c | 33 + migra

Re: [Qemu-devel] [PATCH v2 3/3] migration: add bitmap for received page

2017-06-16 Thread Alexey Perevalov
On 06/16/2017 12:06 PM, Peter Xu wrote: On Thu, Jun 15, 2017 at 07:36:15PM +0300, Alexey Perevalov wrote: [...] +void init_receivedmap(void) +{ +RAMBlock *rb; + +RAMBLOCK_FOREACH(rb) { +unsigned long pages; +pages = rb->max_length >> TARGET_PAGE_BITS; Nit

Re: [Qemu-devel] [PATCH v2 3/3] migration: add bitmap for received page

2017-06-16 Thread Alexey Perevalov
On 06/16/2017 08:14 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: This patch adds ability to track down already received pages, it's necessary for calculation vCPU block time in postcopy migration feature, maybe for restore after postcopy migr

[Qemu-devel] [PATCH v3 2/3] migration: introduce qemu_ufd_copy_ioctl helper

2017-06-16 Thread Alexey Perevalov
Just for placing auxilary operations inside helper, auxilary operations like: track received pages, notify about copying operation in futher patches. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 34

[Qemu-devel] [PATCH v3 0/3] Add bitmap for received pages in postcopy migration

2017-06-16 Thread Alexey Perevalov
am_load_cleanup - new patch "migration: introduce qemu_ufd_copy_ioctl helper" Patchset is based on Juan's patchset: [PATCH v2 0/5] Create setup/cleanup methods for migration incoming side Alexey Perevalov (3): migration: postcopy_place_page factoring out migration: introd

[Qemu-devel] [PATCH v3 1/3] migration: postcopy_place_page factoring out

2017-06-16 Thread Alexey Perevalov
Need to mark copied pages as closer as possible to the place where it tracks down. That will be necessary in futher patch. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13

[Qemu-devel] [PATCH v3 3/3] migration: add bitmap for received page

2017-06-16 Thread Alexey Perevalov
ct page is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 3 +++ migration/migration.c| 1 + migration/postcopy-ram.c | 12 ++--- migration/ram.c

[Qemu-devel] [PATCH v9 0/8] calculate blocktime for postcopy live migration

2017-06-16 Thread Alexey Perevalov
g only when kernel supports it - It doesn't send back the downtime, just trace it This patch set is based on commit [PATCH v3 0/3] Add bitmap for received pages in postcopy migration Alexey Perevalov (8): userfault: add pid into uffd_msg & update UFFD_FEATURE_* migration: pass M

[Qemu-devel] [PATCH v9 6/8] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-06-16 Thread Alexey Perevalov
uot;, \"state\": true } ] } }" | nc -U /var/lib/migrate-vm-monitor.sock Or just with HMP (qemu) migrate_set_capability postcopy-blocktime on Signed-off-by: Alexey Perevalov --- migration/migration.h| 8 ++ migration/postcopy-ram.c | 65 +++

[Qemu-devel] [PATCH v9 8/8] migration: postcopy_blocktime documentation

2017-06-16 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- docs/devel/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/devel/migration.txt b/docs/devel/migration.txt index 1b940a8..4b625ca 100644 --- a/docs/devel/migration.txt +++ b/docs/devel

[Qemu-devel] [PATCH v9 3/8] migration: fix hardcoded function name in error report

2017-06-16 Thread Alexey Perevalov
Reviewed-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 35f3ffd..b35baf3 100644 --- a/migration

[Qemu-devel] [PATCH v9 1/8] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-06-16 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 4 1 file changed, 4 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/use

[Qemu-devel] [PATCH v9 5/8] migration: introduce postcopy-blocktime capability

2017-06-16 Thread Alexey Perevalov
Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: A

[Qemu-devel] [PATCH v9 2/8] migration: pass MigrationIncomingState* into migration check functions

2017-06-16 Thread Alexey Perevalov
That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- migration/migration.c| 3 ++- migration/postcopy-ram.c | 10 +- migration

[Qemu-devel] [PATCH v9 4/8] migration: split ufd_version_check onto receive/request features part

2017-06-16 Thread Alexey Perevalov
ontext has internal state, and after first call of ioctl UFFD_API it changes its state to UFFD_STATE_RUNNING (in case of success), but kernel while handling ioctl UFFD_API expects UFFD_STATE_WAIT_API. So only one ioctl with UFFD_API is possible per ufd. Reviewed-by: Dr. David Alan Gilbert Signed-off-

[Qemu-devel] [PATCH v9 7/8] migration: calculate vCPU blocktime on dst side

2017-06-16 Thread Alexey Perevalov
page address as value and vCPU as index. It helps to find proper vCPU at UFFD_COPY time. Also it keeps list for blocktime per vCPU (could be traced with page_fault_addr) Blocktime will not calculated if postcopy_blocktime field of MigrationIncomingState wasn't initialized. Signed-off-by: A

Re: [Qemu-devel] [PATCH v2 3/3] migration: add bitmap for received page

2017-06-16 Thread Alexey Perevalov
On 06/16/2017 09:46 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: On 06/16/2017 08:14 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: This patch adds ability to track down already received pages, it's necessar

[Qemu-devel] [PATCH v4 0/3] Add bitmap for received pages in postcopy migration

2017-06-26 Thread Alexey Perevalov
will be necessary - releasing memory of receivedmap was added into ram_load_cleanup - new patch "migration: introduce qemu_ufd_copy_ioctl helper" Patchset is based on Juan's patchset: [PATCH v2 0/5] Create setup/cleanup methods for migration incoming side Alexey Perevalov (3):

[Qemu-devel] [PATCH v4 1/3] migration: postcopy_place_page factoring out

2017-06-26 Thread Alexey Perevalov
Need to mark copied pages as closer as possible to the place where it tracks down. That will be necessary in futher patch. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13

[Qemu-devel] [PATCH v4 2/3] migration: introduce qemu_ufd_copy_ioctl helper

2017-06-26 Thread Alexey Perevalov
Just for placing auxilary operations inside helper, auxilary operations like: track received pages, notify about copying operation in futher patches. Reviewed-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Alexey Perevalov --- migration/postcopy

[Qemu-devel] [PATCH v4 3/3] migration: add bitmap for received page

2017-06-26 Thread Alexey Perevalov
ct page is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 10 migration/migration.c| 1 + migration/postcopy-ram.c | 20 migration/ram.c

[Qemu-devel] [PATCH v5 0/3] Add bitmap for received pages in postcopy migration

2017-06-27 Thread Alexey Perevalov
il patch set where it will be necessary - releasing memory of receivedmap was added into ram_load_cleanup - new patch "migration: introduce qemu_ufd_copy_ioctl helper" Patchset is based on Juan's patchset: [PATCH v2 0/5] Create setup/cleanup methods for migration incoming sid

[Qemu-devel] [PATCH v5 2/3] migration: introduce qemu_ufd_copy_ioctl helper

2017-06-27 Thread Alexey Perevalov
Just for placing auxilary operations inside helper, auxilary operations like: track received pages, notify about copying operation in futher patches. Reviewed-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Alexey Perevalov --- migration/postcopy

[Qemu-devel] [PATCH v5 1/3] migration: postcopy_place_page factoring out

2017-06-27 Thread Alexey Perevalov
Need to mark copied pages as closer as possible to the place where it tracks down. That will be necessary in futher patch. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13

[Qemu-devel] [PATCH v5 3/3] migration: add bitmap for received page

2017-06-27 Thread Alexey Perevalov
ct page is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 10 ++ migration/migration.c| 1 + migration/postcopy-ram.c | 16 +++- migration/ram.c

Re: [Qemu-devel] Dual userfaultfd behavior

2017-04-10 Thread Alexey Perevalov
Hello, On 03/18/2017 02:27 AM, Mike Kravetz wrote: On 03/15/2017 06:47 AM, Alexey Perevalov wrote: Hi Andrea, thank you for so perfect design description, the main question who will do RFC patches, you or Mike or if you not against I could try. Sorry for not replying sooner, I have been

[Qemu-devel] [PATCH 0/6] calculate downtime for postcopy live migration

2017-04-14 Thread Alexey Perevalov
commit 372b3fe0b2ecdd39ba850e31c0c6686315c507af. It contains kernel side pages, just for convinience of applying current patch set, for testing util kernel headers arn't synced. Alexey Perevalov (6): userfault: add pid into uffd_msg & update UFFD_FEATURE_* util: introduce glib

[Qemu-devel] [PATCH 3/6] migration: add UFFD_FEATURE_THREAD_ID feature support

2017-04-14 Thread Alexey Perevalov
Userfaultfd mechanism is able to provide process thread id, in case when client request it with UFDD_API ioctl. Signed-off-by: Alexey Perevalov --- include/migration/postcopy-ram.h | 2 +- migration/migration.c| 2 +- migration/postcopy-ram.c | 12 ++-- migration

[Qemu-devel] [PATCH 1/6] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-04-14 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 5 + 1 file changed, 5 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/use

[Qemu-devel] [PATCH 2/6] util: introduce glib-helper.c

2017-04-14 Thread Alexey Perevalov
consolidation purpose. Signed-off-by: Alexey Perevalov --- hw/block/xen_disk.c| 10 +- include/glib-compat.h | 352 - include/glib/glib-compat.h | 352 + include/glib/glib-helper.h | 30 include

[Qemu-devel] [PATCH 4/6] migration: calculate downtime on dst side

2017-04-14 Thread Alexey Perevalov
comment to get_postcopy_total_downtime function. Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 14 +++ migration/migration.c | 280 +- migration/postcopy-ram.c | 24 +++- migration/qemu-file.c | 1 - migration

[Qemu-devel] [PATCH 5/6] migration: send postcopy downtime back to source

2017-04-14 Thread Alexey Perevalov
. For this purpose return path socket was shosen. Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 4 +++- migration/migration.c | 20 ++-- migration/postcopy-ram.c | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include

[Qemu-devel] [PATCH 6/6] migration: detailed traces for postcopy

2017-04-14 Thread Alexey Perevalov
It could help to track down vCPU state during page fault and page fault sources. This patch showes proc's status/stack/syscall file at the moment of pagefault, it's very interesting to know who was page fault initiator. Signed-off-by: Alexey Perevalov --- migration/postcopy-

Re: [Qemu-devel] [PATCH V6 02/10] migration: pass MigrationIncomingState* into migration check functions

2017-06-04 Thread Alexey Perevalov
On 05/31/2017 08:54 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by

Re: [Qemu-devel] [PATCH V6 06/10] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-06-04 Thread Alexey Perevalov
On 05/24/2017 06:31 AM, Peter Xu wrote: On Tue, May 23, 2017 at 02:31:07PM +0300, Alexey Perevalov wrote: This patch adds request to kernel space for UFFD_FEATURE_THREAD_ID, in case when this feature is provided by kernel. PostcopyBlocktimeContext is incapsulated inside postcopy-ram.c, due to

[Qemu-devel] [[PATCH V7] 00/11] calculate blocktime for postcopy live migration

2017-06-07 Thread Alexey Perevalov
sed on commit a0d4aac7467dd02e5657b79e867f067330266a24 of git://git.qemu-project.org/qemu.git Alexey Perevalov (11): userfault: add pid into uffd_msg & update UFFD_FEATURE_* migration: pass MigrationIncomingState* into migration check functions migration: fix hardcoded function name in error report migration: split ufd_v

[Qemu-devel] [[PATCH V7] 06/11] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-06-07 Thread Alexey Perevalov
uot;, \"state\": true } ] } }" | nc -U /var/lib/migrate-vm-monitor.sock Or just with HMP (qemu) migrate_set_capability postcopy-blocktime on Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 8 ++ migration/postcopy-ram.c | 65

[Qemu-devel] [[PATCH V7] 01/11] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-06-07 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 4 1 file changed, 4 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/use

[Qemu-devel] [[PATCH V7] 02/11] migration: pass MigrationIncomingState* into migration check functions

2017-06-07 Thread Alexey Perevalov
That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- migration/migration.c| 3 ++- migration/postcopy-ram.c | 10 +- migration

[Qemu-devel] [[PATCH V7] 03/11] migration: fix hardcoded function name in error report

2017-06-07 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 10d39a0..9963ce4 100644 --- a/migration/postcopy-ram.c +++ b/migration

[Qemu-devel] [[PATCH V7] 07/11] migration: add bitmap for copied page

2017-06-07 Thread Alexey Perevalov
is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Helpers are in migration/ram.c, due to in this file is allowing to work with RAMBlock. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 2 ++ migration/ram.c

[Qemu-devel] [[PATCH V7] 11/11] migration: postcopy_blocktime documentation

2017-06-07 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..4b625ca 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -402,6 +402,16

[Qemu-devel] [[PATCH V7] 04/11] migration: split ufd_version_check onto receive/request features part

2017-06-07 Thread Alexey Perevalov
ontext has internal state, and after first call of ioctl UFFD_API it changes its state to UFFD_STATE_RUNNING (in case of success), but kernel while handling ioctl UFFD_API expects UFFD_STATE_WAIT_API. So only one ioctl with UFFD_API is possible per ufd. Signed-off-by: Alexey Perevalov --- migratio

[Qemu-devel] [[PATCH V7] 08/11] migration: postcopy_place_page factoring out

2017-06-07 Thread Alexey Perevalov
Need to set copied bitmap as closer as possible to mark_postcopy_blocktime_end. So postcopy_place_page is proper place. RAMBlock argument here could avoid additional RAMBlock lookup as well as reduce number of arguments (no need to pass pointer to copied bitmap). Signed-off-by: Alexey Perevalov

[Qemu-devel] [[PATCH V7] 10/11] migration: add postcopy total blocktime into query-migrate

2017-06-07 Thread Alexey Perevalov
wback, it combines states of incoming and outgoing migration. Ongoing migration state will overwrite incoming state. Looks like better to separate query-migrate for incoming and outgoing migration or add parameter to indicate type of migration. Reviewed-by: Dr. David Alan Gi

[Qemu-devel] [[PATCH V7] 09/11] migration: calculate vCPU blocktime on dst side

2017-06-07 Thread Alexey Perevalov
page address as value and vCPU as index. It helps to find proper vCPU at UFFD_COPY time. Also it keeps list for blocktime per vCPU (could be traced with page_fault_addr) Blocktime will not calculated if postcopy_blocktime field of MigrationIncomingState wasn't initialized. Signed-off-by: A

Re: [Qemu-devel] [PATCH V6 08/10] migration: calculate vCPU blocktime on dst side

2017-06-07 Thread Alexey Perevalov
On 06/01/2017 01:57 PM, Dr. David Alan Gilbert wrote: * Alexey Perevalov (a.pereva...@samsung.com) wrote: This patch provides blocktime calculation per vCPU, as a summary and as a overlapped value for all vCPUs. This approach was suggested by Peter Xu, as an improvements of previous approch

[Qemu-devel] [[PATCH V7] 05/11] migration: introduce postcopy-blocktime capability

2017-06-07 Thread Alexey Perevalov
Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: A

Re: [Qemu-devel] [[PATCH V7] 09/11] migration: calculate vCPU blocktime on dst side

2017-06-07 Thread Alexey Perevalov
eated as a standalone patch. it's not bad to check every patch in sequence separately, but including previous patches ) Fam -- Best regards, Alexey Perevalov

[Qemu-devel] [PATCH v8 00/11] calculate blocktime for postcopy live migration

2017-06-07 Thread Alexey Perevalov
- It doesn't send back the downtime, just trace it This patch set is based on commit a0d4aac7467dd02e5657b79e867f067330266a24 of git://git.qemu-project.org/qemu.git Alexey Perevalov (11): userfault: add pid into uffd_msg & update UFFD_FEATURE_* migration: pass MigrationIncomingState*

[Qemu-devel] [PATCH v8 08/11] migration: postcopy_place_page factoring out

2017-06-07 Thread Alexey Perevalov
Need to mark paged copied as closer as possible place where it tracks down. That will be necessary in futher patch. Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13 - migration/postcopy-ram.h | 4 ++-- migration/ram.c | 4 ++-- 3 files changed, 12

[Qemu-devel] [PATCH v8 05/11] migration: introduce postcopy-blocktime capability

2017-06-07 Thread Alexey Perevalov
Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: A

[Qemu-devel] [PATCH v8 06/11] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-06-07 Thread Alexey Perevalov
uot;, \"state\": true } ] } }" | nc -U /var/lib/migrate-vm-monitor.sock Or just with HMP (qemu) migrate_set_capability postcopy-blocktime on Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 8 ++ migration/postcopy-ram.c | 65

[Qemu-devel] [PATCH v8 09/11] migration: calculate vCPU blocktime on dst side

2017-06-07 Thread Alexey Perevalov
page address as value and vCPU as index. It helps to find proper vCPU at UFFD_COPY time. Also it keeps list for blocktime per vCPU (could be traced with page_fault_addr) Blocktime will not calculated if postcopy_blocktime field of MigrationIncomingState wasn't initialized. Signed-off-by: A

[Qemu-devel] [PATCH v8 01/11] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-06-07 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 4 1 file changed, 4 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/use

[Qemu-devel] [PATCH v8 03/11] migration: fix hardcoded function name in error report

2017-06-07 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 10d39a0..8838901 100644 --- a/migration/postcopy-ram.c +++ b/migration

[Qemu-devel] [PATCH v8 07/11] migration: add bitmap for copied page

2017-06-07 Thread Alexey Perevalov
is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Helpers are in migration/ram.c, due to in this file is allowing to work with RAMBlock. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 2 ++ migration/ram.c

[Qemu-devel] [PATCH v8 10/11] migration: add postcopy total blocktime into query-migrate

2017-06-07 Thread Alexey Perevalov
wback, it combines states of incoming and outgoing migration. Ongoing migration state will overwrite incoming state. Looks like better to separate query-migrate for incoming and outgoing migration or add parameter to indicate type of migration. Reviewed-by: Dr. David Alan Gi

[Qemu-devel] [PATCH v8 04/11] migration: split ufd_version_check onto receive/request features part

2017-06-07 Thread Alexey Perevalov
ontext has internal state, and after first call of ioctl UFFD_API it changes its state to UFFD_STATE_RUNNING (in case of success), but kernel while handling ioctl UFFD_API expects UFFD_STATE_WAIT_API. So only one ioctl with UFFD_API is possible per ufd. Signed-off-by: Alexey Perevalov --- migratio

[Qemu-devel] [PATCH v8 11/11] migration: postcopy_blocktime documentation

2017-06-07 Thread Alexey Perevalov
Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..4b625ca 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -402,6 +402,16

[Qemu-devel] [PATCH v8 02/11] migration: pass MigrationIncomingState* into migration check functions

2017-06-07 Thread Alexey Perevalov
That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- migration/migration.c| 3 ++- migration/postcopy-ram.c | 10 +- migration

Re: [Qemu-devel] [PATCH v8 06/11] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-06-07 Thread Alexey Perevalov
On 06/07/2017 03:43 PM, Juan Quintela wrote: Alexey Perevalov wrote: This patch adds request to kernel space for UFFD_FEATURE_THREAD_ID, in case when this feature is provided by kernel. I think this function is wrong migration_exit_cb will be called at QEMU exit, but see later +static

Re: [Qemu-devel] [PATCH v8 11/11] migration: postcopy_blocktime documentation

2017-06-07 Thread Alexey Perevalov
On 06/07/2017 03:52 PM, Juan Quintela wrote: Alexey Perevalov wrote: Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..4b625ca

Re: [Qemu-devel] [PATCH v8 07/11] migration: add bitmap for copied page

2017-06-07 Thread Alexey Perevalov
On 06/07/2017 12:46 PM, Alexey Perevalov wrote: This patch adds ability to track down already copied pages, it's necessary for calculation vCPU block time in postcopy migration feature, maybe for restore after postcopy migration failure. Also it's necessary to solve shared memor

Re: [Qemu-devel] [PATCH v8 07/11] migration: add bitmap for copied page

2017-06-07 Thread Alexey Perevalov
On 06/07/2017 03:56 PM, Juan Quintela wrote: Alexey Perevalov wrote: +static unsigned long get_copiedmap_size(RAMBlock *rb) +{ +unsigned long pages; +pages = rb->max_length >> find_first_bit((unsigned long *)&rb->page_size, +

Re: [Qemu-devel] [PATCH v8 02/11] migration: pass MigrationIncomingState* into migration check functions

2017-06-08 Thread Alexey Perevalov
On 06/09/2017 07:10 AM, Peter Xu wrote: On Wed, Jun 07, 2017 at 12:46:29PM +0300, Alexey Perevalov wrote: That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by

Re: [Qemu-devel] [PATCH v8 07/11] migration: add bitmap for copied page

2017-06-09 Thread Alexey Perevalov
On 06/09/2017 09:06 AM, Peter Xu wrote: On Wed, Jun 07, 2017 at 05:13:00PM +0300, Alexey Perevalov wrote: On 06/07/2017 12:46 PM, Alexey Perevalov wrote: This patch adds ability to track down already copied pages, it's necessary for calculation vCPU block time in postcopy migration fe

Re: [Qemu-devel] [PATCH v8 02/11] migration: pass MigrationIncomingState* into migration check functions

2017-06-09 Thread Alexey Perevalov
On 06/09/2017 10:14 AM, Peter Xu wrote: On Fri, Jun 09, 2017 at 09:21:38AM +0300, Alexey Perevalov wrote: On 06/09/2017 07:10 AM, Peter Xu wrote: On Wed, Jun 07, 2017 at 12:46:29PM +0300, Alexey Perevalov wrote: That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while

Re: [Qemu-devel] [PATCH v8 07/11] migration: add bitmap for copied page

2017-06-12 Thread Alexey Perevalov
On 06/13/2017 08:59 AM, Peter Xu wrote: On Wed, Jun 07, 2017 at 12:46:34PM +0300, Alexey Perevalov wrote: This patch adds ability to track down already copied pages, it's necessary for calculation vCPU block time in postcopy migration feature, maybe for restore after postcopy migration fa

[Qemu-devel] [PATCH v1 0/2] Add bitmap for copied pages in postcopy migration

2017-06-13 Thread Alexey Perevalov
functions are required in virtio. Alexey Perevalov (2): migration: postcopy_place_page factoring out migration: add bitmap for copied page include/exec/ram_addr.h | 3 +++ include/migration/migration.h | 3 +++ migration/postcopy-ram.c | 20 +++ migration/postcopy-ram.h

[Qemu-devel] [PATCH v1 2/2] migration: add bitmap for copied page

2017-06-13 Thread Alexey Perevalov
is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. copied bitmap is not releasing due to ramblocks is not releasing too. Signed-off-by: Alexey Perevalov --- include/exec/ram_addr.h | 3 +++ include/migration/migration.h | 3 +++ migratio

[Qemu-devel] [PATCH v1 1/2] migration: postcopy_place_page factoring out

2017-06-13 Thread Alexey Perevalov
Need to mark copied pages as closer as possible to the place where it tracks down. That will be necessary in futher patch. Reviewed-by: Juan Quintela Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 13 - migration/postcopy-ram.h | 4 ++-- migration/ram.c

Re: [Qemu-devel] [PATCH v1 2/2] migration: add bitmap for copied page

2017-06-13 Thread Alexey Perevalov
On 06/13/2017 02:42 PM, Juan Quintela wrote: Alexey Perevalov wrote: Hi I think that it would make things clearer if we do a s/copied/received/ As what we are tracking here are the pages that have already been received. yes, sounds good This patch adds ability to track down already

[Qemu-devel] [PATCH V4 9/9] migration: postcopy_blocktime documentation

2017-05-12 Thread Alexey Perevalov
Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..d0f5a6d 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -402,6 +402,16 @@ will now cause the transition from

[Qemu-devel] [PATCH V4 5/9] migration: introduce postcopy-blocktime capability

2017-05-12 Thread Alexey Perevalov
Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Signed-off-by: Alexey Perevalov --- include/migr

[Qemu-devel] [PATCH V4 6/9] migration: add postcopy vcpu blocktime context into MigrationIncomingState

2017-05-12 Thread Alexey Perevalov
control it [root@host]#printf "{\"execute\" : \"qmp_capabilities\"}\r\n \ {\"execute\": \"migrate-set-capabilities\" , \"arguments\": { \"capabilities\": [ { \"capability\": \"postcopy-blocktime\", \&q

[Qemu-devel] [PATCH V4 8/9] migration: add postcopy total blocktime into query-migrate

2017-05-12 Thread Alexey Perevalov
"status": "completed", "postcopy_blocktime": 100 }} postcopy_vcpu_blocktime contains list, where the first item is the first vCPU in QEMU. Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 4 +++ migration/migration.c | 47 +++

[Qemu-devel] [PATCH V4 7/9] migration: calculate vCPU blocktime on dst side

2017-05-12 Thread Alexey Perevalov
s under linux ifdef. Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 87 +++- migration/trace-events | 5 ++- 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index fd5a

[Qemu-devel] [PATCH V4 3/9] migration: fix hardcoded function name in error report

2017-05-12 Thread Alexey Perevalov
Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index fbccc53..b6eccaf 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -67,7 +67,7

[Qemu-devel] [PATCH V4 2/9] migration: pass ptr to MigrationIncomingState into migration ufd_version_check & postcopy_ram_supported_by_host

2017-05-12 Thread Alexey Perevalov
That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- migration/migration.c| 2 +- migration/postcopy-ram.c | 10 +- migration

[Qemu-devel] [PATCH V4 1/9] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-05-12 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 5 + 1 file changed, 5 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/use

[Qemu-devel] [PATCH V4 0/9] calculate blocktime for postcopy live migration

2017-05-12 Thread Alexey Perevalov
y-ram.h movement. It contains patch for kernel header, just for convinience of applying current patch set, for testing until kernel headers arn't synced. At the moment of posting this patch set, "userfaultfd: provide pid in userfault msg" wasn't yet merged into upstream.

[Qemu-devel] [PATCH V4 4/9] migration: split ufd_version_check onto receive/request features part

2017-05-12 Thread Alexey Perevalov
ontext has internal state, and after first call of ioctl UFFD_API it changes its state to UFFD_STATE_RUNNING (in case of success), but kernel while handling ioctl UFFD_API expects UFFD_STATE_WAIT_API. So only one ioctl with UFFD_API is possible per ufd. Signed-off-by: Alexey Perevalov --- migratio

[Qemu-devel] [PATCH V5 5/9] migration: introduce postcopy-blocktime capability

2017-05-12 Thread Alexey Perevalov
Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Signed-off-by: Alexey Perevalov --- include/migr

[Qemu-devel] [PATCH V5 9/9] migration: postcopy_blocktime documentation

2017-05-12 Thread Alexey Perevalov
Signed-off-by: Alexey Perevalov --- docs/migration.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 1b940a8..d0f5a6d 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -402,6 +402,16 @@ will now cause the transition from

[Qemu-devel] [PATCH V5 7/9] migration: calculate vCPU blocktime on dst side

2017-05-12 Thread Alexey Perevalov
page address as value and vCPU as index. It helps to find proper vCPU at UFFD_COPY time. Also it keeps list for blocktime per vCPU (could be traced with page_fault_addr) Blocktime will not calculated if postcopy_blocktime field of MigrationIncomingState wasn't initialized. Signed-off-by: A

[Qemu-devel] [PATCH V5 0/9] calculate blocktime for postcopy live migration

2017-05-12 Thread Alexey Perevalov
ced. At the moment of posting this patch set, "userfaultfd: provide pid in userfault msg" wasn't yet merged into upstream. Alexey Perevalov (9): userfault: add pid into uffd_msg & update UFFD_FEATURE_* migration: pass ptr to MigrationIncomingState into migration ufd_

[Qemu-devel] [PATCH V5 3/9] migration: fix hardcoded function name in error report

2017-05-12 Thread Alexey Perevalov
Signed-off-by: Alexey Perevalov --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 4c859b4..0f75700 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -68,7 +68,7

[Qemu-devel] [PATCH V5 8/9] migration: add postcopy total blocktime into query-migrate

2017-05-12 Thread Alexey Perevalov
"status": "completed", "postcopy_blocktime": 100 }} postcopy_vcpu_blocktime contains list, where the first item is the first vCPU in QEMU. Signed-off-by: Alexey Perevalov --- include/migration/migration.h | 4 +++ migration/migration.c | 47 +

[Qemu-devel] [PATCH V5 6/9] migration: add postcopy vcpu blocktime context into MigrationIncomingState

2017-05-12 Thread Alexey Perevalov
control it [root@host]#printf "{\"execute\" : \"qmp_capabilities\"}\r\n \ {\"execute\": \"migrate-set-capabilities\" , \"arguments\": { \"capabilities\": [ { \"capability\": \"postcopy-blocktime\", \&q

[Qemu-devel] [PATCH V5 2/9] migration: pass ptr to MigrationIncomingState into migration ufd_version_check & postcopy_ram_supported_by_host

2017-05-12 Thread Alexey Perevalov
That tiny refactoring is necessary to be able to set UFFD_FEATURE_THREAD_ID while requesting features, and then to create downtime context in case when kernel supports it. Signed-off-by: Alexey Perevalov --- include/migration/postcopy-ram.h | 2 +- migration/migration.c| 2

[Qemu-devel] [PATCH V5 1/9] userfault: add pid into uffd_msg & update UFFD_FEATURE_*

2017-05-12 Thread Alexey Perevalov
This commit duplicates header of "userfaultfd: provide pid in userfault msg" into linux kernel. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 5 + 1 file changed, 5 insertions(+) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/use

  1   2   3   >