From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andres Lagar-Cavilla" Subject: Re: [PATCH 0 of 4] Handling of (some) low memory conditions Date: Thu, 16 Feb 2012 07:34:13 -0800 Message-ID: <06a5548b6f1f6c2b7fa0a1e2bc11115f.squirrel@webmail.lagarcavilla.org> References: <4F3CDAF80200007800073601@nat28.tlf.novell.com> <1e27162d41edf2d71660cc29471d153f.squirrel@webmail.lagarcavilla.org> <4F3D2D28020000780007377D@nat28.tlf.novell.com> Reply-To: andres@lagarcavilla.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F3D2D28020000780007377D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: andres@gridcentric.ca, xen-devel , tim@xen.org, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org >>>> On 16.02.12 at 15:40, "Andres Lagar-Cavilla" >>>> wrote: >>>>>> On 16.02.12 at 04:57, Andres Lagar-Cavilla >>>>>> wrote: >>>> - Add a VIRQ that the hypervisor can emit when reaching a low memory >>>> threshold. >>> >>> In this patch, which didn't make it to my inbox yet, you will want to >>> change this >>> >>> + if ( (total_avail_pages << PAGE_SHIFT) <= opt_low_mem_virq ) >>> >>> to >>> >>> if ( total_avail_pages <= PFN_DOWN(opt_low_mem_virq) ) >>> >>> to avoid the case (on 32-bit hypervisors) where total_avail_pages, >>> being just 'long', would get significant bits shifted out. >>> >>> I'm further wondering whether the default value shouldn't be set >>> dynamically based on available memory and/or taking into account >>> an eventual dom0_mem= option. >> >> I can cap or get rid of the threshold (and the virq) if it doesn't make >> sense with respect to total memory. I'm not sure about integrating >> dom0_mem, since dom0's footprint is also a quantity manipulated by the >> receiver of the virq. > > No, dom0_mem= is only specifying the starting value, and the case > that would be of possibly interest is that of having a negative amount > specified. Sorry, not following entirely. The negative quantity you refer to would be dom0_mem or the low mem virq threshold? Additional checks pertaining only to dom0_mem, not in relation to this threshold, would most likely go on a separate patch. And both quantities are parsed using strtoull, so you get at most really large numbers. I certainly need to add additional checks for unsuitable low_mem_virq thresholds to this patch. Thanks, Andres > > Jan > >