From: "Jan Beulich" Subject: Re: [PATCH v7 6/9] Add the facility to limit ranges per rangeset Date: Fri, 09 May 2014 14:22:36 +0100 Message-ID: <536CF2BC0200007800010F52@mail.emea.novell.com> References: <1399624804-5109-1-git-send-email-paul.durrant@citrix.com> <1399624804-5109-7-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1399624804-5109-7-git-send-email-paul.durrant@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 09.05.14 at 10:40, wrote: > A subsequent patch exposes rangesets to secondary emulators, so to allow a > limit to be placed on the amount of xenheap that an emulator can cause to be > consumed, the function rangeset_limit() has been created to set the allowed > number of ranges in a rangeset. By default, there is no limit. > > Signed-off-by: Paul Durrant Reviewed-by: Jan Beulich albeit ... > --- a/xen/common/rangeset.c > +++ b/xen/common/rangeset.c > @@ -25,6 +25,9 @@ struct rangeset { > > /* Ordered list of ranges contained in this set, and protecting lock. > */ > struct list_head range_list; > + > + /* Number of ranges that can be allocated */ > + long nr_ranges; I would have preferred this to be unsigned int (and to have the no- limit case more explicitly handled by never decrementing the count when it's e.g. UINT_MAX). Jan