All of lore.kernel.org
 help / color / mirror / Atom feed
* memory_reservation bug?
@ 2009-03-11 17:32 Mick Jordan
  2009-03-11 18:08 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Mick Jordan @ 2009-03-11 17:32 UTC (permalink / raw)
  To: xen-devel-list

Superficially this trace suggests a bug in the memory-reservation code:

Bootstrapping...
increase_reservation 155028 using 65536 .. returned 155028
increase_reservation 35596 using 220564 .. returned 35596
decrease_reservation 194384..256160 (61776) .. returned 61776
decrease_reservation 186634..194384 (7750) .. returned 7750
decrease_reservation 104935..186634 (81699) .. returned 81699
decrease_reservation 79981..104935 (24954) .. returned 24954
increase_reservation 122328 using 79981 (xVM) page_alloc.c:782:d172 
Over-allocation for domain 172: 262145 > 262144
(xVM) memory.c:127:d172 Could not allocate order=0 extent: id=172 
memflags=0 (5984 of 122328)
.. returned 5984

This is a domain starting with 256MB with maxmem at 1GB. The increase 
and decrease calls all return apparently correctly, but the final 
increase suggests that there is a miscounting of the allocated pages to 
the domain. This is Xen 3.1.4 and Solaris xVM (if that matters).

The "using" indicates where in the physmap the increase should occur and 
the range on the decrease is the pfns being given up.

I've looked at the code in memory.c and page_alloc.c and Xen certainly 
thinks tot_pages > max_pages for the domain when it reports the error.

The extent_order on the reservations is 0.

Any ideas?

Mick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memory_reservation bug?
  2009-03-11 17:32 memory_reservation bug? Mick Jordan
@ 2009-03-11 18:08 ` Keir Fraser
  2009-03-11 19:34   ` Mick Jordan
  2009-03-11 19:50   ` memory_reservation bug?: memory holes Mick Jordan
  0 siblings, 2 replies; 5+ messages in thread
From: Keir Fraser @ 2009-03-11 18:08 UTC (permalink / raw)
  To: Mick.Jordan@sun.com, xen-devel-list

On 11/03/2009 17:32, "Mick Jordan" <Mick.Jordan@sun.com> wrote:

> I've looked at the code in memory.c and page_alloc.c and Xen certainly
> thinks tot_pages > max_pages for the domain when it reports the error.
> 
> The extent_order on the reservations is 0.
> 
> Any ideas?

Just because you called decrease_reservation() doesn't mean the pages
necessarily really got freed. If you still have mappings to them squirrelled
away then the free can be deferred.

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memory_reservation bug?
  2009-03-11 18:08 ` Keir Fraser
@ 2009-03-11 19:34   ` Mick Jordan
  2009-03-11 19:50   ` memory_reservation bug?: memory holes Mick Jordan
  1 sibling, 0 replies; 5+ messages in thread
From: Mick Jordan @ 2009-03-11 19:34 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel-list


[-- Attachment #1.1: Type: text/plain, Size: 820 bytes --]

On 03/11/09 11:08, Keir Fraser wrote:
> On 11/03/2009 17:32, "Mick Jordan" <Mick.Jordan@sun.com> wrote:
>
>   
>> I've looked at the code in memory.c and page_alloc.c and Xen certainly
>> thinks tot_pages > max_pages for the domain when it reports the error.
>>
>> The extent_order on the reservations is 0.
>>
>> Any ideas?
>>     
>
> Just because you called decrease_reservation() doesn't mean the pages
> necessarily really got freed. If you still have mappings to them squirrelled
> away then the free can be deferred.
>   
Ah, that explains it, thank you. I was taking the fact that the return 
value equaled the number I tried to decrease meant that it really did 
decrease by that amount. But, owing to a bug, I do in fact have mappings 
still lying around.

Xen really does need a developer manual -;)

Mick




[-- Attachment #1.2: Type: text/html, Size: 1320 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memory_reservation bug?: memory holes
  2009-03-11 18:08 ` Keir Fraser
  2009-03-11 19:34   ` Mick Jordan
@ 2009-03-11 19:50   ` Mick Jordan
  2009-03-11 22:41     ` Keir Fraser
  1 sibling, 1 reply; 5+ messages in thread
From: Mick Jordan @ 2009-03-11 19:50 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel-list

On 03/11/09 11:08, Keir Fraser wrote:
>
> Just because you called decrease_reservation() doesn't mean the pages
> necessarily really got freed. If you still have mappings to them squirrelled
> away then the free can be deferred.
>   
A related question. I assume it is ok to have holes in the physical 
memory, i.e. call decrease_reservation with a range << max_pfn. In this 
case, what are the rules for the value in the P2M table? Does Xen zero 
out the slot or is it the guest's responsibility?  save/restore must be 
able to determine that a hole exists.

Mick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memory_reservation bug?: memory holes
  2009-03-11 19:50   ` memory_reservation bug?: memory holes Mick Jordan
@ 2009-03-11 22:41     ` Keir Fraser
  0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2009-03-11 22:41 UTC (permalink / raw)
  To: Mick.Jordan@sun.com; +Cc: xen-devel-list

On 11/03/2009 19:50, "Mick Jordan" <Mick.Jordan@sun.com> wrote:

> A related question. I assume it is ok to have holes in the physical
> memory, i.e. call decrease_reservation with a range << max_pfn. In this
> case, what are the rules for the value in the P2M table? Does Xen zero
> out the slot or is it the guest's responsibility?  save/restore must be
> able to determine that a hole exists.

The P2M is completely in your control. Xen doesn't care about it. The
toolstack cares about it only for save/restore -- there I think any invalid
value stuffed in an empty slot would work just fine.

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-11 22:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 17:32 memory_reservation bug? Mick Jordan
2009-03-11 18:08 ` Keir Fraser
2009-03-11 19:34   ` Mick Jordan
2009-03-11 19:50   ` memory_reservation bug?: memory holes Mick Jordan
2009-03-11 22:41     ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.