A second naive question.
Imagine that thread A performs separate map operations to each of B and C (maps of the same thing). This results in a dependency relationship of the form:
A / \ B C
Given that these operations have happened, is there a way for A to revoke the mapping held by B without also revoking the mapping held by C?
Does it matter?
"Jonathan S. Shapiro" shap@eros-os.org writes:
A second naive question.
Imagine that thread A performs separate map operations to each of B and C (maps of the same thing). This results in a dependency relationship of the form:
A / \
B C
Given that these operations have happened, is there a way for A to revoke the mapping held by B without also revoking the mapping held by C?
No.
Does it matter?
In the context of L4Linux we discussed whether it would be useful to be able to unmap pages in a certain address space. It could be used during execve to unmap pages of the child process while leaving the mapping of the parent intact. And there are a lot of shared pages like pages from shared libraries which should be unmapped only in the one process.
We are able to ignore the problem because we:
- track which pages are actually mapped and reduce the necessary unmap operations
- handle process termination and execve in a special way. We don't unmap the pages, we kill the address space instead.
So I think this is a useful operation.
Regards, Jean
Jean Wolter jean.wolter@inf.tu-dresden.de writes:
So I think this [ unmap a page in a certain address space ] is a useful operation.
PS: I forgot a really nasty interaction with grant. If I take the example of the other thread:
A / \ B C
Assuming A doesn't know that B constructed the dependency between A and C (either using map/grant or co-equal mapping) and A unmaps the page only in the address space of B there is still the mapping in the address space of C.
So to make unmap(page, adress space) actually usable you would need a possibility to prohibit the grant operation for a page.
Regards, Jean
Jean Wolter wrote:
PS: I forgot a really nasty interaction with grant. If I take the example of the other thread:
A / \ B C
Assuming A doesn't know that B constructed the dependency between A and C (either using map/grant or co-equal mapping) and A unmaps the page only in the address space of B there is still the mapping in the address space of C.
So to make unmap(page, adress space) actually usable you would need a possibility to prohibit the grant operation for a page.
All you need is to be able to identify the mapping even if it has been granted away. The question is more how to engineer the mapping database such that the unmap (page_A, B) is possible. One way would be to add a second address space field into the mapping node.
I think the harder problem is to select the appropriate mapping. First, the page has to be specified as an address in A, since A usually does not know about B's address space layout (small receive flexpage). This however would mean to search through all children of A which would be very costly in most mdb implementations (dfs sorted the linked list based ones).
Marcus
l4-hackers@os.inf.tu-dresden.de