Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-12047

Fixes for legacy Mm Paging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.3
    • NTCore

    Description

      Let's open a bug for a WIP patch, fixing a few bugs.

      Summary :

      • 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

      Cc thfabba, pschweitzer,aminekhaldi for comments and testing.

      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

      Attachments

        1. paging_fixes.diff
          11 kB
        2. react-r72831-withPatchOnTop.log
          4.68 MB
        3. patch.patch
          12 kB
        4. patch_v2.patch
          13 kB
        5. patch_v2.patch
          15 kB
        6. r72836-withPatch-withoutTaskmgr-afterShellRestart.png
          r72836-withPatch-withoutTaskmgr-afterShellRestart.png
          35 kB
        7. r72836-withPatch-beforeCopy.png
          r72836-withPatch-beforeCopy.png
          39 kB
        8. r72836-withPatch-whenCrashing.png
          r72836-withPatch-whenCrashing.png
          37 kB
        9. r72836-withPatch_whenCrashing.log
          74 kB
        10. paging_fixes_2.diff
          16 kB
        11. react-r72935&paging_fixes_2-copyBig-BSODafterException.log
          243 kB
        12. react-r72957-paging_fixes_2.log
          267 kB
        13. react-r72957-paging_fixes_2.webm
          3.46 MB
        14. debug.log
          41 kB
        15. r74518copy.log
          339 kB
        16. r74518copy.webm
          6.20 MB
        17. r74519copy.log
          221 kB
        18. r74519copy.webm
          6.27 MB
        19. r0.4.6RC1-firstException-then-frozen-notEvenDbgPromptUpdatedAnymore.log
          160 kB
        20. r0.4.6RC1-firstException-then-frozen-notEvenDbgPromptUpdatedAnymore.webm
          3.32 MB

        Issue Links

          Activity

            People

              zefklop jgardou
              zefklop jgardou
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: