Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2017-09-25 Thread Zhang Haoyu
If hotplug memory during migration, the calculation of migration_dirty_pages maybe incorrect, should fixed as below, -void migration_bitmap_extend(ram_addr_t old, ram_addr_t new) +void migration_bitmap_extend(RAMBlock *block, ram_addr_t old, ram_addr_t new) { /* called in qemu main thread, so

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2017-09-25 Thread Zhang Haoyu
If hotplug memory during migration, the calculation of migration_dirty_pages maybe not correct, void migration_bitmap_extend(ram_addr_t old, ram_addr_t new) { ... migration_dirty_pages += new - old; call_rcu(old_bitmap, migration_bitmap_free, rcu); ... } Thanks, Zha

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2017-09-20 Thread Zhang Haoyu
Hi Jiangshan, Any update from this patch? Thanks, Zhang Haoyu On 2016/8/11 22:45, Lai Jiangshan wrote: > Note, the old local migration patchset: > https://lists.gnu.org/archive/html/qemu-devel/2013-12/msg00073.html > > this patch can be considered as a new local migration implementation, > but

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-12 Thread Lai Jiangshan
On Fri, Aug 12, 2016 at 2:48 PM, Li, Liang Z wrote: >> >> > BTW. Is it possible to bypass the shared block in the >> >> 'ram_find_and_save_block'? >> >> > I mean no to check if a page is dirty for a shared block, it may >> >> > make things >> >> faster. >> >> >> >> Nice spotted. That would make t

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-11 Thread Li, Liang Z
> >> > BTW. Is it possible to bypass the shared block in the > >> 'ram_find_and_save_block'? > >> > I mean no to check if a page is dirty for a shared block, it may > >> > make things > >> faster. > >> > >> Nice spotted. That would make things faster. But once there we > >> could split the bitmap

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-11 Thread Lai Jiangshan
Note, the old local migration patchset: https://lists.gnu.org/archive/html/qemu-devel/2013-12/msg00073.html this patch can be considered as a new local migration implementation, but with more restrictions (the memory must set shared when boot the qemu)

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-11 Thread Lai Jiangshan
On Thu, Aug 11, 2016 at 3:11 PM, Li, Liang Z wrote: >> >> >> >> I might have missed something, could you tell me more? >> >> >> >> void bitmap_set(unsigned long *map, long start, long nr); I think the >> >> @start and @nr are both the number of the bits. >> >> >> >> thanks, >> >> Lai >> > >> > You

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-11 Thread Li, Liang Z
> >> > >> I might have missed something, could you tell me more? > >> > >> void bitmap_set(unsigned long *map, long start, long nr); I think the > >> @start and @nr are both the number of the bits. > >> > >> thanks, > >> Lai > > > > You are right, I have make a mistake by checking the code. Sorry

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-10 Thread Juan Quintela
"Li, Liang Z" wrote: >> On Wed, Aug 10, 2016 at 10:22 AM, Li, Liang Z wrote: >> > Hi Jiangshan, >> > >> > Glad to see your patch. It's a simple implementation which could provide >> very useful functions. >> > >> >> +static void migration_bitmap_init(unsigned long *bitmap) { >> >> +RAMBlock *

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-09 Thread Li, Liang Z
> On Wed, Aug 10, 2016 at 10:22 AM, Li, Liang Z wrote: > > Hi Jiangshan, > > > > Glad to see your patch. It's a simple implementation which could provide > very useful functions. > > > >> +static void migration_bitmap_init(unsigned long *bitmap) { > >> +RAMBlock *block; > >> + > >> +bitmap

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-09 Thread Lai Jiangshan
On Wed, Aug 10, 2016 at 10:22 AM, Li, Liang Z wrote: > Hi Jiangshan, > > Glad to see your patch. It's a simple implementation which could provide very > useful functions. > >> +static void migration_bitmap_init(unsigned long *bitmap) { >> +RAMBlock *block; >> + >> +bitmap_clear(bitmap, 0,

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-09 Thread Li, Liang Z
Hi Jiangshan, Glad to see your patch. It's a simple implementation which could provide very useful functions. > +static void migration_bitmap_init(unsigned long *bitmap) { > +RAMBlock *block; > + > +bitmap_clear(bitmap, 0, last_ram_offset() >> TARGET_PAGE_BITS); > +rcu_read_lock(); >

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-09 Thread Fam Zheng
On Wed, 08/10 08:54, Lai Jiangshan wrote: > When the migration capability 'bypass-shared-memory' > is set, the shared memory will be bypassed when migration. > > It is the key feature to enable several excellent features for > the qemu, such as qemu-local-migration, qemu-live-update, > extremely-f

[Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2016-08-09 Thread Lai Jiangshan
When the migration capability 'bypass-shared-memory' is set, the shared memory will be bypassed when migration. It is the key feature to enable several excellent features for the qemu, such as qemu-local-migration, qemu-live-update, extremely-fast-save-restore, vm-template, vm-fast-live-clone, yet