Hi Ingo, I'm the young UML hacker you met at OLS and who got your UML patches sent ;-) I've been studying your patch (and the whole Linux VM, indeed) in the past days, and I have some remarks, about the version of the code in 2.6.4-rc2-mm1 (which is the same you sent me) - I've now downloaded the version dropped from 2.6.5-mm1, but it doesn't seem to address those problems. Btw, I've now seen why that patch was dropped, but not why it wasn't resubmit. *) with your patch, remapped pages without MAP_INHERIT are IMHO not safe across swapout; re-swapping them in will pass through the arch-specific fault handler, which will check VMA's protections, and fail if the VMA originally had MAP_NONE. Or am I missing something? *) with the same binary, a call to mprotect() on a nonlinear VMA will no more change the protections over fremap'ed PTEs (more exactly, PTEs going through handle_pte_fault->do_file_page(), but it seems that _PAGE_FILE is only set by fremap()). Currently mprotect fixes up the VMA and changes the protections for present pages (see mm/mprotect.c:change_pte_range(), it's a no-op on not-present pages). On not-present pages, the new VMA protections are loaded, even in do_file_page. I propose adding a VM_NOINHERIT flag (reusing VM_MAPPED_COPY on MMU archs) to be set on VMA's on which protections are not to be inherited. Normal VMA's behave as before, as soon as I remap_file_pages without MAP_INHERIT (or with MAP_NOINHERIT, see below) that flag is set on the VMA, on which, then, mprotect won't work. *) btw, adding a new syscall is not needed, adding a MAP_NOINHERIT flag for remap_file_pages to ask for the new behaviour is more than enough: (inside sys_remap_file_pages) - if (__prot) - return err; + if (prot && !(flags & MAP_NOINHERIT)) + goto out; Also, I've seen that a lot of fixes from your code haven't been merged; in particular, currently MAP_PRIVATE | MAP_POPULATE is broken (while it was fixed by your patch, which only required VM_SHARED on the VMA if there was an actual non-linear mapping). *) I don't understand this hunk (inside filemap_populate, not replicated inside shmem_populate): struct page *page; int err; + /* + * mapping-removal fastpath: + */ + if ((vma->vm_flags & VM_SHARED) && + (pgprot_val(prot) == pgprot_val(PAGE_NONE))) { + zap_page_range(vma, addr, len); + return 0; + } + if (!nonblock) force_page_cache_readahead(mapping, vma->vm_file, I understand why it's done, but zap_page_range() will totally clear the PTE's, it won't set _PAGE_FILE on the PTEs (as far as I can see), causing the pages to be faulted again in, and this time linearly. This hunk is still in 2.6.5-mm1 (or so it seems). *) I don't understand at all the attached hunks in your patch (there's a long description about them). Verified they hadn't been dropped from the patch in 2.6.5-mm1 (or so it seems). Note: for 2.6.5-mm1, I'm referring to the patch inside the "dropped" directory in the archives. Bye and thanks for your attention. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade