Re: Doubt regarding memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2007-02-25 at 01:16 +0530, Mansha Linux wrote:
> hi all,
> 
> For a 32-bit machine, there is total 4GB of memory(Physiacl
> addresses). So in that 1 GB for Kernel and 3GB for User Space.
  For a 32-bit machine 4GB is the maximum physical memory(if you dont
have PAE). And the Kernel maps the whole of physical memory into its own
linear address space first i.e. 0xc0000000 - 0xffffffff, 3GB - 4GB part
of the virtual address space. So eg. if you have a machine with 1GB of
contiguous ram, this 1GB of physical memory is mapped by the kernel
first.

> So, kernel won't access that 3GB of memory, right?
> All the kernel code is exist in 1 GB of memory.... CMIIW

  Then each process created has page table describing its own 4GB of
virtual address space, out of which the last 1GB is always the same and
that is the kernel.


> 
> So, my doubt is  the DMA(0-16MB),NORMAL(16-896MB),HIGH(896MB-) memory
> divided within this 4GB of memory ,right?
   Yes, these zones are divided within the physical memory available, so
u will need ZONE_HIGHMEM if you have phys memory greater than that of
the range of ZONE_NORMAL.
> 
> if we allocate the pages using alloc_pages, from which region the
> pages are allocated for the kernel modules. is it from Physical RAM
> memory or from 1GB of kernel space ??

   This probably depends upon the gfp_mask value, if you want the
ZONE_DMA pages, u need to have GFP_DMA in the flags, otherwise it will
try and allocate pages from ZONE_NORMAL. If you dont mind the zone page
allocator to allocate from HIGHMEM(if not available in NORMAL) then you
should specify GFP_HIGHMEM.(but the ZONE_HIGHMEM, doesnt mean it _will_
allocate from HIGH MEM unline GFP_DMA);

please CMMIW in explaining this ;)
> 
> -- 
> regards,
> Mansha


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux