login
Header Space

 
 

Re: copy-on-write anonymous memory?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kostik Belousov <kostikbel@...>
Cc: <freebsd-hackers@...>
Date: Thursday, May 15, 2008 - 10:51 am

Teemu Rinta-aho wrote:

New problems... Let me first describe what I try to do:

I have created a kernel module that stores references to
memory objects. I.e. when a process makes a syscall to
the module, it will create a snapshot of the memory
area, and after that the writes from the process to
that memory area should create a shadow object. The
next syscall should again store a pointer to the current
topmost shadow object and then the next write creates
yet another shadow object. Etc... When the snapshots
are removed, the shadow chains may collapse normally.
That's what I have assumed.

Here's an illustration of what I want (first syscall
OK, second one not):

     *
     * Legend: U/u = userspace K/k = kernel
     *
     * U:vm_map_entry_u -> object
     *
     *             ||
     *           SYSCALL
     *             ||
     *             \/
     *
     * U:vm_map_entry_u -> object_shadow -> object
     *                                  /
     * K:vm_map_entry_k ----------------
     *
     *             ||
     *           SYSCALL
     *             ||
     *             \/
     *
     * U:vm_map_entry_u -> object_shadow -> object_shadow -> object
     *                                  /                /
     * K:vm_map_entry_k ----------------                /
     * K:vm_map_entry_k --------------------------------

Now, the problem is that the first snapshot works
as it should. However, the second one doesn't, and
the write goes to the one and same shadow object,
even if I restore MAP_ENTRY_COW and MAP_ENTRY_NEEDS_COPY
manually in my handler function which is storing the
snapshot.

Any ideas?

Teemu
_______________________________________________
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