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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: