Let me try... On Mon, Apr 28, 2008 at 3:03 PM, Andreas Leppert <wudmx@xxxxxx> wrote: > > Hello, > > some questions to the zones. > > 1) Suppose I have a machine with 512 MB RAM. How is the memory node > structured into zones? Is it in this way? > > ZONE_DMA: 1-16 MB > ZONE_NORMAL: 17-512 MB Correct... > That means, there is no high memory available for those machines with > less than 896 MB RAM ? Yes, because practically there is no need to map them. > 2) Am I right that access to the kernel in memory is as follows: > > Virtual Memory > > --------- > + + [kernel linear addresses] > + + > +-------+ <- 0xC0000000 [PAGE_OFFSET] > + + > + + > + + > + + [user-space lin. addresses] > + + > + + > + + > --------- <- 0x00000000 > > > Physical Memory > > --------- > + + > + + user > + + > +-------+ > + + kernel > --------- <- 0x00000000 > > > So, user-space linear addresses are always below 0xC0000000 and if a > user-process addresses something beyond this it is somehow prohibited. yes, but note that it assumes for 3:1 VM split. For another type of split, let's say 2:2, PAGE_OFFSET would be somewhere on start of 3rd GB. correct, prohibited because user mode privilege level >= kernel mode privilege level. > But in the "real" physical memory, the order is turned around: the > kernel resides in the lower regions of the memory and the user-space in > the upper regions. Is this correct? kernel codes/data are mostly mapped in lower physical address simply because they are mapped first. For modules, likely you will see them getting mapped on higher phys address because they are loaded later... > 3) Is ZONE_NORMAL used only for the kernel or also for user processes? kernel and user..... > 4) How much space is reserved for the kernel in the physical memory? i can't recall,all I remember some Megabytes are reserved for things like atomic allocations. > 5) I've read something about min_low_pfn, max_low_pfn and max_pfn. So > min_low_pfn is the first page frame number after the kernel (after _end). > max_low_pfn gives me the last page frame number which is accessible by > the kernel directly or in other words: the last page frame number which > is used by the kernel for its data structures and so on, max_low_pfn+1 > is the first page frame number of a user process. max_pfn is the last > page frame number available in the physical address space. > > I've read this: "In low memory machines, the max_pfn will be the same as > the max_low_pfn". In which page frames are the user-level processes then > stored? below max_pfn of course. pay attention again: max_low_pfn gives me the last page frame number which accessible by the kernel directly that means, they are pages that can be directly addressed...no need to temporarily mapping them into upper 128 MB of 4th GB address space. Remember that for every pages, they need to be mapped (in other word, we prepared PTE/PMD/PGD entry) so it can be addressed by virtual address. Again, we speak in protected mode. regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ