Re: Re: maximum kernel addres space and its implication to user space memory allocation

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

 



On 1/21/06, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
> Hi ...
>
> Thanks for your kind reply..... I really appreciate it. The discussion
> still continues, however .... :)
>

humm :)

> This is what Fawaad said :
> >Yes, 128MB is wasted due to not usage of HIGHMEM :) but kernel can
> >satisfy the request of more memory as i mentioned above ! (CMIIW)
>
> Anyway, I forgot to set another assumption. Assume that there is no swap
> space at all, so it just pure 1GB RAM. Therefore, overcommit status is
> ignored.
>

Yes, I think so too !

> This makes me thinks, why kernel's limitation to directly map physical
> RAM up to 896 MB (in 3G/1G split, 32 bit CPU) becomes user space
> limitation too?
>
> To be precise, here is code fragment from __alloc_pages() in
> mm/page_alloc.c:
> ------------------------------------------------------------------------------
> for (i = 0; (z = zones[i]) != NULL; i++) {
>                min = z->pages_low + (1<<order) +
> z->protection[alloc_type];
>
>                if (z->free_pages < min)
>                        continue;
>
>                page = buffered_rmqueue(z, order, gfp_mask);
>                if (page)
>                        goto got_pg;
>
> ------------------------------------------------------------------------------
>
> From the above snippets, I come to conclusion that if there is no
> ZONE_HIGHMEM, then the page allocator will search only on ZONE_DMA
> (0-16 MB) and ZONE_NORMAL (16-896MB). __alloc_pages() is the "heart" of
> memory allocator, so IMHO it is also executed when user space calls
> malloc(). Maybe not directly, perhaps it is deferred until the page
> frame is actually needed and thus allocated as many as needed.
>
> Comments?
>

Yes, AFAIK __alloc_pages function is called from different/many ways
and will also be called against malloc might be indirectly when
actually that page is needed by user space application.

Although I never tried/installed linux without swap space (partition)
but I think that if there isn't any swap partition available then the
root partition will be used for swap space too ... please CMIIW ! And
if its correct then it will again allow user application to allocate
more memory then avaialble physically :) (but do tell me if its not
correct)


--
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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