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

Systematization of variable naming for the memory manager

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None

    Description

      I propose to systematize the naming of variables for the memory manager:

      Firstly, I propose to abandon the "Pointer" part in PointerP.e variables, since it practically does not carry information (except that it is a pointer). Equally well, "Pointer" can be added to any other pointer. For example PointerIrp. I think this "Pointer" came about because of the confusion with the so-called prototype PTEs. To make it clear to everyone - a little theory.

      To translate virtual addresses into physical addresses, the processor uses, in particular, directories and page tables.

      Abbreviations used below:

      PD - page directory
      PT - page table
      PDE - page directory entry
      PTE - page table entry
      VA - virtual address
      PA - physical address

      If the PTE is valid, then it participates in the VA -> PA translation.

      If not, then it can be described by one of three structures:
      1 - Paged out PTE (MMPTE_SOFTWARE)
      2 - Demand zero PTE (MMPTE_SOFTWARE)
      3 - Prototype PTE (MMPTE_PROTOTYPE)
      4 - Transition PTE (MMPTE_TRANSITION)

      In this case, we are interested in the 3rd - Prototype PTE (MMPTE_PROTOTYPE).

      Prototype PTE is an invalid PTE that contains the address of a structure located in the paged pool. And here begins the confusion with the naming of this structure. Perhaps because this structure also uses the MMPTE description. And already directly (and not Prototype PTE) it describes a page shared by several processes. This structure, although using MMPTE, is not really PTE. It is not located in the PT and it is actually an component of the memory section.

      Therefore, I propose, to avoid confusion and to make the code more understandable, not to use "Pte" for naming these structures. Since this structure is uniquely associated with a memory section, I suggest calling it "Proto", "SectionProto" or "SegmentProto".

      So I suggest a naming system like this:

      1. "P.e", ... "XxxP.e" (get rid of "Pointer" in the name) - PDE or PTE, which is in the translation tables;
      2. "Proto", ... "XxxProto" (we do not use in the name "Pte") - a structure that is an part of the memory section and is located in the paged pool;
      3. "ProtoP.e", ... "XxxProtoP.e" - PDE or PTE for the corresponding "Proto" structure;

      Attachments

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              vgal vgal
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: