Re: [Xen-devel] [PATCH v9 3/4] mm: make pages allocated with MEMF_no_refcount safe to assign

2020-02-06 Thread Julien Grall
On 06/02/2020 11:43, Jan Beulich wrote: On 06.02.2020 11:12, Durrant, Paul wrote: From: Julien Grall Sent: 06 February 2020 10:04 On 03/02/2020 10:56, Paul Durrant wrote: @@ -2332,11 +2350,23 @@ struct page_info *alloc_domheap_pages( memflags, d)) == NUL

Re: [Xen-devel] [PATCH v9 3/4] mm: make pages allocated with MEMF_no_refcount safe to assign

2020-02-06 Thread Jan Beulich
On 06.02.2020 11:12, Durrant, Paul wrote: >> From: Julien Grall >> Sent: 06 February 2020 10:04 >> >> On 03/02/2020 10:56, Paul Durrant wrote: >>> @@ -2332,11 +2350,23 @@ struct page_info *alloc_domheap_pages( >>> memflags, d)) == NULL)) ) >>>return

Re: [Xen-devel] [PATCH v9 3/4] mm: make pages allocated with MEMF_no_refcount safe to assign

2020-02-06 Thread Durrant, Paul
> -Original Message- > From: Julien Grall > Sent: 06 February 2020 10:04 > To: Durrant, Paul ; xen-devel@lists.xenproject.org > Cc: Jan Beulich ; Andrew Cooper > ; George Dunlap ; > Ian Jackson ; Konrad Rzeszutek Wilk > ; Stefano Stabellini ; Wei > Liu ; Volodymyr Babchuk ; Roger > Pau Mon

Re: [Xen-devel] [PATCH v9 3/4] mm: make pages allocated with MEMF_no_refcount safe to assign

2020-02-06 Thread Julien Grall
Hi, I am sorry to jump that late in the conversation. On 03/02/2020 10:56, Paul Durrant wrote: -if ( unlikely(domain_adjust_tot_pages(d, 1 << order) == (1 << order)) ) +if ( !(memflags & MEMF_no_refcount) && + unlikely(domain_adjust_tot_pages(d, 1 << order) == (1 << order

[Xen-devel] [PATCH v9 3/4] mm: make pages allocated with MEMF_no_refcount safe to assign

2020-02-03 Thread Paul Durrant
Currently it is unsafe to assign a domheap page allocated with MEMF_no_refcount to a domain because the domain't 'tot_pages' will not be incremented, but will be decrement when the page is freed (since free_domheap_pages() has no way of telling that the increment was skipped). This patch allocates