On 4/17/07, Shreyansh <shreyansh.jain@xxxxxxxxx> wrote:
Hi All, On 4/17/07, Rajat Jain <rajat.noida.india@xxxxxxxxx> wrote: > Hi Adil, > > > > > So that means the Zone DMA (on x86 upto 16MB) is mapped first i.e. to > > 0xC0000000? > > > > Furthermore the virtual field in the page structure coresponds to this > > kernel logical address and it never changes if the page belongs to > > ZONE_NORMAL? > > IMHO, yes. Does that also mean that the kernel image is loaded in the RAM memory region corresponding to ZONE_DMA? I am concluding this from the fact that the kernel image (bzImage) is loaded at the *physical location* 0x100000 (which corresponds to 1048576 or 1 MB). - as mentioned in Understanding the Linux Kernel (Booting process). If that is right, does this effect any DMA'able devices' way of addressing the 16MB of dedicated DMA zone - or am I confusing ZONE_DMA and DMA'ble memory?
ZONE_DMA IS the DMA'able memory (since some device simply CANNOT perform DMA to memory other than this). Although modern devices MAY work with Normal memory itself. Not sure about your doubt though ....
Also, in my understanding, pages allocated using kmalloc are from ZONE_NORMAL. Hence, if the above argument is right, does that mean that we can use *only* the (<total physical RAM> - 16MB)physical memory OR (896MB virtual - 16MB of Zone_DMA)virtual addresses??
This is what Robert love states in his book about the GFP flag: "If neither flag is specified, the kernel fulfills the allocation from either ZONE_DMA or ZONE_NORMAL, with a strong preference to satisfy the allocation from ZONE_NORMAL. No zone flag essentially says, I don't care so long as it behaves normally." So, if if no GFP is specified, the allocatroe TRIES to get you the NORMAL memory, but should the need be, it MAY give you DMA memory as well. Although I could not find the pinpointing code, but still comments scattered throughout the kernel testify the above. For, e.g., in include/linux/mmzone: /* * One allocation request operates on a zonelist. A zonelist * is a list of zones, the first one is the 'goal' of the * allocation, the other zones are fallback zones, in decreasing * priority. * The code uses get_page_from_freelist() to walk the list of Zones suitable for this request. HTH, Rajat -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ