linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Big memory, no struct page allocation
@ 2002-06-23  8:55 David Chow
  2002-06-23  8:59 ` William Lee Irwin III
  0 siblings, 1 reply; 8+ messages in thread
From: David Chow @ 2002-06-23  8:55 UTC (permalink / raw)
  To: linux-mm

Dear all,

Hi, I've got a silly but serious question. I want to allocate a large 
buffer (>512MB) in kernel. Normally you use __get_free_page and handle 
it with page pointers. But when get to very large (say 1024MB), I will 
need to use 2 level of page pointer indirection to carry the page 
pointer array. I also find the total size of page struct is quite large 
when using lots of pages, what I want is to use memory pages without 
struct page, is this possible? By the way, can I use lots of memory in 
the kernel, something like 1GB of memory allocation when physically RAM 
available? Please give advise. Thanks.

regards,
David

--
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/

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

* Re: Big memory, no struct page allocation
  2002-06-23  8:55 Big memory, no struct page allocation David Chow
@ 2002-06-23  8:59 ` William Lee Irwin III
  2002-06-23 15:31   ` David Chow
  0 siblings, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2002-06-23  8:59 UTC (permalink / raw)
  To: David Chow; +Cc: linux-mm

On Sun, Jun 23, 2002 at 04:55:58PM +0800, David Chow wrote:
> Hi, I've got a silly but serious question. I want to allocate a large 
> buffer (>512MB) in kernel. Normally you use __get_free_page and handle 
> it with page pointers. But when get to very large (say 1024MB), I will 
> need to use 2 level of page pointer indirection to carry the page 
> pointer array. I also find the total size of page struct is quite large 
> when using lots of pages, what I want is to use memory pages without 
> struct page, is this possible? By the way, can I use lots of memory in 
> the kernel, something like 1GB of memory allocation when physically RAM 
> available? Please give advise. Thanks.

Try allocating it at boot-time with the bootmem allocator.


Cheers,
Bill
--
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/

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

* Re: Big memory, no struct page allocation
  2002-06-23  8:59 ` William Lee Irwin III
@ 2002-06-23 15:31   ` David Chow
  2002-06-27  1:38     ` William Lee Irwin III
  0 siblings, 1 reply; 8+ messages in thread
From: David Chow @ 2002-06-23 15:31 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-mm

William Lee Irwin III wrote:

>On Sun, Jun 23, 2002 at 04:55:58PM +0800, David Chow wrote:
>  
>
>>Hi, I've got a silly but serious question. I want to allocate a large 
>>buffer (>512MB) in kernel. Normally you use __get_free_page and handle 
>>it with page pointers. But when get to very large (say 1024MB), I will 
>>need to use 2 level of page pointer indirection to carry the page 
>>pointer array. I also find the total size of page struct is quite large 
>>when using lots of pages, what I want is to use memory pages without 
>>struct page, is this possible? By the way, can I use lots of memory in 
>>the kernel, something like 1GB of memory allocation when physically RAM 
>>available? Please give advise. Thanks.
>>    
>>
>
>Try allocating it at boot-time with the bootmem allocator.
>
>
>Cheers,
>Bill
>  
>
Thanks for suggestions, you mean this will allow no struct page or can 
use memory more than 1GB? Please make clear on direction, I would love 
to know. Thanks.

regards,
David


--
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/

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

* Re: Big memory, no struct page allocation
  2002-06-23 15:31   ` David Chow
@ 2002-06-27  1:38     ` William Lee Irwin III
  2002-06-30 18:38       ` David Chow
  0 siblings, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2002-06-27  1:38 UTC (permalink / raw)
  To: David Chow; +Cc: linux-mm

William Lee Irwin III wrote:
>> Try allocating it at boot-time with the bootmem allocator.

On Sun, Jun 23, 2002 at 11:31:28PM +0800, David Chow wrote:
> Thanks for suggestions, you mean this will allow no struct page or can 
> use memory more than 1GB? Please make clear on direction, I would love 
> to know. Thanks.

On 32-bit machines with 3:1 process address space splits yes.

In this case you're far better off playing games with the highmem
initialization in order to slice the memory out of there and kmap it.


Cheers,
Bill
--
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/

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

* Re: Big memory, no struct page allocation
  2002-06-27  1:38     ` William Lee Irwin III
@ 2002-06-30 18:38       ` David Chow
  2002-07-01 17:48         ` Rik van Riel
  0 siblings, 1 reply; 8+ messages in thread
From: David Chow @ 2002-06-30 18:38 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-mm

William Lee Irwin III wrote:

>William Lee Irwin III wrote:
>  
>
>>>Try allocating it at boot-time with the bootmem allocator.
>>>      
>>>
>
>On Sun, Jun 23, 2002 at 11:31:28PM +0800, David Chow wrote:
>  
>
>>Thanks for suggestions, you mean this will allow no struct page or can 
>>use memory more than 1GB? Please make clear on direction, I would love 
>>to know. Thanks.
>>    
>>
>
>On 32-bit machines with 3:1 process address space splits yes.
>
>In this case you're far better off playing games with the highmem
>initialization in order to slice the memory out of there and kmap it.
>
>
>Cheers,
>Bill
>  
>
In other words, even I have 2G physical memory, I cannot have benefits 
of using all memory for pagecache, this also means I cannot create any 
cache beyong a 1G size in kernel. That's a pitty for 32-bit systems, 
with himem, how does it work?

David


--
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/

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

* Re: Big memory, no struct page allocation
  2002-06-30 18:38       ` David Chow
@ 2002-07-01 17:48         ` Rik van Riel
  2002-07-02  6:06           ` William Lee Irwin III
  0 siblings, 1 reply; 8+ messages in thread
From: Rik van Riel @ 2002-07-01 17:48 UTC (permalink / raw)
  To: David Chow; +Cc: William Lee Irwin III, linux-mm

On Mon, 1 Jul 2002, David Chow wrote:

> In other words, even I have 2G physical memory, I cannot have benefits
> of using all memory for pagecache, this also means I cannot create any
> cache beyong a 1G size in kernel. That's a pitty for 32-bit systems,
> with himem, how does it work?

Pagecache can use highmem just fine.

regards,

Rik
-- 
Bravely reimplemented by the knights who say "NIH".

http://www.surriel.com/		http://distro.conectiva.com/

--
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/

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

* Re: Big memory, no struct page allocation
  2002-07-01 17:48         ` Rik van Riel
@ 2002-07-02  6:06           ` William Lee Irwin III
  2002-07-03 16:16             ` David Chow
  0 siblings, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2002-07-02  6:06 UTC (permalink / raw)
  To: Rik van Riel; +Cc: David Chow, linux-mm

On Mon, 1 Jul 2002, David Chow wrote:
>> In other words, even I have 2G physical memory, I cannot have benefits
>> of using all memory for pagecache, this also means I cannot create any
>> cache beyong a 1G size in kernel. That's a pitty for 32-bit systems,
>> with himem, how does it work?

On Mon, Jul 01, 2002 at 02:48:00PM -0300, Rik van Riel wrote:
> Pagecache can use highmem just fine.
> regards,
> Rik

Yes, pagecache doesn't care where it is, it just works with the
struct pages for the memory. Things that are more internal like
dcache and buffer cache need to be allocated from ZONE_NORMAL,
as the kernel actually touches that memory directly.


Cheers,
Bill
--
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/

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

* Re: Big memory, no struct page allocation
  2002-07-02  6:06           ` William Lee Irwin III
@ 2002-07-03 16:16             ` David Chow
  0 siblings, 0 replies; 8+ messages in thread
From: David Chow @ 2002-07-03 16:16 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: Rik van Riel, linux-mm

William Lee Irwin III wrote:

>On Mon, 1 Jul 2002, David Chow wrote:
>  
>
>>>In other words, even I have 2G physical memory, I cannot have benefits
>>>of using all memory for pagecache, this also means I cannot create any
>>>cache beyong a 1G size in kernel. That's a pitty for 32-bit systems,
>>>with himem, how does it work?
>>>      
>>>
>
>On Mon, Jul 01, 2002 at 02:48:00PM -0300, Rik van Riel wrote:
>  
>
>>Pagecache can use highmem just fine.
>>regards,
>>Rik
>>    
>>
>
>Yes, pagecache doesn't care where it is, it just works with the
>struct pages for the memory. Things that are more internal like
>dcache and buffer cache need to be allocated from ZONE_NORMAL,
>as the kernel actually touches that memory directly.
>
>
>Cheers,
>Bill
>  
>
Thanks for advice, that means allocation of slab cache never gets over 
1G? Since you mention dcache, where dcache uses kmem_cache_create() 
calls, or it depends on the flags pass to kmem_cache_create()? What 
about kmalloc()?

Since before access a page, we have to do kmap(page), how does this 
pointer address work? I found that if my machine have less than physical 
1G RAM (actually somewhere between 900-940M), I don't have to call 
kmap() before really accessing the page data, if more than this amount 
of memory, it will result an oops. It seems for system that has more 
than 900M memory, kernel handle page data differently (need to use kmap 
before accessing the page data). Is it true that kmap only translate the 
page into a virtual address if more than 1G RAM or leave it physical is 
less than 1G RAM? I am a bit confuse in this behaviour of kmap().

regards,
David


--
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/

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

end of thread, other threads:[~2002-07-03 16:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-23  8:55 Big memory, no struct page allocation David Chow
2002-06-23  8:59 ` William Lee Irwin III
2002-06-23 15:31   ` David Chow
2002-06-27  1:38     ` William Lee Irwin III
2002-06-30 18:38       ` David Chow
2002-07-01 17:48         ` Rik van Riel
2002-07-02  6:06           ` William Lee Irwin III
2002-07-03 16:16             ` David Chow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox