Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-07-05 Thread Jan Beulich
>>> On 05.07.16 at 16:35, wrote: > On Thu, Jun 23, 2016 at 4:42 PM, Tamas K Lengyel wrote: +if ( !atomic_read(>pause_count) || + !atomic_read(>pause_count) ) +{ +

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-07-05 Thread Tamas K Lengyel
On Tue, Jul 5, 2016 at 8:35 AM, George Dunlap wrote: > On Thu, Jun 23, 2016 at 4:42 PM, Tamas K Lengyel wrote: +if ( !atomic_read(>pause_count) || + !atomic_read(>pause_count) ) +{ +

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-07-05 Thread George Dunlap
On Thu, Jun 23, 2016 at 4:42 PM, Tamas K Lengyel wrote: >>> +if ( !atomic_read(>pause_count) || >>> + !atomic_read(>pause_count) ) >>> +{ >>> +rcu_unlock_domain(cd); >>> +rc = -EINVAL; >>> +

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-23 Thread Tamas K Lengyel
On Wed, Jun 22, 2016 at 9:38 AM, George Dunlap wrote: > On Sun, Jun 12, 2016 at 12:24 AM, Tamas K Lengyel wrote: >> Currently mem-sharing can be performed on a page-by-page base from the >> control >> domain. However, when completely deduplicating

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-22 Thread George Dunlap
On Sun, Jun 12, 2016 at 12:24 AM, Tamas K Lengyel wrote: > Currently mem-sharing can be performed on a page-by-page base from the control > domain. However, when completely deduplicating (cloning) a VM, this requires > at least 3 hypercalls per page. As the user has to loop

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-15 Thread Konrad Rzeszutek Wilk
On Wed, Jun 15, 2016 at 02:14:15AM -0600, Jan Beulich wrote: > >>> On 14.06.16 at 18:33, wrote: > >> +/* Check for continuation if it's not the last iteration. */ > >> +if ( limit > ++bulk->start && hypercall_preempt_check() ) > > > > I surprised the

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-15 Thread Jan Beulich
>>> On 14.06.16 at 18:33, wrote: >> +/* Check for continuation if it's not the last iteration. */ >> +if ( limit > ++bulk->start && hypercall_preempt_check() ) > > I surprised the compiler didn't complain to you about lack of parenthesis. I'm puzzled -

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-14 Thread Tamas K Lengyel
On Jun 14, 2016 10:33, "Konrad Rzeszutek Wilk" wrote: > > > diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c > > index a522423..ba06fb0 100644 > > --- a/xen/arch/x86/mm/mem_sharing.c > > +++ b/xen/arch/x86/mm/mem_sharing.c > > @@ -1294,6 +1294,54

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-14 Thread Konrad Rzeszutek Wilk
> diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c > index a522423..ba06fb0 100644 > --- a/xen/arch/x86/mm/mem_sharing.c > +++ b/xen/arch/x86/mm/mem_sharing.c > @@ -1294,6 +1294,54 @@ int relinquish_shared_pages(struct domain *d) > return rc; > } > > +static int

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-14 Thread Jan Beulich
>>> On 12.06.16 at 01:24, wrote: > @@ -1468,6 +1516,79 @@ int > mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg) > } > break; > > +case XENMEM_sharing_op_bulk_share: > +{ > +unsigned long max_sgfn, max_cgfn;

Re: [Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-11 Thread Tamas K Lengyel
On Sat, Jun 11, 2016 at 5:24 PM, Tamas K Lengyel wrote: > Currently mem-sharing can be performed on a page-by-page base from the control > domain. However, when completely deduplicating (cloning) a VM, this requires > at least 3 hypercalls per page. As the user has to loop

[Xen-devel] [PATCH v5 1/2] x86/mem-sharing: Bulk mem-sharing entire domains

2016-06-11 Thread Tamas K Lengyel
Currently mem-sharing can be performed on a page-by-page base from the control domain. However, when completely deduplicating (cloning) a VM, this requires at least 3 hypercalls per page. As the user has to loop through all pages up to max_gpfn, this process is very slow and wasteful. This patch