Re: [PATCH] migration/postcopy: not necessary to discard all RAM at the beginning

2020-02-13 Thread Wei Yang
On Thu, Feb 13, 2020 at 10:17:04AM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> ram_discard_range() unmap page for specific range. To be specific, this >> clears related page table entries so that userfault would be triggered. &

Re: [PATCH] migration/postcopy: not necessary to discard all RAM at the beginning

2020-01-30 Thread Wei Yang
Hi, David and Juan Does it look good to you? On Mon, Oct 07, 2019 at 05:10:08PM +0800, Wei Yang wrote: >ram_discard_range() unmap page for specific range. To be specific, this >clears related page table entries so that userfault would be triggered. >But this step is not necessary at

Re: [PATCH] migration/postcopy: not necessary to discard all RAM at the beginning

2020-01-12 Thread Wei Yang
Oops, this one seems to be missed. On Mon, Oct 07, 2019 at 05:10:08PM +0800, Wei Yang wrote: >ram_discard_range() unmap page for specific range. To be specific, this >clears related page table entries so that userfault would be triggered. >But this step is not necessary at the very

Re: [PATCH 0/2] not use multifd during postcopy

2020-01-09 Thread Wei Yang
On Thu, Jan 09, 2020 at 10:50:25AM +0100, Juan Quintela wrote: >Wei Yang wrote: >> On Mon, Dec 16, 2019 at 10:35:39AM +0800, Wei Yang wrote: >>>Would this one be picked up this time? >> >> Happy new year to all. >> >> Can I ask the plan for this patch

Re: [Patch v2 0/6] migration/postcopy: enable compress during postcopy

2020-01-05 Thread Wei Yang
On Wed, Dec 18, 2019 at 07:55:38PM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Would this one be picked up in this version? > >I think that one is on Juan's list for the pull he's going to do soon. > >Dave > Happy New Year to

Re: [PATCH 0/2] not use multifd during postcopy

2020-01-05 Thread Wei Yang
On Mon, Dec 16, 2019 at 10:35:39AM +0800, Wei Yang wrote: >Would this one be picked up this time? Happy new year to all. Can I ask the plan for this patch set? > >On Sat, Oct 26, 2019 at 07:19:58AM +0800, Wei Yang wrote: >>We don't support multifd during postcopy, but user sti

Re: [PATCH v2 0/6] migration/multifd: a new mechanism for send thread sync

2019-12-15 Thread Wei Yang
Ping for comment. On Sat, Oct 26, 2019 at 08:45:14AM +0800, Wei Yang wrote: >Current send thread could work while the sync mechanism has some problem: > > * has spuriously wakeup > * number of channels_ready will *overflow* the number of real channels &

Re: [PATCH 0/2] not use multifd during postcopy

2019-12-15 Thread Wei Yang
Would this one be picked up this time? On Sat, Oct 26, 2019 at 07:19:58AM +0800, Wei Yang wrote: >We don't support multifd during postcopy, but user still could enable >both multifd and postcopy. This leads to migration failure. > >Patch 1 does proper cleanup, otherwise we m

Re: [Patch v2 0/6] migration/postcopy: enable compress during postcopy

2019-12-15 Thread Wei Yang
Would this one be picked up in this version? On Thu, Nov 07, 2019 at 08:39:01PM +0800, Wei Yang wrote: >This patch set tries enable compress during postcopy. > >postcopy requires to place a whole host page, while migration thread migrate >memory in target page size. This makes p

Re: [PATCH v2 1/6] migration/multifd: move Params update and pages cleanup into multifd_send_fill_packet()

2019-11-29 Thread Wei Yang
On Tue, Nov 19, 2019 at 11:57:22AM +0100, Juan Quintela wrote: >Wei Yang wrote: >> Fill data and update/cleanup related field in one place. Also make the >> code a little clean. >> >> Signed-off-by: Wei Yang > >Reviewed-by: Juan Quintela > >right cleanup.

Re: [PATCH 2/2] migration/multifd: not use multifd during postcopy

2019-11-19 Thread Wei Yang
On Tue, Nov 19, 2019 at 11:55:52AM +0100, Juan Quintela wrote: >Wei Yang wrote: >> We don't support multifd during postcopy, but user still could enable >> both multifd and postcopy. This leads to migration failure. >> >> Skip multifd during postcopy. >> >&g

Re: [PATCH 0/2] not use multifd during postcopy

2019-11-17 Thread Wei Yang
Ping for comments. On Sat, Oct 26, 2019 at 07:19:58AM +0800, Wei Yang wrote: >We don't support multifd during postcopy, but user still could enable >both multifd and postcopy. This leads to migration failure. > >Patch 1 does proper cleanup, otherwise we may have data corruption. &

Re: [PATCH 1/2] tests/tcg/multiarch: fix code style in function main of test-mmap.c

2019-11-11 Thread Wei Yang
On Mon, Nov 11, 2019 at 10:25:43AM +, Alex Benn??e wrote: > >Wei Yang writes: > >> This file uses quite a different code style and changing just one line >> would leads to some awkward appearance. >> >> This is a preparation for the following replacement of &g

Re: [PATCH 2/2] core: replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-11-11 Thread Wei Yang
t; is better :-) >On Tue, Oct 15, 2019 at 11:13:50AM +0800, Wei Yang wrote: >> Signed-off-by: Wei Yang >> Suggested-by: "Dr. David Alan Gilbert" >> CC: Richard Henderson >> --- >> block/file-posix.c | 2 +- >> net/l2tpv3.c

Re: [PATCH 0/2] replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-11-08 Thread Wei Yang
On Tue, Oct 15, 2019 at 11:13:48AM +0800, Wei Yang wrote: >This is a following up patch to cleanup page size, suggested by >"Dr. David Alan Gilbert" . > >Patch 2 does the job, while during the cleanup I found test-mmap.c has quite a >lot code style problem. To make the

Re: [Patch v2 5/6] migration/postcopy: enable random order target page arrival

2019-11-07 Thread Wei Yang
On Thu, Nov 07, 2019 at 02:30:25PM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> After using number of target page received to track one host page, we >> could have the capability to handle random order target page arrival in &

[Patch v2 6/6] migration/postcopy: enable compress during postcopy

2019-11-07 Thread Wei Yang
thread for before placing host page Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 11 --- migration/ram.c | 28 +++- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration

[Patch v2 5/6] migration/postcopy: enable random order target page arrival

2019-11-07 Thread Wei Yang
After using number of target page received to track one host page, we could have the capability to handle random order target page arrival in one host page. This is a preparation for enabling compress during postcopy. Signed-off-by: Wei Yang --- v2: * use uintptr_t to calculate place_dest

[Patch v2 2/6] migration/postcopy: wait for decompress thread in precopy

2019-11-07 Thread Wei Yang
Compress is not supported with postcopy, it is safe to wait for decompress thread just in precopy. This is a preparation for later patch. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[Patch v2 4/6] migration/postcopy: set all_zero to true on the first target page

2019-11-07 Thread Wei Yang
For the first target page, all_zero is set to true for this round check. After target_pages introduced, we could leverage this variable instead of checking the address offset. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 insertion

[Patch v2 1/6] migration/postcopy: reduce memset when it is zero page and matches_target_page_size

2019-11-07 Thread Wei Yang
In this case, page_buffer content would not be used. Skip this to save some time. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 99a98b2da4

[Patch v2 0/6] migration/postcopy: enable compress during postcopy

2019-11-07 Thread Wei Yang
pages belongs to the same host page Wei Yang (6): migration/postcopy: reduce memset when it is zero page and matches_target_page_size migration/postcopy: wait for decompress thread in precopy migration/postcopy: count target page number to decide the place_needed migration/postcopy

[Patch v2 3/6] migration/postcopy: count target page number to decide the place_needed

2019-11-07 Thread Wei Yang
), this means it is the last target page in the host page. This is a preparation for non-ordered target page transmission. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/migration/ram.c

Re: [PATCH 1/2] migration/compress: compress QEMUFile is not writable

2019-11-07 Thread Wei Yang
On Thu, Nov 07, 2019 at 11:59:10AM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> We open a file with empty_ops for compress QEMUFile, which means this is >> not writable. > >That explanation sounds reasonable; but I'm co

Re: [PATCH 0/6] migration/postcopy: enable compress during postcopy

2019-11-07 Thread Wei Yang
On Thu, Nov 07, 2019 at 09:15:44AM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Wed, Nov 06, 2019 at 08:11:44PM +, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> This p

Re: [PATCH 0/6] migration/postcopy: enable compress during postcopy

2019-11-06 Thread Wei Yang
On Wed, Nov 06, 2019 at 08:11:44PM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> This patch set tries enable compress during postcopy. >> >> postcopy requires to place a whole host page, while migration thread migrate >>

Re: [PATCH 5/6] migration/postcopy: enable random order target page arrival

2019-11-06 Thread Wei Yang
On Wed, Nov 06, 2019 at 08:08:28PM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> After using number of target page received to track one host page, we >> could have the capability to handle random order target page arrival in &

[PATCH] target/i386: return directly from hyperv_init_vcpu() if hyperv not enabled

2019-10-31 Thread Wei Yang
If hyperv is not enabled, related features are not set or enabled. No extra work to do, return directly. --- First time touch hyperv, hope my understanding is correct. Signed-off-by: Wei Yang --- target/i386/kvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/kvm.c b

Re: [Qemu-devel] [PATCH] migration: check length directly to make sure the range is aligned

2019-10-29 Thread Wei Yang
On Tue, Oct 29, 2019 at 07:04:19AM +, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Fri, Jul 19, 2019 at 07:06:51PM +0100, Dr. David Alan Gilbert wrote: >> >* Paolo Bonzini (pbonz...@redhat.com) wrote: >> >> On 19/07/19

Re: [Qemu-devel] [PATCH] migration: check length directly to make sure the range is aligned

2019-10-27 Thread Wei Yang
aligned start address: %p", >> host_startaddr); >> goto err; >> } >> >> just before this context. >> >> Paolo >-- >Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK -- Wei Yang Help you, Help me

[PATCH v2 4/6] migration/multifd: used must not be 0 for a pending job

2019-10-25 Thread Wei Yang
After thread synchronization request is handled in another case, this means when we only get pending_job when there is used pages. Signed-off-by: Wei Yang --- migration/ram.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index

[PATCH v2 1/6] migration/multifd: move Params update and pages cleanup into multifd_send_fill_packet()

2019-10-25 Thread Wei Yang
Fill data and update/cleanup related field in one place. Also make the code a little clean. Signed-off-by: Wei Yang --- migration/ram.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 5876054195..35f147388b 100644

[PATCH v2 0/6] migration/multifd: a new mechanism for send thread sync

2019-10-25 Thread Wei Yang
. --- v2: rebase on latest code Wei Yang (6): migration/multifd: move Params update and pages cleanup into multifd_send_fill_packet() migration/multifd: notify channels_ready when send thread starts migration/multifd: use sync field to synchronize send threads migration/multifd: used must

[PATCH v2 6/6] migration/multifd: there is no spurious wakeup now

2019-10-25 Thread Wei Yang
The spurious wakeup is gone. Signed-off-by: Wei Yang --- migration/ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index fccdbfabc5..73ace40b1b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1168,8 +1168,8 @@ static void

[PATCH v2 5/6] migration/multifd: use boolean for pending_job is enough

2019-10-25 Thread Wei Yang
After synchronization request is handled in another case, there only could be one pending_job for one send thread at most. This is fine to use boolean to represent this behavior. Signed-off-by: Wei Yang --- migration/ram.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

[PATCH v2 2/6] migration/multifd: notify channels_ready when send thread starts

2019-10-25 Thread Wei Yang
uce some unpredictable situation and disturb the semaphore value. This is a preparation patch to use another mechanism to do send thread synchronization to avoid post channels_ready in this case. So this patch posts channels_ready when send threads start running. Signed-off-by: Wei Y

[PATCH v2 3/6] migration/multifd: use sync field to synchronize send threads

2019-10-25 Thread Wei Yang
Add a field in MultiFDSendParams to indicate there is a request to synchronize send threads. By doing so, send_thread will just post sem_sync on synchronization request and channels_ready will not *overflow*. Signed-off-by: Wei Yang --- migration/ram.c | 30 -- 1

[PATCH 1/2] migration/multifd: clean pages after filling packet

2019-10-25 Thread Wei Yang
will continue to be transferred. After clean pages, migration succeeds. Signed-off-by: Wei Yang --- migration/ram.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 80dd2d55f9..7087bb73ed 100644 --- a/migration/ram.c +++ b/migration/ram.c

[PATCH 0/2] not use multifd during postcopy

2019-10-25 Thread Wei Yang
another patch set. Wei Yang (2): migration/multifd: clean pages after filling packet migration/multifd: not use multifd during postcopy migration/ram.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.17.1

[PATCH 2/2] migration/multifd: not use multifd during postcopy

2019-10-25 Thread Wei Yang
We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure. Skip multifd during postcopy. Signed-off-by: Wei Yang --- migration/ram.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/migration

Re: [PATCH 0/6] migration/postcopy: enable compress during postcopy

2019-10-18 Thread Wei Yang
rectory `/var/tmp/patchew-tester-tmp-dh8p6f27/src' >make: *** [docker-run-test-mingw@fedora] Error 2 > >real2m45.691s >user0m8.390s > > >The full log is available at >http://patchew.org/logs/20191018004850.9888-1-richardw.y...@linux.intel.com/testing.docker-mingw@fedora/?type=message. >--- >Email generated automatically by Patchew [https://patchew.org/]. >Please send your feedback to patchew-de...@redhat.com -- Wei Yang Help you, Help me

[PATCH 5/6] migration/postcopy: enable random order target page arrival

2019-10-17 Thread Wei Yang
After using number of target page received to track one host page, we could have the capability to handle random order target page arrival in one host page. This is a preparation for enabling compress during postcopy. Signed-off-by: Wei Yang --- migration/ram.c | 16 +++- 1 file

[PATCH 6/6] migration/postcopy: enable compress during postcopy

2019-10-17 Thread Wei Yang
thread for before placing host page Signed-off-by: Wei Yang --- migration/migration.c | 11 --- migration/ram.c | 28 +++- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 3febd0f8f3

[PATCH 3/6] migration/postcopy: count target page number to decide the place_needed

2019-10-17 Thread Wei Yang
), this means it is the last target page in the host page. This is a preparation for non-ordered target page transmission. Signed-off-by: Wei Yang --- migration/ram.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index f59e3fe197

[PATCH 0/6] migration/postcopy: enable compress during postcopy

2019-10-17 Thread Wei Yang
. The second one is handled by: 1. Flush compress thread for each host page 2. Wait for decompress thread for before placing host page With the combination of these two changes, compress is enabled during postcopy. Wei Yang (6): migration/postcopy: reduce memset when it is zero page

[PATCH 1/6] migration/postcopy: reduce memset when it is zero page and matches_target_page_size

2019-10-17 Thread Wei Yang
In this case, page_buffer content would not be used. Skip this to save some time. Signed-off-by: Wei Yang --- migration/ram.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 99a98b2da4..7938a643d9 100644 --- a/migration/ram.c

[PATCH 2/6] migration/postcopy: wait for decompress thread in precopy

2019-10-17 Thread Wei Yang
Compress is not supported with postcopy, it is safe to wait for decompress thread just in precopy. This is a preparation for later patch. Signed-off-by: Wei Yang --- migration/ram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index

[PATCH 4/6] migration/postcopy: set all_zero to true on the first target page

2019-10-17 Thread Wei Yang
For the first target page, all_zero is set to true for this round check. After target_pages introduced, we could leverage this variable instead of checking the address offset. Signed-off-by: Wei Yang --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Patch v2] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)

2019-10-16 Thread Wei Yang
Signed-off-by: Wei Yang CC: Richard Henderson CC: Stefan Hajnoczi --- v2: add "\b" for better match, suggested by Richard Henderson --- scripts/checkpatch.pl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index aa9a354a0e..

Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)

2019-10-16 Thread Wei Yang
On Wed, Oct 16, 2019 at 07:48:50PM +0100, Stefan Hajnoczi wrote: >On Wed, Oct 16, 2019 at 09:24:32AM +0800, Wei Yang wrote: >> Signed-off-by: Wei Yang >> CC: David Gibson >> --- >> scripts/checkpatch.pl | 6 ++ >> 1 file changed, 6 insertions(+) >>

Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)

2019-10-16 Thread Wei Yang
On Wed, Oct 16, 2019 at 08:43:32AM -0700, Richard Henderson wrote: >On 10/15/19 6:24 PM, Wei Yang wrote: >> if ($line =~ /\bbzero\(/) { >> ERROR("use memset() instead of bzero()\n" . $herecurr); >> } >> +

Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)

2019-10-16 Thread Wei Yang
real_host_page_size instead of >getpagesize()\n" . $herecurr); > Since this is an error message and I see other similar code keep it in the same line, I didn't split it into two lines. If necessary, I would split it. -- Wei Yang Help you, Help me

Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-15 Thread Wei Yang
On Sun, Oct 13, 2019 at 08:28:41PM +1100, David Gibson wrote: >On Sun, Oct 13, 2019 at 10:11:45AM +0800, Wei Yang wrote: >> There are three page size in qemu: >> >> real host page size >> host page size >> target page size >> >> All of them have

[PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)

2019-10-15 Thread Wei Yang
Signed-off-by: Wei Yang CC: David Gibson --- scripts/checkpatch.pl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index aa9a354a0e..4b360ed310 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2915,6 +2915,12 @@ sub

Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-15 Thread Wei Yang
On Tue, Oct 15, 2019 at 02:45:15PM +0300, Yuval Shaia wrote: >On Sun, Oct 13, 2019 at 10:11:45AM +0800, Wei Yang wrote: >> There are three page size in qemu: >> >> real host page size >> host page size >> target page size >> >> All of them have

[PATCH 1/2] tests/tcg/multiarch: fix code style in function main of test-mmap.c

2019-10-14 Thread Wei Yang
-off-by: Wei Yang --- tests/tcg/multiarch/test-mmap.c | 67 ++--- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/tests/tcg/multiarch/test-mmap.c b/tests/tcg/multiarch/test-mmap.c index 11d0e777b1..9ea49e2307 100644 --- a/tests/tcg/multiarch/test-mmap.c

[PATCH 2/2] core: replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-10-14 Thread Wei Yang
Signed-off-by: Wei Yang Suggested-by: "Dr. David Alan Gilbert" CC: Richard Henderson --- block/file-posix.c | 2 +- net/l2tpv3.c| 2 +- tests/tcg/multiarch/test-mmap.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/file

[PATCH 0/2] replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-10-14 Thread Wei Yang
This is a following up patch to cleanup page size, suggested by "Dr. David Alan Gilbert" . Patch 2 does the job, while during the cleanup I found test-mmap.c has quite a lot code style problem. To make the code looks good, patch 1 is introduced to make checkpatch.pl happy a little. W

Re: [Qemu-devel] [PATCH v2 0/2] refine memory_device_get_free_addr

2019-10-14 Thread Wei Yang
On Mon, Oct 14, 2019 at 12:05:47PM -0300, Eduardo Habkost wrote: >On Sat, Oct 12, 2019 at 05:02:09PM +0800, Wei Yang wrote: >> On Sat, Sep 14, 2019 at 03:40:41PM -0400, Michael S. Tsirkin wrote: >> >On Fri, Sep 13, 2019 at 11:47:46PM +, Wei Yang wrote: >> >> On T

Re: [PATCH 0/2] cleanup on page size

2019-10-14 Thread Wei Yang
2bed5d Author: bellard Date: Tue May 13 00:25:15 2003 + mmap emulation git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@158 c046a42c-6fe2-441c-8c8c-71466251a162 There is no reason logged. On Sun, Oct 13, 2019 at 10:11:43AM +0800, Wei Yang wrote: &g

Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-14 Thread Wei Yang
On Mon, Oct 14, 2019 at 10:15:02AM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> There are three page size in qemu: >> >> real host page size >> host page size >> target page size >> >> Al

Re: [PATCH 1/2] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN

2019-10-13 Thread Wei Yang
On Sun, Oct 13, 2019 at 07:38:04PM -0700, Richard Henderson wrote: >On 10/13/19 6:01 PM, Wei Yang wrote: >>> No, please. >>> >>> (1) The compiler does not know that qemu_*host_page_size is a power of 2, >>> and >>> will genera

Re: [PATCH 1/2] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN

2019-10-13 Thread Wei Yang
On Sun, Oct 13, 2019 at 11:56:35AM -0400, Richard Henderson wrote: >On 10/12/19 10:11 PM, Wei Yang wrote: >> Use ROUND_UP() to define, which is a little bit easy to read. >> >> Signed-off-by: Wei Yang >> --- >> include/exec/cpu-all.h | 7 +++ >> 1 fil

[PATCH 1/2] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN

2019-10-12 Thread Wei Yang
Use ROUND_UP() to define, which is a little bit easy to read. Signed-off-by: Wei Yang --- include/exec/cpu-all.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index ad9ab85eb3..255bb186ac 100644 --- a/include/exec/cpu

[PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-12 Thread Wei Yang
(). qemu_real_host_page_size is defined to be a replacement of getpagesize(), so let it serve the role. [Note] Not fully tested for some arch or device. Signed-off-by: Wei Yang --- accel/kvm/kvm-all.c| 6 +++--- backends/hostmem.c | 2 +- block.c| 4

[PATCH 0/2] cleanup on page size

2019-10-12 Thread Wei Yang
Patch 1 simplify the definition of xxx_PAGE_ALIGN. Patch 2 replaces getpagesize() with qemu_real_host_page_size. This one touch a volume of code. If some point is not correct, I'd appreciate your notification. Wei Yang (2): cpu: use ROUND_UP() to define xxx_PAGE_ALIGN core: replace

Re: [Qemu-devel] [PATCH v2 0/2] refine memory_device_get_free_addr

2019-10-12 Thread Wei Yang
On Sat, Sep 14, 2019 at 03:40:41PM -0400, Michael S. Tsirkin wrote: >On Fri, Sep 13, 2019 at 11:47:46PM +0000, Wei Yang wrote: >> On Tue, Jul 30, 2019 at 08:37:38AM +0800, Wei Yang wrote: >> >When we iterate the memory-device list to get the available range, it is not >&g

[PATCH 2/2] migration/compress: disable compress if failed to setup

2019-10-11 Thread Wei Yang
In current logic, if compress_threads_save_setup() returns -1 the whole migration would fail, while we could handle it gracefully by disable compress. Signed-off-by: Wei Yang --- migration/migration.c | 9 + migration/migration.h | 1 + migration/ram.c | 15 --- 3

[PATCH 0/2] migration/compress: refine the compress case

2019-10-11 Thread Wei Yang
Two patches related to compress: 1. simplify the check since compress QEMUFile is not writable 2. handle compress setup failure gracefully Wei Yang (2): migration/compress: compress QEMUFile is not writable migration/compress: disable compress if failed to setup migration/migration.c | 9

[PATCH 1/2] migration/compress: compress QEMUFile is not writable

2019-10-11 Thread Wei Yang
We open a file with empty_ops for compress QEMUFile, which means this is not writable. Signed-off-by: Wei Yang --- migration/qemu-file.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 26fb25ddc1

Re: [PATCH 3/4] migration/multifd: initialize packet->magic/version once at setup stage

2019-10-11 Thread Wei Yang
On Fri, Oct 11, 2019 at 12:20:48PM +0200, Juan Quintela wrote: >Wei Yang wrote: >> MultiFDPacket_t's magic and version field never changes during >> migration, so move these two fields in setup stage. >> >> Signed-off-by: Wei Yang > >Reviewed-by: Juan Qu

Re: [PULL 5/5] multifd: Use number of channels as listen backlog

2019-10-11 Thread Wei Yang
On Fri, Oct 11, 2019 at 12:40:03PM +0200, Juan Quintela wrote: >Wei Yang wrote: >> On Wed, Sep 04, 2019 at 08:29:15AM +0200, Juan Quintela wrote: >>>Reviewed-by: Daniel P. Berrang?? >>>Signed-off-by: Juan Quintela >>>--- >>> migration/socket.c | 7 +

[PATCH 2/4] migration/multifd: use pages->allocated instead of the static max

2019-10-11 Thread Wei Yang
multifd_send_fill_packet() prepares meta data for following pages to transfer. It would be more proper to fill pages->allocated instead of static max value, especially we want to support flexible packet size. Signed-off-by: Wei Yang --- migration/ram.c | 3 +-- 1 file changed, 1 insertion(+)

[PATCH 0/4] migration/multifd: trivial cleanup for multifd

2019-10-11 Thread Wei Yang
Here are four trivial cleanups related to multifd. Fix a typo, use a proper variable and setup never changed variables only once. Wei Yang (4): migration/multifd: fix a typo in comment of multifd_recv_unfill_packet() migration/multifd: use pages->allocated instead of the static

[PATCH 4/4] migration/multifd: pages->used would be cleared when attach to multifd_send_state

2019-10-11 Thread Wei Yang
When we found an available channel in multifd_send_pages(), its pages->used is cleared and then attached to multifd_send_state. It is not necessary to do this twice. Signed-off-by: Wei Yang --- migration/ram.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/ram.c b/migration/ra

[PATCH 1/4] migration/multifd: fix a typo in comment of multifd_recv_unfill_packet()

2019-10-11 Thread Wei Yang
Signed-off-by: Wei Yang --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 22423f08cd..cf30171f44 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -838,7 +838,7 @@ static int multifd_recv_unfill_packet

[PATCH 3/4] migration/multifd: initialize packet->magic/version once at setup stage

2019-10-11 Thread Wei Yang
MultiFDPacket_t's magic and version field never changes during migration, so move these two fields in setup stage. Signed-off-by: Wei Yang --- migration/ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 6a3bef0434..71d845b851

Re: [Qemu-devel] [PULL 5/5] multifd: Use number of channels as listen backlog

2019-10-11 Thread Wei Yang
ener_open_sync(listener, saddr, num, errp) < 0) { > object_unref(OBJECT(listener)); > return; > } My confusion is this function is called at the beginning of the program, which means we didn't set multifd on or change the multifd channel parameter. They are the default value at this point. Am I right? >-- >2.21.0 > -- Wei Yang Help you, Help me

Re: [PATCH 3/3] migration/postcopy: replace have_listen_thread check with PostcopyState check

2019-10-09 Thread Wei Yang
On Wed, Oct 09, 2019 at 11:17:16AM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Tue, Oct 08, 2019 at 08:15:51PM +0100, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> After pre

[PATCH v2 1/2] migration/postcopy: rename postcopy_ram_enable_notify to postcopy_ram_incoming_setup

2019-10-09 Thread Wei Yang
Function postcopy_ram_incoming_setup and postcopy_ram_incoming_cleanup is a pair. Rename to make it clear for audience. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 4 ++-- migration/postcopy-ram.h | 2 +- migration/savevm.c | 2 +- 3 files

[PATCH v2 2/2] migration/postcopy: check PostcopyState before setting to POSTCOPY_INCOMING_RUNNING

2019-10-09 Thread Wei Yang
ve yet. This patch makes sure state is set to RUNNING only previous state is LISTENING by checking the state first. Signed-off-by: Wei Yang Suggested by: Peter Xu --- migration/savevm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index 78c2

[PATCH v2 0/2] migration/postcopy: cleanup related to postcopy

2019-10-09 Thread Wei Yang
Refine a function name and handle on corner case related to PostcopyState. v2: * remove one unnecessary patch * simplify corner case handling Wei Yang (2): migration/postcopy: rename postcopy_ram_enable_notify to postcopy_ram_incoming_setup migration/postcopy: check PostcopyState

Re: [PATCH 3/3] migration/postcopy: handle POSTCOPY_INCOMING_RUNNING corner case properly

2019-10-09 Thread Wei Yang
oops >> >return -1; >> > postcopy_state_set(RUNNING); >> > >> >> Looks good to me. >> >> Dave, >> >> Do you feel good with it? > >Yes, I think so; it's simpler. > I will prepare v2. >Dave > >> >Thanks, >> > >> >-- >> >Peter Xu >> >> -- >> Wei Yang >> Help you, Help me >-- >Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK -- Wei Yang Help you, Help me

Re: [PATCH 3/3] migration/postcopy: handle POSTCOPY_INCOMING_RUNNING corner case properly

2019-10-09 Thread Wei Yang
On Wed, Oct 09, 2019 at 01:36:34PM +0800, Peter Xu wrote: >On Wed, Oct 09, 2019 at 01:07:56PM +0800, Wei Yang wrote: >> On Wed, Oct 09, 2019 at 12:12:25PM +0800, Peter Xu wrote: >> >On Wed, Oct 09, 2019 at 09:02:04AM +0800, Wei Yang wrote: >> >> On Tue, Oct 08, 2019

Re: [PATCH 3/3] migration/postcopy: handle POSTCOPY_INCOMING_RUNNING corner case properly

2019-10-09 Thread Wei Yang
On Wed, Oct 09, 2019 at 12:12:25PM +0800, Peter Xu wrote: >On Wed, Oct 09, 2019 at 09:02:04AM +0800, Wei Yang wrote: >> On Tue, Oct 08, 2019 at 05:40:46PM +0100, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> Currently

Re: [PATCH 3/3] migration/postcopy: replace have_listen_thread check with PostcopyState check

2019-10-08 Thread Wei Yang
On Tue, Oct 08, 2019 at 08:15:51PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> After previous cleanup, postcopy thread is running only when >> PostcopyState is LISTENNING or RUNNING. This means it is not necessary >>

Re: [PATCH 1/4] migration/ram: only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE

2019-10-08 Thread Wei Yang
On Tue, Oct 08, 2019 at 06:38:25PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> The only possible bit set in invalid_flags is >> RAM_SAVE_FLAG_COMPRESS_PAGE at the beginning of function >> ram_load_precopy(), which means it i

Re: [PATCH 2/2] migration/postcopy: map large zero page in postcopy_ram_incoming_setup()

2019-10-08 Thread Wei Yang
On Tue, Oct 08, 2019 at 06:24:23PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> postcopy_ram_incoming_setup() and postcopy_ram_incoming_cleanup() are >> counterpart. It is reasonable to map/unmap large zero page in these two >> f

Re: [PATCH 3/3] migration/postcopy: handle POSTCOPY_INCOMING_RUNNING corner case properly

2019-10-08 Thread Wei Yang
On Tue, Oct 08, 2019 at 05:40:46PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Currently, we set PostcopyState blindly to RUNNING, even we found the >> previous state is not LISTENING. This will lead to a corner case. >>

Re: [PATCH 2/3] migration/postcopy: not necessary to do postcopy_ram_incoming_cleanup when state is ADVISE

2019-10-08 Thread Wei Yang
On Tue, Oct 08, 2019 at 05:02:02PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> postcopy_ram_incoming_cleanup() does cleanup for >> postcopy_ram_incoming_setup(), while the setup happens only after >> migration enters LISTEN sta

[PATCH] migration/postcopy: not necessary to discard all RAM at the beginning

2019-10-07 Thread Wei Yang
when migration thread just starts, which implies destination is not running yet. This means no page fault happened and memory region's page tables entries are empty. This patch removes the discard at the beginning. Signed-off-by: Wei Yang --- migration/postcopy-ram.c | 46

[PATCH 2/3] migration/postcopy: postpone setting PostcopyState to END

2019-10-05 Thread Wei Yang
to indicate the listen thread is done. This is a preparation patch for later cleanup. Signed-off-by: Wei Yang --- migration/postcopy-ram.c | 2 -- migration/savevm.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index

[PATCH 3/3] migration/postcopy: replace have_listen_thread check with PostcopyState check

2019-10-05 Thread Wei Yang
-by: Wei Yang --- migration/migration.h | 1 - migration/ram.c | 2 +- migration/ram.h | 1 + migration/savevm.c| 4 +--- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/migration/migration.h b/migration/migration.h index 4f2fe193dc..a4d639663d 100644 --- a/migration

[PATCH 1/3] migration/postcopy: mis->have_listen_thread check will never be touched

2019-10-05 Thread Wei Yang
ned-off-by: Wei Yang --- migration/savevm.c | 5 - 1 file changed, 5 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index feb757de79..eaa4cf58ef 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1878,11 +1878,6 @@ static int loadvm_postcopy_handle_lis

[PATCH 0/3] migration/postcopy: replace have_listen_thread check with PostcopyState check

2019-10-05 Thread Wei Yang
cleanup is included. Wei Yang (3): migration/postcopy: mis->have_listen_thread check will never be touched migration/postcopy: postpone setting PostcopyState to END migration/postcopy: replace have_listen_thread check with PostcopyState check migration/migration.h|

[PATCH 0/4] migration: trivial cleanup and refine

2019-10-05 Thread Wei Yang
This patch set contains several cleanup and refine for migration. simplify some calculation reuse the result fix typo in comment provide error message when failed Wei Yang (4): migration/ram: only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE migration

[PATCH 4/4] migration: report SaveStateEntry id and name on failure

2019-10-05 Thread Wei Yang
This provides helpful information on which entry failed. Signed-off-by: Wei Yang --- migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index 9f0122583d..feb757de79 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1215,6

[PATCH 3/4] migration: pass in_postcopy instead of check state again

2019-10-05 Thread Wei Yang
Not necessary to do the check again. Signed-off-by: Wei Yang --- migration/migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index c8eaa85867..56031305e3 100644 --- a/migration/migration.c +++ b/migration/migration.c

[PATCH 2/4] migration/postcopy: fix typo in mark_postcopy_blocktime_begin's comment

2019-10-05 Thread Wei Yang
Signed-off-by: Wei Yang --- migration/postcopy-ram.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index d2bdd21ae3..a394c7c3a6 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -768,9 +768,11

[PATCH 1/4] migration/ram: only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE

2019-10-05 Thread Wei Yang
The only possible bit set in invalid_flags is RAM_SAVE_FLAG_COMPRESS_PAGE at the beginning of function ram_load_precopy(), which means it is not necessary to do another check for RAM_SAVE_FLAG_COMPRESS_PAGE bit. Signed-off-by: Wei Yang --- migration/ram.c | 5 + 1 file changed, 1 insertion

  1   2   3   4   5   6   7   8   >