Messages in this thread | | | From | Noel Burton-Krahn <> | Subject | RE: How to read-protect a vm_area? | Date | Thu, 12 Feb 1998 11:01:21 -0800 |
| |
I'm working on distributing an entire process' memory space: code pages, heap, stack, everything. After working on this for a while, I found a group which are doing a similar thing for BSD: MOSIX (http://www.cs.huji.ac.il/labs/distrib/).
I've seen dipc, and it looks great. Good work!
Now, back to read-protecting pages... I'm looking at dipc-1.0, dipc/kernel/.../mm/fault.c, and dipc_shm_fault(). It looks like if a page fault is generated on read, dipc_shm_fault() should see it. Sorry, I guess that's not very helpful. pte_rdprotect() just clears the _PAGE_USER bit. Are you sure that that's happening in your change_protection()? If not, call pte_rdprotect() directly. My only other suggestion (that I'm sure you've tried already) is to put a printk() right in dipc_shm_fault() to see if you're actually getting the page fault that you expect.
--Noel
-----Original Message----- From: mshar@vax.ipm.ac.ir [SMTP:mshar@vax.ipm.ac.ir] Sent: Wednesday, February 11, 1998 1:15 PM To: noel@harleystreet.com Cc: linux-kernel@vger.rutgers.edu Subject: RE: How to read-protect a vm_area?
What DSM system were you working on?
My work concern DIPC (http://wallybox.cei.net/dipc). DIPC plants a handler in the page fault handling routine (arch/.../mm/fault.c) which allows it to take charge when necessary, by overriding normal kernel behaviousr.
As you have noted, making a page write-protected is no problem. DIPC also uses a modified change_protection to do so. Currently DIPC swaps the pages of a shm to make them read-and-write protected, but I'd rather do this just by the page protection bits.
Now, everything works when write-protection is involved: My handler in fault.c gets called, the shm contents are brought in, and then the kernel is allowed to do its normal processing.
But why the same technic does not work when one wants to make the pages read-protected? After making this modification, the program could just go on and read from the shm, without my handler being called.
swapping out works, but in DIPC's case, one has to copy and modify code from other parts of the kernel. This makes it harder to keep up with newer kernel releases, and opens the door to many bugs. Another consideration is that swapping out is potentially less efficient than the other method. This is when the pages are actually written to the swap area.
-Kamran
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |