Skip to content

RFC Cleaning up soft-dirty bit usage

Cyrill Gorcunov linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: pgtable -- Drop unneeded preprocessor ifdefarch/x86/include/asm/pgtable-2level.h arch/x86/include/asm/pgtable_64.h+0 -150 replies
2/3mm: pgtable -- Require X86_64 for soft-dirty trackerarch/x86/Kconfig arch/x86/include/asm/pgtable-2level.h+1 -500 replies
3/3mm: pgtable -- Use _PAGE_SOFT_DIRTY for swap entriesarch/x86/include/asm/pgtable_64.h arch/x86/include/asm/pgtable_types.h+14 -170 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [rfc 0/3] Cleaning up soft-dirty bit usage

Hi! I've been trying to clean up soft-dirty bit usage. I can't cleanup "ridiculous macros in pgtable-2level.h" completely because I need to define _PAGE_FILE,_PAGE_PROTNONE,_PAGE_NUMA bits in sequence manner like

#define _PAGE_BIT_FILE (_PAGE_BIT_PRESENT + 1) /* _PAGE_BIT_RW */
#define _PAGE_BIT_NUMA (_PAGE_BIT_PRESENT + 2) /* _PAGE_BIT_USER */
#define _PAGE_BIT_PROTNONE (_PAGE_BIT_PRESENT + 3) /* _PAGE_BIT_PWT */

which can't be done right now because numa code needs to save original pte bits for example in __split_huge_page_map, if I'm not missing something obvious.

Also if we ever redefine the bits above we will need to update PAT code which uses _PAGE_GLOBAL + _PAGE_PRESENT to make pte_present return true or false.

Another weird thing I found is the following sequence:

mprotect_fixup

    change_protection (passes @prot_numa = 0 which finally ends up in)
      ...
      change_pte_range(..., prot_numa)

			if (!prot_numa) {
				...
			} else {
				... this seems to be dead code branch ...
			}

    is it intentional, and @prot_numa argument is supposed to be passed
    with prot_numa = 1 one day, or it's leftover from old times?

Note I've not yet tested the series building it now, hopefully finish testing in a couple of hours.

Linus, by saying "define the bits we use when PAGE_PRESENT==0 separately and explicitly" you meant complete rework of the bits, right? Not simply group them in once place in a header?

Cyrill

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>