Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Tamas K Lengyel
On Tue, Jul 19, 2016 at 10:55 AM, Andrew Cooper wrote: > On 19/07/16 17:54, Tamas K Lengyel wrote: >> On Tue, Jul 19, 2016 at 10:49 AM, Andrew Cooper >> wrote: >>> On 19/07/16 17:27, Tamas K Lengyel wrote: >> +{ >> +int rc = 0; >> +shr_handle_t sh, ch; >> +unsigned lon

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Andrew Cooper
On 19/07/16 17:54, Tamas K Lengyel wrote: > On Tue, Jul 19, 2016 at 10:49 AM, Andrew Cooper > wrote: >> On 19/07/16 17:27, Tamas K Lengyel wrote: > +{ > +int rc = 0; > +shr_handle_t sh, ch; > +unsigned long start = > +range->_scratchspace ? range->_scratchsp

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Tamas K Lengyel
On Tue, Jul 19, 2016 at 10:49 AM, Andrew Cooper wrote: > On 19/07/16 17:27, Tamas K Lengyel wrote: >> +{ +int rc = 0; +shr_handle_t sh, ch; +unsigned long start = +range->_scratchspace ? range->_scratchspace : range->start; >>> This can be shortened to

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Andrew Cooper
On 19/07/16 17:27, Tamas K Lengyel wrote: > >>> +{ >>> +int rc = 0; >>> +shr_handle_t sh, ch; >>> +unsigned long start = >>> +range->_scratchspace ? range->_scratchspace : range->start; >> This can be shortened to "unsigned long start = range->_scratchspace ?: >> range->start;"

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Tamas K Lengyel
On Tue, Jul 19, 2016 at 1:54 AM, Julien Grall wrote: > Hello Tamas, > > On 18/07/2016 22:14, Tamas K Lengyel wrote: >> >> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h >> index e904bd5..0ca94cd 100644 >> --- a/tools/libxc/include/xenctrl.h >> +++ b/tools/libxc/include/

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Tamas K Lengyel
On Mon, Jul 18, 2016 at 3:47 PM, Andrew Cooper wrote: > On 18/07/2016 22:14, Tamas K Lengyel wrote: >> Currently mem-sharing can be performed on a page-by-page basis from the >> control >> domain. However, this process is quite wasteful when a range of pages have to >> be deduplicated. >> >> This

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-19 Thread Julien Grall
Hello Tamas, On 18/07/2016 22:14, Tamas K Lengyel wrote: diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index e904bd5..0ca94cd 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -2334,6 +2334,21 @@ int xc_memshr_add_to_physmap(xc_interfa

Re: [Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-18 Thread Andrew Cooper
On 18/07/2016 22:14, Tamas K Lengyel wrote: > Currently mem-sharing can be performed on a page-by-page basis from the > control > domain. However, this process is quite wasteful when a range of pages have to > be deduplicated. > > This patch introduces a new mem_sharing memop for range sharing whe

[Xen-devel] [PATCH v7] x86/mem-sharing: mem-sharing a range of memory

2016-07-18 Thread Tamas K Lengyel
Currently mem-sharing can be performed on a page-by-page basis from the control domain. However, this process is quite wasteful when a range of pages have to be deduplicated. This patch introduces a new mem_sharing memop for range sharing where the user doesn't have to separately nominate each pag