xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* maximum memory size allocated by _xmalloc
@ 2012-07-11  9:13 Chulmin Kim
  2012-07-11  9:48 ` Andrew Cooper
  2012-08-13  8:08 ` Chulmin Kim
  0 siblings, 2 replies; 7+ messages in thread
From: Chulmin Kim @ 2012-07-11  9:13 UTC (permalink / raw)
  To: xen-devel

Hi all, 

I'm currently inserting my own code to adjust the several existing memory
ballooning works. 

To accomplish it, I manage some kind of statistics in Xen memory area. 

Using _xmalloc, I've allocated certain size of memory chunk for the data
structure. ( I varied it from 10kb to 24 MB.)

When the size is equal to 24 MB, xen won't boot anymore.  (stuck during the
xmalloc, according to my debugging. _xmalloc returns NULL.)
There was no problem when the size is below 12MB.

Is there any limitation such as max memory size for _xmalloc? 

I suspected xen heap size, but, it is no longer adjustable. Right? 

I hope somebody can give me a clue.  Thanks.

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

* Re: maximum memory size allocated by _xmalloc
  2012-07-11  9:13 maximum memory size allocated by _xmalloc Chulmin Kim
@ 2012-07-11  9:48 ` Andrew Cooper
  2012-07-12  0:01   ` Chulmin Kim
  2012-08-13  8:08 ` Chulmin Kim
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2012-07-11  9:48 UTC (permalink / raw)
  To: Chulmin Kim; +Cc: xen-devel@lists.xen.org

On 11/07/12 10:13, Chulmin Kim wrote:
> Hi all, 
>
> I'm currently inserting my own code to adjust the several existing memory
> ballooning works. 
>
> To accomplish it, I manage some kind of statistics in Xen memory area. 
>
> Using _xmalloc, I've allocated certain size of memory chunk for the data
> structure. ( I varied it from 10kb to 24 MB.)
>
> When the size is equal to 24 MB, xen won't boot anymore.  (stuck during the
> xmalloc, according to my debugging. _xmalloc returns NULL.)
> There was no problem when the size is below 12MB.
>
> Is there any limitation such as max memory size for _xmalloc? 
>
> I suspected xen heap size, but, it is no longer adjustable. Right? 
>
> I hope somebody can give me a clue.  Thanks.

_xmalloc will first try to use the size pools for allocation, and
failing that, try to allocate full pages.

As it is returning NULL, this probably means you no longer have 24MB of
free contiguous RAM to allocate.

~Andrew

>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

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

* Re: maximum memory size allocated by _xmalloc
  2012-07-11  9:48 ` Andrew Cooper
@ 2012-07-12  0:01   ` Chulmin Kim
  2012-07-12  9:07     ` Andrew Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Chulmin Kim @ 2012-07-12  0:01 UTC (permalink / raw)
  To: 'Andrew Cooper'; +Cc: xen-devel

> On 11/07/12 10:13, Chulmin Kim wrote:
> > Hi all,
> >
> > I'm currently inserting my own code to adjust the several existing
> > memory ballooning works.
> >
> > To accomplish it, I manage some kind of statistics in Xen memory area.
> >
> > Using _xmalloc, I've allocated certain size of memory chunk for the
> > data structure. ( I varied it from 10kb to 24 MB.)
> >
> > When the size is equal to 24 MB, xen won't boot anymore.  (stuck
> > during the xmalloc, according to my debugging. _xmalloc returns NULL.)
> > There was no problem when the size is below 12MB.
> >
> > Is there any limitation such as max memory size for _xmalloc?
> >
> > I suspected xen heap size, but, it is no longer adjustable. Right?
> >
> > I hope somebody can give me a clue.  Thanks.
> 
> _xmalloc will first try to use the size pools for allocation, and failing
that, try to
> allocate full pages.
> 
> As it is returning NULL, this probably means you no longer have 24MB of
free
> contiguous RAM to allocate.
> 
> ~Andrew
> 

Thanks for the reply, Andrew.

I have to check the contiguity. 

If it is the cause of the problem, then, how can I detour this problem? 

Other xen part calling xmalloc_array does not handle this problem as far as
I know. (only consider it as an error)

Should I split the data structure into two or more chunks? 



> >
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: maximum memory size allocated by _xmalloc
  2012-07-12  0:01   ` Chulmin Kim
@ 2012-07-12  9:07     ` Andrew Cooper
  2012-07-12  9:24       ` FW: " Chulmin Kim
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2012-07-12  9:07 UTC (permalink / raw)
  To: Chulmin Kim; +Cc: xen-devel@lists.xen.org

On 12/07/12 01:01, Chulmin Kim wrote:
>> On 11/07/12 10:13, Chulmin Kim wrote:
>>> Hi all,
>>>
>>> I'm currently inserting my own code to adjust the several existing
>>> memory ballooning works.
>>>
>>> To accomplish it, I manage some kind of statistics in Xen memory area.
>>>
>>> Using _xmalloc, I've allocated certain size of memory chunk for the
>>> data structure. ( I varied it from 10kb to 24 MB.)
>>>
>>> When the size is equal to 24 MB, xen won't boot anymore.  (stuck
>>> during the xmalloc, according to my debugging. _xmalloc returns NULL.)
>>> There was no problem when the size is below 12MB.
>>>
>>> Is there any limitation such as max memory size for _xmalloc?
>>>
>>> I suspected xen heap size, but, it is no longer adjustable. Right?
>>>
>>> I hope somebody can give me a clue.  Thanks.
>> _xmalloc will first try to use the size pools for allocation, and failing
> that, try to
>> allocate full pages.
>>
>> As it is returning NULL, this probably means you no longer have 24MB of
> free
>> contiguous RAM to allocate.
>>
>> ~Andrew
>>
> Thanks for the reply, Andrew.
>
> I have to check the contiguity. 
>
> If it is the cause of the problem, then, how can I detour this problem? 
>
> Other xen part calling xmalloc_array does not handle this problem as far as
> I know. (only consider it as an error)
>
> Should I split the data structure into two or more chunks? 

Personally, I would think that 24M is a stupidly large amount to be
trying to allocate with xmalloc and friends.

If you are using that much memory, it might be worth using
alloc_xenheap_pages() and working with full pages instead.

Why do you need so much space for memory statistics?

~Andrew

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

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

* FW:  maximum memory size allocated by _xmalloc
  2012-07-12  9:07     ` Andrew Cooper
@ 2012-07-12  9:24       ` Chulmin Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Chulmin Kim @ 2012-07-12  9:24 UTC (permalink / raw)
  To: xen-devel

> On 12/07/12 01:01, Chulmin Kim wrote:
> >> On 11/07/12 10:13, Chulmin Kim wrote:
> >>> Hi all,
> >>>
> >>> I'm currently inserting my own code to adjust the several existing 
> >>> memory ballooning works.
> >>>
> >>> To accomplish it, I manage some kind of statistics in Xen memory area.
> >>>
> >>> Using _xmalloc, I've allocated certain size of memory chunk for 
> >>> the data structure. ( I varied it from 10kb to 24 MB.)
> >>>
> >>> When the size is equal to 24 MB, xen won't boot anymore.  (stuck 
> >>> during the xmalloc, according to my debugging. _xmalloc returns
> >>> NULL.) There was no problem when the size is below 12MB.
> >>>
> >>> Is there any limitation such as max memory size for _xmalloc?
> >>>
> >>> I suspected xen heap size, but, it is no longer adjustable. Right?
> >>>
> >>> I hope somebody can give me a clue.  Thanks.
> >> _xmalloc will first try to use the size pools for allocation, and 
> >> failing
> > that, try to
> >> allocate full pages.
> >>
> >> As it is returning NULL, this probably means you no longer have 
> >> 24MB of
> > free
> >> contiguous RAM to allocate.
> >>
> >> ~Andrew
> >>
> > Thanks for the reply, Andrew.
> >
> > I have to check the contiguity.
> >
> > If it is the cause of the problem, then, how can I detour this problem?
> >
> > Other xen part calling xmalloc_array does not handle this problem as 
> > far as I know. (only consider it as an error)
> >
> > Should I split the data structure into two or more chunks?
> 
> Personally, I would think that 24M is a stupidly large amount to be 
> trying to allocate with xmalloc and friends.
> 
> If you are using that much memory, it might be worth using
> alloc_xenheap_pages() and working with full pages instead.
> 
> Why do you need so much space for memory statistics?
> 
> ~Andrew

OK. I will try alloc_xenheap_pages(). 

I am following up a research work (Dynamic Memory Balncing ~~), and it
maintains  a table which has an entry per page in the machine. 

My machine has large memory (different from that in the research work), so
it needs that amount of memory. 

Thanks!



> 
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com

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

* Re: maximum memory size allocated by _xmalloc
@ 2012-07-12  9:28 Chulmin Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Chulmin Kim @ 2012-07-12  9:28 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel


> On 12/07/12 01:01, Chulmin Kim wrote:
> >> On 11/07/12 10:13, Chulmin Kim wrote:
> >>> Hi all,
> >>>
> >>> I'm currently inserting my own code to adjust the several existing 
> >>> memory ballooning works.
> >>>
> >>> To accomplish it, I manage some kind of statistics in Xen memory area.
> >>>
> >>> Using _xmalloc, I've allocated certain size of memory chunk for 
> >>> the data structure. ( I varied it from 10kb to 24 MB.)
> >>>
> >>> When the size is equal to 24 MB, xen won't boot anymore.  (stuck 
> >>> during the xmalloc, according to my debugging. _xmalloc returns
> >>> NULL.) There was no problem when the size is below 12MB.
> >>>
> >>> Is there any limitation such as max memory size for _xmalloc?
> >>>
> >>> I suspected xen heap size, but, it is no longer adjustable. Right?
> >>>
> >>> I hope somebody can give me a clue.  Thanks.
> >> _xmalloc will first try to use the size pools for allocation, and 
> >> failing
> > that, try to
> >> allocate full pages.
> >>
> >> As it is returning NULL, this probably means you no longer have 
> >> 24MB of
> > free
> >> contiguous RAM to allocate.
> >>
> >> ~Andrew
> >>
> > Thanks for the reply, Andrew.
> >
> > I have to check the contiguity.
> >
> > If it is the cause of the problem, then, how can I detour this problem?
> >
> > Other xen part calling xmalloc_array does not handle this problem as 
> > far as I know. (only consider it as an error)
> >
> > Should I split the data structure into two or more chunks?
> 
> Personally, I would think that 24M is a stupidly large amount to be 
> trying to allocate with xmalloc and friends.
> 
> If you are using that much memory, it might be worth using
> alloc_xenheap_pages() and working with full pages instead.
> 
> Why do you need so much space for memory statistics?
> 
> ~Andrew

OK. I will try alloc_xenheap_pages(). 
But, isn't xmalloc (and its friends) already using alloc_xenheap_pages()? 



I am following up a research work (Dynamic Memory Balncing ~~), and it
maintains  a table which has an entry per page in the machine. 

My machine has large memory (different from that in the research work), so
it needs that amount of memory. 


Thanks!



> 
> --
> Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
> T: +44 (0)1223 225 900, http://www.citrix.com

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

* Re: maximum memory size allocated by _xmalloc
  2012-07-11  9:13 maximum memory size allocated by _xmalloc Chulmin Kim
  2012-07-11  9:48 ` Andrew Cooper
@ 2012-08-13  8:08 ` Chulmin Kim
  1 sibling, 0 replies; 7+ messages in thread
From: Chulmin Kim @ 2012-08-13  8:08 UTC (permalink / raw)
  To: xen-devel

Though the issue has been written one month ago,
I post my own experience on it.

Unfortunately, it was not the matter of the requested mem size or 
xmalloc function.
The problem was due to the free memory scrubbing.

I set my xmalloc code in the middle of the bootup code of xen after the 
free memory scrubbing function.
But the placement was wrong.

After i relocated the code line before the scrubbing function,
it worked perfectly.

Thanks for your help!


2012-07-11 오후 6:13, Chulmin Kim 쓴 글:
> Hi all,
>
> I'm currently inserting my own code to adjust the several existing memory
> ballooning works.
>
> To accomplish it, I manage some kind of statistics in Xen memory area.
>
> Using _xmalloc, I've allocated certain size of memory chunk for the data
> structure. ( I varied it from 10kb to 24 MB.)
>
> When the size is equal to 24 MB, xen won't boot anymore.  (stuck during the
> xmalloc, according to my debugging. _xmalloc returns NULL.)
> There was no problem when the size is below 12MB.
>
> Is there any limitation such as max memory size for _xmalloc?
>
> I suspected xen heap size, but, it is no longer adjustable. Right?
>
> I hope somebody can give me a clue.  Thanks.
>
>
>
> _______________________________________________
> 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] 7+ messages in thread

end of thread, other threads:[~2012-08-13  8:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11  9:13 maximum memory size allocated by _xmalloc Chulmin Kim
2012-07-11  9:48 ` Andrew Cooper
2012-07-12  0:01   ` Chulmin Kim
2012-07-12  9:07     ` Andrew Cooper
2012-07-12  9:24       ` FW: " Chulmin Kim
2012-08-13  8:08 ` Chulmin Kim
  -- strict thread matches above, loose matches on Subject: below --
2012-07-12  9:28 Chulmin Kim

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).