From: "Jan Beulich" Subject: [PATCH] honor MEMF_no_refcount in alloc_heap_pages() Date: Wed, 25 Feb 2015 14:42:33 +0000 Message-ID: <54EDED690200007800063A86@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4772F349.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YQdAa-0007Z1-Iv for xen-devel@lists.xenproject.org; Wed, 25 Feb 2015 14:42:36 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Ian Campbell , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part4772F349.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Non-anonymous allocations with this flag set should - for the purpose of the availability check - be treated just like anonymous ones, as they wouldn't lead to a reduction of ->outstanding_pages. Signed-off-by: Jan Beulich --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -617,7 +617,8 @@ static struct page_info *alloc_heap_page */ if ( (outstanding_claims + request > total_avail_pages + tmem_freeable_pages()) && - (d =3D=3D NULL || d->outstanding_pages < request) ) + ((memflags & MEMF_no_refcount) || + !d || d->outstanding_pages < request) ) goto not_found; =20 /* --=__Part4772F349.1__= Content-Type: text/plain; name="heap-alloc-avail-check.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="heap-alloc-avail-check.patch" honor MEMF_no_refcount in alloc_heap_pages()=0A=0ANon-anonymous allocations= with this flag set should - for the purpose=0Aof the availability check - = be treated just like anonymous ones, as=0Athey wouldn't lead to a = reduction of ->outstanding_pages.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/common/page_alloc.c=0A+++ b/xen/common/p= age_alloc.c=0A@@ -617,7 +617,8 @@ static struct page_info *alloc_heap_page= =0A */=0A if ( (outstanding_claims + request >=0A = total_avail_pages + tmem_freeable_pages()) &&=0A- (d =3D=3D NULL = || d->outstanding_pages < request) )=0A+ ((memflags & MEMF_no_refc= ount) ||=0A+ !d || d->outstanding_pages < request) )=0A = goto not_found;=0A =0A /*=0A --=__Part4772F349.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part4772F349.1__=--