unstable: no ballooning
Hi,
when using xm mem-set on current (7278) unstable, you'll see
[2005-10-10 10:25:51 xend] ERROR (SrvBase:87) Request mem_target_set failed. Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/xen/web/SrvBase.py", line 85, in perform
return op_method(op, req)
File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDomain.py", line 132, in op_mem_target_set
return self.call(self.dom.setMemoryTarget
TypeError: unsubscriptable object
in xend.log.
The fix is trivial, a comma is missing, see (first) attached patch.
HOWEVER, this still does not make balllooning work. Nobody ever writes to /proc/xen/balloon.
I guess some message should go over xenbus and someone should then write to it's balloon file. For dom0, we could do it directly in XendDomainInfo.setMemoryTarget(). See attached second patch. It's a hack and certainly not the right solution.
Who should do it?
Best,
Signature · 3 lines
Kurt Garloff <[email protected]> [Koeln, DE] Physics:Plasma modeling <[email protected]> [TU Eindhoven, NL] Linux: SUSE Labs (Director) <[email protected]> [Novell Inc]
tools/python/xen/xend/server/SrvDomain.py renamed from tools/python/xen/xend/server/SrvDomain.py.orig +1 -1
@@ -129,7 +129,7 @@ def op_mem_target_set(self, op, req): - return self.call(self.dom.setMemoryTarget + return self.call(self.dom.setMemoryTarget, [['target', 'int']], req)
tools/python/xen/xend/XendDomainInfo.py renamed from tools/python/xen/xend/XendDomainInfo.py.orig +4 -1
@@ -796,7 +796,10 @@ class XendDomainInfo: t = target << 10 self.info['memory_KiB'] = t self.storeDom("memory/target", t) - + # BAD HACK -- this should be done somewhere else !!! + if self.domid == 0: + balloon = open("/proc/xen/balloon", "w") + balloon.write("%iM" % target) def update(self, info = None): """Update with info from xc.domain_getinfo().
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 12 lines · Kurt Garloff
Hi,
when using xm mem-set on current (7278) unstable, you'll see
[2005-10-10 10:25:51 xend] ERROR (SrvBase:87) Request
mem_target_setfailed. Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/xen/web/SrvBase.py", line 85, in perform
returnop_method(op, req)
File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDomain.py", line 132, inop_mem_target_set
return self.call(self.dom.setMemoryTarget
TypeError: unsubscriptable object
Quoted 7 lines
in xend.log.
The fix is trivial, a comma is missing, see (first) attached patch.
HOWEVER, this still does not make balllooning work. Nobody ever writes to
/proc/xen/balloon.
Kurt, could you please retest with today's unstable? I have put your first patch in (thanks for that) and we have made some changes to the xenstore watch interface recently, so that may help with the second problem.
The idea is that the memory/target value gets written by Xend, and and the balloon driver holds a watch on that value in the store. When the watch fires, the balloon driver should respond by setting the new target (drivers/xen/balloon/balloon.c:watch_target).
Watches have been broken in various ways over the last few days, and the bugs we know about there have now been fixed, so I would be interested to know whether your bug has been fixed in the process.
Cheers,
Ewan.
Ewan,
Quoted 3 lines · Ewan Mellor
Kurt, could you please retest with today's unstable? I have put your first patch in (thanks for that) and we have made some changes to the xenstore watch interface recently, so that may help with the second problem.
It seems to work now (tested with 7313), indeed.
Thanks for fixing.
Quoted 4 lines
The idea is that the memory/target value gets written by Xend, and and the balloon driver holds a watch on that value in the store. When the watch fires, the balloon driver should respond by setting the new target (drivers/xen/balloon/balloon.c:watch_target).
The kernel watches data from a userspace file?
So the kernel understands the tdb/xenstore format?
I wonder whether that's the cleanest way to implement this feature.
Best,
Signature · 1 line
Kurt Garloff, Director SUSE Labs, Novell Inc.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 8 lines · Kurt Garloff
Quoted 4 lines
The idea is that the memory/target value gets written by Xend, and and the balloon driver holds a watch on that value in the store. When the watch fires, the balloon driver should respond by setting the new target (drivers/xen/balloon/balloon.c:watch_target).
The kernel watches data from a userspace file?
So the kernel understands the tdb/xenstore format?
I wonder whether that's the cleanest way to implement this feature.
It's not a userspace file, as such, but a daemon running in domain 0. The daemon isolates domains from the tdb format, exposing a filesystem-style heirarchical namespace, and maintaining transaction semantics, firing callbacks when portions of the namespace change, and maintaining an implicit root for each connection. It is not necessary for drivers such as the balloon driver to understand the exact layout of the store, but they do need to know how to contact the store and the path from the domain's implicit root to the details in which they are interested. All changes in domain configuration and state are handled in this way.
Ewan.
Quoted 3 lines
The kernel watches data from a userspace file?
So the kernel understands the tdb/xenstore format?
I wonder whether that's the cleanest way to implement this feature.
IIRC it just watches the Xenstore node via xenstored: the kernel doesn't read the xenstore structures directly. It makes things the same for every dom... Btw, balloon driver doesn't do the full xenbus device registration that the front/back drivers - just hooks in for a simple notification.
Cheers,
Mark
Quoted 2 lines
Best,