From: Dan Magenheimer Subject: Re: [PATCH] Low mem virq incremental adjustments Date: Thu, 8 Mar 2012 13:59:00 -0800 (PST) Message-ID: References: <5651945c7a74652efce9.1331136908@xdev.gridcentric.ca> <4F57A2C40200007800076F24@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: andres@lagarcavilla.org, Jan Beulich Cc: ian.campbell@citrix.com, andres@gridcentric.ca, tim@xen.org, xen-devel , ian.jackson@citrix.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org > From: Andres Lagar-Cavilla [mailto:andres@lagarcavilla.org] > Sent: Wednesday, March 07, 2012 11:12 AM > To: Jan Beulich > Cc: Dan Magenheimer; ian.campbell@citrix.com; ian.jackson@citrix.com; adin@gridcentric.ca; > andres@gridcentric.ca; xen-devel; tim@xen.org > Subject: Re: [PATCH] Low mem virq incremental adjustments > > > >>> On 07.03.12 at 17:15, Andres Lagar-Cavilla > > wrote: > >> --- a/xen/common/page_alloc.c > >> +++ b/xen/common/page_alloc.c > >> @@ -377,7 +377,10 @@ static void __init setup_low_mem_virq(vo > >> > >> static void check_low_mem_virq(void) > >> { > >> - if ( unlikely(total_avail_pages <= low_mem_virq_th) ) > >> + unsigned long avail_pages = total_avail_pages + > >> + (opt_tmem) ? tmem_freeable_pages(): 0; > > > > Can tmem_freeable_pages() return anything other than zero when > > opt_tmem is zero? (I.e. is the [improperly parenthesized!] conditional > > expression necessary at all?) > > I'm not sure. I'll let Dan take it from here, as he surely knows the right > way. He acked it the way it is. > Andres Both would be correct (other than the parentheses). I was also going to make the same comment about tmem_freeable_pages() but decided the way Andres coded it is clearer because it doesn't assume anything about tmem; if tmem is enabled, it uses an abstract interface this code doesn't need to know anything about. Anyway, either way is fine with me. Dan