[lkml]   [2002]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectpagecoloring: kernel 2.2 mm question: what is happening during fork ?
Hello lkml,

I have a few questions about memory management:

When I do a fork, which part of the kernel is allocating the memory for
the childs, where and when the memory copy takes place ? I know that
linux is doing copy on write but I don't know which part of the kernel
is really doing the page allocation when the copy on write understands
that the process really wants to write now. Then the second question is
how is the memory copy done ?

The third and last question is what is the role of the slab allocator ?
When does a process asks for memory from a slab ? Is it used to build
the stack the heap ?

I have looked many web pages but none of them were clear to me.

If you have time, my whole problem is described here:

More context:

I am currently working to add page coloring into the linux kernel
version 2.2.19 (I am using Alpha with big direct mapped L1 so
page coloring is really necessary to have good stable perfs)

I started from a patch found on the web and it basically just
rewrapps some get_free_page calls to a get_free_page_by_address
routine that checks the virtual address and looks for a page which
is correctly aligned.

To sumup:

All calls to get_free_page in filemap.c have been replaced by
In memory.c the do_anonymous contains a get_free_page replaced by a

The patch is really doing nice job on simple cases (fortran monothread
code) but it fails on the following code:

char* a;
int i,n=0;


a=malloc(sizeof(char)*1024*8*10); /*reserve ten pages (8k*10)


sleep (1<<n);


It simply fails because the page_coloring_code is bypassed when doing
forks... but
I could not find which part of the linux kernel code is doing the memory
for the forked processes.

thanks for any help


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:18    [W:0.056 / U:3.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site