Hello I learned that the ZONE_DMA size is 16MB from the book KDE, but on my laptop the ZONE_SIZE is maybe 12M. I print the page directory informations, and from the NO.768 to NO.770 pte is not direct mapping until the NO.771 pte. So, how can I get the ZONE_DMA real size ? Is there any kernel functions or configuration files ? I want to get the accurate number. Thanks, HeChuan
On Mon, 12 May 2014 15:14:11 +0800, RS said:
So, how can I get the ZONE_DMA real size ? Is there any kernel functions or configuration files ? I want to get the accurate number.
What question are you trying to answer with that number? There's a good chance that you're looking for something else entirely...
At 2014-05-13 04:02:28,Valdis.Kletnieks@vt.edu wrote:
On Mon, 12 May 2014 15:14:11 +0800, RS said:
So, how can I get the ZONE_DMA real size ? Is there any kernel functions or configuration files ? I want to get the accurate number.
What question are you trying to answer with that number? There's a good>chance that you're looking for something else entirely... I have writed a module to print a process's pgd(task_struct->mm->pdg).here is output sample:-------------------------task bash, pid 1654pde_index valueNO.0 00000000NO.1 3ae9d067NO.2 3af55067NO.3 00000000...NO.767 3af57067NO.768 00b41067NO.769 36064063NO.770 36065063NO.771 00c001e3NO.772 010001e3NO.773 014001e3...from the index 0 to 767, is pde represent for the user mode memory space, the kernel space start with the index 768. So the ZONE_DMA start with the same place. The NO.771 pde value 00c001e3 determine the entry is use for a 4M size page, and the physical address of the page frame has a 0xc0000000 offset with the virtual address. So I think this place is the entry of ZONE_NORMAL. So only the three pde NO.768, 769, 770 is use for ZONE_DMA, one pde can indicate a 4M size page, no mater the pde is use for a page table or a large page frame, the ZONE_DMA size is 3 * 4M = 12M in my machine.is that right ? ZONE_DMA is not the 16M .
Thanks, HeChuan
On Mon, May 12, 2014 at 11:14 AM, RS <tinyshrimp@163.com> wrote:
So, how can I get the ZONE_DMA real size ? Is there any kernel functions or configuration files ? I want to get the accurate number.
Take a look at the /proc/zoneinfo file in your running kernel. It will tell you where each zone starts ('start_pfn' lines) and how many pages there are ('pages spanned' lines). -- Thanks. -- Max
participants (3)
-
Max Filippov -
RS -
Valdis.Kletnieks@vt.edu