Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 16:03, wrote: > On 12/19/2017 09:40 AM, Jan Beulich wrote: > On 19.12.17 at 15:25, wrote: >>> On 12/19/2017 03:23 AM, Jan Beulich wrote: > + memmap.nr_entries = ARRAY_SIZE(xen_e820_table->entries); Is it

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 16:03, wrote: > On 12/19/2017 09:40 AM, Jan Beulich wrote: > On 19.12.17 at 15:25, wrote: >>> On 12/19/2017 03:23 AM, Jan Beulich wrote: > + memmap.nr_entries = ARRAY_SIZE(xen_e820_table->entries); Is it really reasonable to have a static upper bound here? As we

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Boris Ostrovsky
On 12/19/2017 09:40 AM, Jan Beulich wrote: On 19.12.17 at 15:25, wrote: >> On 12/19/2017 03:23 AM, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: + if (!xen_e820_table) + return; >>> Not saying "out of

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Boris Ostrovsky
On 12/19/2017 09:40 AM, Jan Beulich wrote: On 19.12.17 at 15:25, wrote: >> On 12/19/2017 03:23 AM, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: + if (!xen_e820_table) + return; >>> Not saying "out of memory" here is certainly fine, but shouldn't >>> there

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 15:25, wrote: > On 12/19/2017 03:23 AM, Jan Beulich wrote: > On 18.12.17 at 23:22, wrote: >>> + if (!xen_e820_table) >>> + return; >> Not saying "out of memory" here is certainly fine, but shouldn't >>

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 15:25, wrote: > On 12/19/2017 03:23 AM, Jan Beulich wrote: > On 18.12.17 at 23:22, wrote: >>> + if (!xen_e820_table) >>> + return; >> Not saying "out of memory" here is certainly fine, but shouldn't >> there nevertheless be a warning, as failure to go through

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Boris Ostrovsky
On 12/19/2017 03:23 AM, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: + + xen_e820_table = kzalloc(sizeof(*xen_e820_table), GFP_KERNEL); > Wouldn't kmalloc() suffice here? Yes. > >> +if (!xen_e820_table) >> +return; > Not saying

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Boris Ostrovsky
On 12/19/2017 03:23 AM, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: + + xen_e820_table = kzalloc(sizeof(*xen_e820_table), GFP_KERNEL); > Wouldn't kmalloc() suffice here? Yes. > >> +if (!xen_e820_table) >> +return; > Not saying "out of memory" here is

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Juergen Gross
On 19/12/17 10:27, Jan Beulich wrote: On 19.12.17 at 10:21, wrote: >> On 19/12/17 09:23, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: +void __init arch_xen_balloon_init(struct resource *hostmem_resource) +{ + struct

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Juergen Gross
On 19/12/17 10:27, Jan Beulich wrote: On 19.12.17 at 10:21, wrote: >> On 19/12/17 09:23, Jan Beulich wrote: >> On 18.12.17 at 23:22, wrote: +void __init arch_xen_balloon_init(struct resource *hostmem_resource) +{ + struct xen_memory_map memmap; + int rc; +

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 10:21, wrote: > On 19/12/17 09:23, Jan Beulich wrote: > On 18.12.17 at 23:22, wrote: >>> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >>> +{ >>> + struct xen_memory_map memmap; >>> + int rc; >>> +

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 19.12.17 at 10:21, wrote: > On 19/12/17 09:23, Jan Beulich wrote: > On 18.12.17 at 23:22, wrote: >>> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >>> +{ >>> + struct xen_memory_map memmap; >>> + int rc; >>> + unsigned int i, last_guest_ram; >>> +

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Juergen Gross
On 19/12/17 09:23, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: >> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >> +{ >> +struct xen_memory_map memmap; >> +int rc; >> +unsigned int i, last_guest_ram; >> +phys_addr_t

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Juergen Gross
On 19/12/17 09:23, Jan Beulich wrote: On 18.12.17 at 23:22, wrote: >> +void __init arch_xen_balloon_init(struct resource *hostmem_resource) >> +{ >> +struct xen_memory_map memmap; >> +int rc; >> +unsigned int i, last_guest_ram; >> +phys_addr_t max_addr = max_pfn <<

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 18.12.17 at 23:22, wrote: > +void __init arch_xen_balloon_init(struct resource *hostmem_resource) > +{ > + struct xen_memory_map memmap; > + int rc; > + unsigned int i, last_guest_ram; > + phys_addr_t max_addr = max_pfn << PAGE_SHIFT; PFN_PHYS()

Re: [Xen-devel] [PATCH v2] xen/balloon: Mark unallocated host memory as UNUSABLE

2017-12-19 Thread Jan Beulich
>>> On 18.12.17 at 23:22, wrote: > +void __init arch_xen_balloon_init(struct resource *hostmem_resource) > +{ > + struct xen_memory_map memmap; > + int rc; > + unsigned int i, last_guest_ram; > + phys_addr_t max_addr = max_pfn << PAGE_SHIFT; PFN_PHYS() as right now you still have