login
Header Space

 
 

copy-on-write anonymous memory?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <freebsd-hackers@...>
Date: Thursday, May 15, 2008 - 6:20 am

Hi all,

is it possible to create a memory object that represents
anonymous memory pages *and* is copy-on-write?

I have this code in a kernel module:

    object = vm_object_allocate(OBJT_DEFAULT, 1);

    result = vm_map_find(vmmap_proc,
                         object,
                         0,
                         &addr,
                         len,
                         TRUE,
                         VM_PROT_ALL,
                         VM_PROT_ALL,
                         MAP_COPY_ON_WRITE);

Then I pass the addr to the user space, but when
I write to the addr, I see no shadow objects created,
i.e. the changes are written to the original memory
pages no matter if I have the map entry set as
copy-on-write or not... I am assuming a write fault would
create a new page and hang it to a shadow object thus
leaving the original memory untouched.

I'd appreciate any kind of help here.

Best regards,
Teemu Rinta-aho
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
copy-on-write anonymous memory?, Teemu Rinta-aho, (Thu May 15, 6:20 am)
Re: copy-on-write anonymous memory?, Kostik Belousov, (Thu May 15, 7:18 am)
Re: copy-on-write anonymous memory?, Teemu Rinta-aho, (Thu May 15, 8:33 am)
Re: copy-on-write anonymous memory?, Teemu Rinta-aho, (Thu May 15, 10:51 am)
Re: copy-on-write anonymous memory?, Mark Tinguely, (Fri May 16, 10:34 am)
Re: copy-on-write anonymous memory?, Teemu Rinta-aho, (Fri May 16, 11:08 am)
speck-geostationary