Copy-on-write with vmalloc

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

 



Hello all,

I would like to clone a virtual address space so that the address spaces 
share physical pages until a write happens, at which point it would copy 
to a new physical page.  I've looked around and haven't found any 
documentation. Certainly fork() already does this, but is there already 
simple way to do it with a virtual address space?

That is, does anything already implement the hypothetical vmalloc_clone 
in this example (4k pages):

	v = vmalloc(1024*1024);

	v[0] = 1;
	v[4096] = 2;

	v_copy = vmalloc_clone(v);

	v_copy[0] = 3;     /* copy-on-write */

And then the following expressions would still be true:

	/* different pages */
	v[0] == 1;
	v_copy[0] == 3; 

	/* shared page */
	v[4096] == 2;
	v_copy[4096] == 2; 

Thank you for your help!

--
Eric Wheeler




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux