From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Magenheimer Subject: RE: [PATCH 2 of 8] libxl: introduce libxl_set_relative_memory_target Date: Wed, 1 Sep 2010 13:03:33 -0700 (PDT) Message-ID: <43844cf2-4c99-448c-a98c-3100baae6dcc@default> References: <19581.15132.637644.952724@mariner.uk.xensource.com 4C7E94F0.5050802@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4C7E94F0.5050802@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge , Ian Jackson Cc: xen-devel@lists.xensource.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Thanks for cc'ing me Jeremy... I saw the posting but missed the implications (thinking it just a vanilla reimplementation of "xm memset"). > There needs to be a way to set the maxmem for a domain without also > setting the memory/target xenstore key, so that you can allow a domain > to control its own ballooning up to a certain limit without also > triggering its xenstore watch (which would trigger an external balloon > target request). Indeed, that's what selfballooning does. The xenstore watch is irrelevant for selfballooning (though the watch also can be used asynchronously for backwards compatibility). IMHO, attempts to do memory load balancing externally (e.g. setting a memory target from tools in dom0) are doomed to failure. There=20 was a discussion of memory "rightsizing" at the recent Linux MM summit; this is an almost impossible problem even within a single kernel, though there were heuristics discussed as to how to approach it... and a better understanding about why in-kernel tmem-ish functionalities like cleancache and frontswap are useful for mitigating the problems that occur when rightsizing is approximated. > There's also the question of how tmem makes use of maxmem - I believe > it > allows a domain to use tmem pages up to its maxmem, without actually > changing the current memory usage in terms of pages mapped into the > domain. There are two classes of tmem memory: ephemeral and persistent. Ephemeral is clean pages that can be discarded at any time and tmem doesn't count those against maxmem. Persistent pages must be retained until the guest that "owns" them flushes them or dies; these pages DO count against the guest's maxmem but are not mapped into the domain. So, frankly, I think the "xm memset" functionality is largely useless, but agree that it should be maintained in xl for backwards compatibility. But trying to comingle the concepts of maxmem and target is a bad idea. Dan