* [PATCH] xend: Fix xm list bug reporting incorrect memory size
@ 2013-04-02 17:38 Konrad Rzeszutek Wilk
2013-04-08 17:06 ` Ian Jackson
2013-06-05 19:01 ` Matt Wilson
0 siblings, 2 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-04-02 17:38 UTC (permalink / raw)
To: xen-devel, ian.campbell; +Cc: Marcos Matsunaga, Konrad Rzeszutek Wilk
From: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
Make sure memory is updated every time XendConfig.update is called.
Without this patch, if a guest self-balloons, the amount of memory
that 'xend' thinks the guest is using is based on last cached value.
This means the reported value is nowhere close to what the real
value is.
This change allows xend to double-check the xcinfo info (which
hypercall it had already do) and use the up-to-date contents.
'xl' already does this by using the xcinfo.
Oracle-Bug: 14553104 ( MEM(K) IN XENTOP MISMATCH MEMTOTAL IN /PROC/MEMINFO AND MEM IN "XM LIST")
Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
tools/python/xen/xend/XendConfig.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 4a226a7..d8a2535 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -1041,7 +1041,10 @@ class XendConfig(dict):
@param dominfo: Domain information via xc.domain_getinfo()
@type dominfo: dict
"""
- self._dominfo_to_xapi(dominfo)
+ if dominfo['paused']:
+ self._dominfo_to_xapi(dominfo)
+ else:
+ self._dominfo_to_xapi(dominfo, update_mem = True)
self.validate()
def update_with_xenapi_config(self, xapi):
--
1.8.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] xend: Fix xm list bug reporting incorrect memory size
2013-04-02 17:38 [PATCH] xend: Fix xm list bug reporting incorrect memory size Konrad Rzeszutek Wilk
@ 2013-04-08 17:06 ` Ian Jackson
2013-04-12 15:15 ` Marcos E. Matsunaga
2013-06-05 19:01 ` Matt Wilson
1 sibling, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2013-04-08 17:06 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: Marcos Matsunaga, xen-devel, ian.campbell
Konrad Rzeszutek Wilk writes ("[Xen-devel] [PATCH] xend: Fix xm list bug reporting incorrect memory size"):
> From: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
>
> Make sure memory is updated every time XendConfig.update is called.
>
> Without this patch, if a guest self-balloons, the amount of memory
> that 'xend' thinks the guest is using is based on last cached value.
> This means the reported value is nowhere close to what the real
> value is.
Err, right. I'm afraid I'm very unfamiliar with the xend code so this
is going to take more explanation than usual.
> - self._dominfo_to_xapi(dominfo)
> + if dominfo['paused']:
> + self._dominfo_to_xapi(dominfo)
> + else:
> + self._dominfo_to_xapi(dominfo, update_mem = True)
Can you explain what the relevance is of the domain being paused ?
Thanks,
Ian.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xend: Fix xm list bug reporting incorrect memory size
2013-04-08 17:06 ` Ian Jackson
@ 2013-04-12 15:15 ` Marcos E. Matsunaga
2013-05-06 20:31 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 6+ messages in thread
From: Marcos E. Matsunaga @ 2013-04-12 15:15 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel, ian.campbell, Konrad Rzeszutek Wilk
Hi Ian,
Sorry, I thought I sent you the answer before, but it was stuck in my
drafts folder for some reason.
I am not very familiar with xend either, but after reading the code, my
understanding is that when a domain is being created, it keeps the
domain paused until all the resources are allocated, then it unpause it
to complete the boot. If I made a wrong assumption, please correct me.
If dominfo is called during the domain initialization process with
update_mem = true (The default for update_mem is false), it will return
zero as the resource is not allocated yet, and that will break the
initialization process. Also, I don't think it would make sense to
update memory information of a domain that is paused.
That's the relevance of the domain being paused.
Regards,
Marcos Eduardo Matsunaga
Oracle USA
Linux Engineering
“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
On 04/08/2013 01:06 PM, Ian Jackson wrote:
> Konrad Rzeszutek Wilk writes ("[Xen-devel] [PATCH] xend: Fix xm list bug reporting incorrect memory size"):
>> From: Marcos Matsunaga<Marcos.Matsunaga@oracle.com>
>>
>> Make sure memory is updated every time XendConfig.update is called.
>>
>> Without this patch, if a guest self-balloons, the amount of memory
>> that 'xend' thinks the guest is using is based on last cached value.
>> This means the reported value is nowhere close to what the real
>> value is.
> Err, right. I'm afraid I'm very unfamiliar with the xend code so this
> is going to take more explanation than usual.
>
>> - self._dominfo_to_xapi(dominfo)
>> + if dominfo['paused']:
>> + self._dominfo_to_xapi(dominfo)
>> + else:
>> + self._dominfo_to_xapi(dominfo, update_mem = True)
> Can you explain what the relevance is of the domain being paused ?
>
> Thanks,
> Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xend: Fix xm list bug reporting incorrect memory size
2013-04-12 15:15 ` Marcos E. Matsunaga
@ 2013-05-06 20:31 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-05-06 20:31 UTC (permalink / raw)
To: Marcos E. Matsunaga; +Cc: xen-devel, Ian Jackson, ian.campbell
On Fri, Apr 12, 2013 at 11:15:11AM -0400, Marcos E. Matsunaga wrote:
> Hi Ian,
>
> Sorry, I thought I sent you the answer before, but it was stuck in
> my drafts folder for some reason.
>
> I am not very familiar with xend either, but after reading the code,
> my understanding is that when a domain is being created, it keeps
> the domain paused until all the resources are allocated, then it
> unpause it to complete the boot. If I made a wrong assumption,
> please correct me.
>
> If dominfo is called during the domain initialization process with
> update_mem = true (The default for update_mem is false), it will
> return zero as the resource is not allocated yet, and that will
> break the initialization process. Also, I don't think it would make
> sense to update memory information of a domain that is paused.
>
> That's the relevance of the domain being paused.
ping? Should Marcos include this detail in the patch and repost it?
Thanks.
>
> Regards,
>
> Marcos Eduardo Matsunaga
>
> Oracle USA
> Linux Engineering
>
> “The statements and opinions expressed here are my own and do not
> necessarily represent those of Oracle Corporation.”
>
> On 04/08/2013 01:06 PM, Ian Jackson wrote:
> >Konrad Rzeszutek Wilk writes ("[Xen-devel] [PATCH] xend: Fix xm list bug reporting incorrect memory size"):
> >>From: Marcos Matsunaga<Marcos.Matsunaga@oracle.com>
> >>
> >>Make sure memory is updated every time XendConfig.update is called.
> >>
> >>Without this patch, if a guest self-balloons, the amount of memory
> >>that 'xend' thinks the guest is using is based on last cached value.
> >>This means the reported value is nowhere close to what the real
> >>value is.
> >Err, right. I'm afraid I'm very unfamiliar with the xend code so this
> >is going to take more explanation than usual.
> >
> >>- self._dominfo_to_xapi(dominfo)
> >>+ if dominfo['paused']:
> >>+ self._dominfo_to_xapi(dominfo)
> >>+ else:
> >>+ self._dominfo_to_xapi(dominfo, update_mem = True)
> >Can you explain what the relevance is of the domain being paused ?
> >
> >Thanks,
> >Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xend: Fix xm list bug reporting incorrect memory size
2013-04-02 17:38 [PATCH] xend: Fix xm list bug reporting incorrect memory size Konrad Rzeszutek Wilk
2013-04-08 17:06 ` Ian Jackson
@ 2013-06-05 19:01 ` Matt Wilson
2013-06-27 9:29 ` Marcos E. Matsunaga
1 sibling, 1 reply; 6+ messages in thread
From: Matt Wilson @ 2013-06-05 19:01 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: Marcos Matsunaga, xen-devel, ian.campbell
On Tue, Apr 02, 2013 at 01:38:47PM -0400, Konrad Rzeszutek Wilk wrote:
> From: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
>
> Make sure memory is updated every time XendConfig.update is called.
>
> Without this patch, if a guest self-balloons, the amount of memory
> that 'xend' thinks the guest is using is based on last cached value.
> This means the reported value is nowhere close to what the real
> value is.
I think this makes sense, but I think the real problem is that we
cache the value at all.
> This change allows xend to double-check the xcinfo info (which
> hypercall it had already do) and use the up-to-date contents.
>
> 'xl' already does this by using the xcinfo.
>
> Oracle-Bug: 14553104 ( MEM(K) IN XENTOP MISMATCH MEMTOTAL IN /PROC/MEMINFO AND MEM IN "XM LIST")
> Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> tools/python/xen/xend/XendConfig.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
> index 4a226a7..d8a2535 100644
> --- a/tools/python/xen/xend/XendConfig.py
> +++ b/tools/python/xen/xend/XendConfig.py
> @@ -1041,7 +1041,10 @@ class XendConfig(dict):
> @param dominfo: Domain information via xc.domain_getinfo()
> @type dominfo: dict
> """
> - self._dominfo_to_xapi(dominfo)
> + if dominfo['paused']:
> + self._dominfo_to_xapi(dominfo)
> + else:
You need to fix tabs v/s spaces. Indent with spaces *only* for python
code.
--msw
> + self._dominfo_to_xapi(dominfo, update_mem = True)
> self.validate()
>
> def update_with_xenapi_config(self, xapi):
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xend: Fix xm list bug reporting incorrect memory size
2013-06-05 19:01 ` Matt Wilson
@ 2013-06-27 9:29 ` Marcos E. Matsunaga
0 siblings, 0 replies; 6+ messages in thread
From: Marcos E. Matsunaga @ 2013-06-27 9:29 UTC (permalink / raw)
To: Matt Wilson; +Cc: xen-devel, ian.campbell, Konrad Rzeszutek Wilk
[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]
Hi Matt,
I have corrected the tab problem and re-created the patch.
It is attached.
From aec170275bef7f371d9a195f49a3e8790160dd0f Mon Sep 17 00:00:00 2001
From: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
Date: Thu, 27 Jun 2013 05:25:42 -0400
Subject: [PATCH] xend: Fix xm list bug reporting incorrect memory size
This change allows xend to double-check the xcinfo info (which
hypercall it had already do) and use the up-to-date contents.
'xl' already does this by using the xcinfo.
Oracle-Bug: 14553104 ( MEM(K) IN XENTOP MISMATCH MEMTOTAL IN
/PROC/MEMINFO AND MEM IN "XM LIST")
Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
tools/python/xen/xend/XendConfig.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/python/xen/xend/XendConfig.py
b/tools/python/xen/xend/XendConfig.py
index 5568d35..eb433a7 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -1042,7 +1042,10 @@ class XendConfig(dict):
@param dominfo: Domain information via xc.domain_getinfo()
@type dominfo: dict
"""
- self._dominfo_to_xapi(dominfo)
+ if dominfo['paused']:
+ self._dominfo_to_xapi(dominfo)
+ else:
+ self._dominfo_to_xapi(dominfo, update_mem = True)
self.validate()
def update_with_xenapi_config(self, xapi):
--
1.8.1.2
On 06/05/2013 03:01 PM, Matt Wilson wrote:
> This change allows xend to double-check the xcinfo info (which
> >hypercall it had already do) and use the up-to-date contents.
> >
> >'xl' already does this by using the xcinfo.
> >
> >Oracle-Bug: 14553104 ( MEM(K) IN XENTOP MISMATCH MEMTOTAL IN /PROC/MEMINFO AND MEM IN "XM LIST")
> >Signed-off-by: Marcos Matsunaga<Marcos.Matsunaga@oracle.com>
> >Signed-off-by: Konrad Rzeszutek Wilk<konrad.wilk@oracle.com>
[-- Attachment #2: 0001-xend-Fix-xm-list-bug-reporting-incorrect-memory-size.patch --]
[-- Type: text/x-patch, Size: 1364 bytes --]
>From aec170275bef7f371d9a195f49a3e8790160dd0f Mon Sep 17 00:00:00 2001
From: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
Date: Thu, 27 Jun 2013 05:25:42 -0400
Subject: [PATCH] xend: Fix xm list bug reporting incorrect memory size
This change allows xend to double-check the xcinfo info (which
hypercall it had already do) and use the up-to-date contents.
'xl' already does this by using the xcinfo.
Oracle-Bug: 14553104 ( MEM(K) IN XENTOP MISMATCH MEMTOTAL IN /PROC/MEMINFO AND MEM IN "XM LIST")
Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
tools/python/xen/xend/XendConfig.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 5568d35..eb433a7 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -1042,7 +1042,10 @@ class XendConfig(dict):
@param dominfo: Domain information via xc.domain_getinfo()
@type dominfo: dict
"""
- self._dominfo_to_xapi(dominfo)
+ if dominfo['paused']:
+ self._dominfo_to_xapi(dominfo)
+ else:
+ self._dominfo_to_xapi(dominfo, update_mem = True)
self.validate()
def update_with_xenapi_config(self, xapi):
--
1.8.1.2
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-27 9:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-02 17:38 [PATCH] xend: Fix xm list bug reporting incorrect memory size Konrad Rzeszutek Wilk
2013-04-08 17:06 ` Ian Jackson
2013-04-12 15:15 ` Marcos E. Matsunaga
2013-05-06 20:31 ` Konrad Rzeszutek Wilk
2013-06-05 19:01 ` Matt Wilson
2013-06-27 9:29 ` Marcos E. Matsunaga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).