linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* way to allocate memory within a range ?
@ 2010-02-24  0:46 Auguste Mome
  2010-02-24  1:47 ` David Rientjes
  2010-02-24  1:53 ` KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 5+ messages in thread
From: Auguste Mome @ 2010-02-24  0:46 UTC (permalink / raw)
  To: linux-mm

Hello,
I'd like to use kmem_cache() system, but need the memory taken from a
specific range if requested, outside the range otherwise.
I think about adding new zone and define new GFP flag to either select or
ignore the zone. Does it sound possible? Then I welcome any hint if you know
where to add the appropriated test in allocator, how to attach the
region to the new zone id).

Or slab/slub system is not designed for this, I should forget it and
opt for another system?

August.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: way to allocate memory within a range ?
  2010-02-24  0:46 way to allocate memory within a range ? Auguste Mome
@ 2010-02-24  1:47 ` David Rientjes
  2010-02-24 15:35   ` Christoph Lameter
  2010-02-24  1:53 ` KAMEZAWA Hiroyuki
  1 sibling, 1 reply; 5+ messages in thread
From: David Rientjes @ 2010-02-24  1:47 UTC (permalink / raw)
  To: Auguste Mome; +Cc: Christoph Lameter, Pekka Enberg, linux-mm

On Wed, 24 Feb 2010, Auguste Mome wrote:

> I'd like to use kmem_cache() system, but need the memory taken from a
> specific range if requested, outside the range otherwise.
> I think about adding new zone and define new GFP flag to either select or
> ignore the zone. Does it sound possible? Then I welcome any hint if you know
> where to add the appropriated test in allocator, how to attach the
> region to the new zone id).
> 
> Or slab/slub system is not designed for this, I should forget it and
> opt for another system?
> 

No slab allocator is going to be designed for that other than SLAB_DMA to 
allocate from lowmem.  If you don't have need for lowmem, why do you need 
memory only from a certain range?  I can imagine it would have a usecase 
for memory hotplug to avoid allocating slab that cannot be reclaimed on 
certain nodes, but ZONE_MOVABLE seems more appropriate to guarantee such 
migration properties.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: way to allocate memory within a range ?
  2010-02-24  0:46 way to allocate memory within a range ? Auguste Mome
  2010-02-24  1:47 ` David Rientjes
@ 2010-02-24  1:53 ` KAMEZAWA Hiroyuki
  1 sibling, 0 replies; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-02-24  1:53 UTC (permalink / raw)
  To: Auguste Mome; +Cc: linux-mm

On Wed, 24 Feb 2010 01:46:49 +0100
Auguste Mome <augustmome@gmail.com> wrote:

> Hello,
> I'd like to use kmem_cache() system, but need the memory taken from a
> specific range if requested, outside the range otherwise.
> I think about adding new zone and define new GFP flag to either select or
> ignore the zone. Does it sound possible? Then I welcome any hint if you know
> where to add the appropriated test in allocator, how to attach the
> region to the new zone id).
> 
> Or slab/slub system is not designed for this, I should forget it and
> opt for another system?
> 
I think you can find adding a new zone is very hard.
please forget.

But for what purpose you want to specifiy phyiscal address of memory ?

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: way to allocate memory within a range ?
  2010-02-24  1:47 ` David Rientjes
@ 2010-02-24 15:35   ` Christoph Lameter
  2010-03-21  9:38     ` Auguste Mome
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Lameter @ 2010-02-24 15:35 UTC (permalink / raw)
  To: David Rientjes; +Cc: Auguste Mome, Pekka Enberg, linux-mm

On Tue, 23 Feb 2010, David Rientjes wrote:

> > Or slab/slub system is not designed for this, I should forget it and
> > opt for another system?
> >
>
> No slab allocator is going to be designed for that other than SLAB_DMA to
> allocate from lowmem.  If you don't have need for lowmem, why do you need
> memory only from a certain range?  I can imagine it would have a usecase
> for memory hotplug to avoid allocating slab that cannot be reclaimed on
> certain nodes, but ZONE_MOVABLE seems more appropriate to guarantee such
> migration properties.

Awhile ago I posted a patch to do just that. It was called
alloc_pages_range() and the intend was to replace the dma zone.

http://lkml.indiana.edu/hypermail/linux/kernel/0609.2/2096.html

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: way to allocate memory within a range ?
  2010-02-24 15:35   ` Christoph Lameter
@ 2010-03-21  9:38     ` Auguste Mome
  0 siblings, 0 replies; 5+ messages in thread
From: Auguste Mome @ 2010-03-21  9:38 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: David Rientjes, Pekka Enberg, linux-mm

OK thanks for your comments, I found that mempool() API can do the job
I need, because
I can live with a fixed size for allocated object, so I plan to
populate the pool by adding all the
"cells" of the given range.
My use case is another module aside Linux that would map the the same
memory area.

August.

On Wed, Feb 24, 2010 at 4:35 PM, Christoph Lameter
<cl@linux-foundation.org> wrote:
> On Tue, 23 Feb 2010, David Rientjes wrote:
>
>> > Or slab/slub system is not designed for this, I should forget it and
>> > opt for another system?
>> >
>>
>> No slab allocator is going to be designed for that other than SLAB_DMA to
>> allocate from lowmem.  If you don't have need for lowmem, why do you need
>> memory only from a certain range?  I can imagine it would have a usecase
>> for memory hotplug to avoid allocating slab that cannot be reclaimed on
>> certain nodes, but ZONE_MOVABLE seems more appropriate to guarantee such
>> migration properties.
>
> Awhile ago I posted a patch to do just that. It was called
> alloc_pages_range() and the intend was to replace the dma zone.
>
> http://lkml.indiana.edu/hypermail/linux/kernel/0609.2/2096.html
>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2010-03-21  9:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24  0:46 way to allocate memory within a range ? Auguste Mome
2010-02-24  1:47 ` David Rientjes
2010-02-24 15:35   ` Christoph Lameter
2010-03-21  9:38     ` Auguste Mome
2010-02-24  1:53 ` KAMEZAWA Hiroyuki

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