Jivin Markus Franke lays it down ...
> Hi David,
> 
> Zitat von David McCullough <[EMAIL PROTECTED]>:
> >Some likely ones to consider are:
> >
> >     arch/mips/mm/init.c:         paging_init
> >     arch/x86/kernel/setup_32.c:  zone_sizes_init
> >
> >They all seem to call:
> >
> >     free_area_init_nodes(max_zone_pfns);
> >
> >Though you may need to make sure the m68knommu code is doing the right
> >thing in this space,
> 
> thanks for the hint. I had a look at especially arch/mips/mm/init.c.  
> In case of CONFIG_FLATMEM, which I am using as well, they make a call  
> to free_area_init(). I am doing exactly the same.
> The zones get initialized as follows:
> 
> ---snip---
> unsigned long zones_size[MAX_NR_ZONES] = { 0, };
> zones_size[ZONE_DMA] = (16*1024*1024) >> PAGE_SHIFT;
> zones_size[ZONE_NORMAL] = (48*1024*1024) >> PAGE_SHIFT;
> free_area_init(zones_size);
> ---snap---
> 
> As far as I can see from the kernel messages, posted in a previous  
> mail, the zones seem to get allocated fine.
> 
> ---snip---
> DMA free:0kB min:252kB low:312kB high:376kB active:0kB inactive:0kB  
> present:16256kB pages_scanned:0 all_unreclaimable? yes
> lowmem_reserve[]: 0 47
> Normal free:45212kB min:760kB low:948kB high:1140kB active:0kB  
> inactive:0kB present:48768kB pages_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0
> DMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB  
> 0*2048kB 0*4096kB = 0kB
> Normal: 1*4kB 1*8kB 1*16kB 2*32kB 1*64kB 0*128kB 0*256kB 0*512kB  
> 0*1024kB 0*2048kB 11*4096kB = 45212kB
> 16384 pages of RAM
> 11306 free pages
> 4671 reserved pages
> --snap---
> 
> The messages above show that the slab allocator for the DMA zone  
> doesn't find any available memory chunks. But I see a message about  
> 16256kB DMA memory present as well!?!?!
> Might it have something to do with this "4671 reserved pages"? I have  
> the feeling that I have to free these pages properly so that they are  
> available for the slab allocator. Although I had a look at some other  
> code in "arch/"-directory I couldn't make out how to solve this issue.
> As soon as I do a kmalloc() to DMA_ZONE I run into troubles.

Look for the call to

        free_bootmem(memory_start, memory_end - memory_start);

Check the values for memory_start, this is where the pages are initially
freed for use by anyone.

Also,  not sure how you are planning to use this DMA zone,  if it for
general kmalloc type use then that is ok,  if you want dma_* routines to
use it perhaps have a look at:

        linux-2.6.x/arch/frv/kernel/setup.c
        linux-2.6.x/arch/frv/mb93090-mb00/pci-dma-nommu.c

and how it manages some consistent dma memory,

Cheers,
Davidm

-- 
David McCullough,  [EMAIL PROTECTED],   Ph:+61 734352815
Secure Computing - SnapGear  http://www.uCdot.org http://www.cyberguard.com
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to