Let's open a bug for a WIP patch, fixing a few bugs.
- There is no reason for subsections marked with IMAGE_SCN_CNT_UNINITIALIZED_DATA to always be considered as private.
- Fix a race condition : when paging out a file section, old Mm lists all of the process maps, removing them one after the other and lowering the page reference count in the process. Sometimes a page fault occur in the process, the mapping is added, but the page refcount is not bumped because it requires locking the corresponding segment. Fix is always doing both operation (Inserting virtual mapping + refcount bump) under the segment lock.
- Fix write instruction on COW mapping : always ensure the section is read from file before making a private copy.
- Let the zero page thread decide itself if it is active or not.
- Old Mm expects swap page file offsets to be non-zero when reading back from it. +1 / -1 when calling new API fixes that
Have fun breaking it hard. I tested that with Opera loading a truckload of heavy webpages on a 256 Mb VM. It survived much longer than my first attempts, but still hangs at a certain point in time. I don't expect that to fix the big-file copy bug, but who knows