Introduce per-page-color modified page lists
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 30s
Builds / ExectOS (i686, debug) (push) Successful in 41s
Builds / ExectOS (amd64, debug) (push) Successful in 43s
Builds / ExectOS (i686, release) (push) Successful in 37s

This commit is contained in:
2026-01-01 16:46:26 +01:00
parent 00702bfb23
commit 5ff0cad094
3 changed files with 28 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ namespace MM
{
private:
STATIC PMMCOLOR_TABLES FreePages[FreePageList + 1];
STATIC MMPFNLIST ModifiedPages[MM_PAGING_COLORS];
STATIC ULONG PagingColors;
STATIC ULONG PagingColorsMask;
@@ -26,9 +27,10 @@ namespace MM
STATIC XTAPI VOID ComputePageColoring(VOID);
STATIC XTAPI PMMCOLOR_TABLES GetFreePages(MMPAGELISTS PageList,
ULONG Color);
STATIC XTAPI ULONG GetNextColor();
STATIC XTAPI ULONG GetPagingColors();
STATIC XTAPI ULONG GetPagingColorsMask();
STATIC XTAPI PMMPFNLIST GetModifiedPages(IN ULONG Color);
STATIC XTAPI ULONG GetNextColor(VOID);
STATIC XTAPI ULONG GetPagingColors(VOID);
STATIC XTAPI ULONG GetPagingColorsMask(VOID);
STATIC XTAPI VOID InitializeColorTables(VOID);
};
}

View File

@@ -49,6 +49,23 @@ MM::Colors::GetFreePages(MMPAGELISTS PageList,
return &FreePages[PageList][Color];
}
/**
* Retrieves a pointer to the modified pages list for a specific color.
*
* @param Color
* Supplies the specific color index.
*
* @return This routine returns a pointer to the corresponding MMPFNLIST structure.
*
* @since XT 1.0
*/
XTAPI
PMMPFNLIST
MM::Colors::GetModifiedPages(IN ULONG Color)
{
return &ModifiedPages[Color];
}
/**
* Retrieves the next available color for page coloring.
*
@@ -58,7 +75,7 @@ MM::Colors::GetFreePages(MMPAGELISTS PageList,
*/
XTAPI
ULONG
MM::Colors::GetNextColor()
MM::Colors::GetNextColor(VOID)
{
/* Increment the color counter and wrap it around using the mask */
return ((++PagingColors) & PagingColorsMask);
@@ -73,7 +90,7 @@ MM::Colors::GetNextColor()
*/
XTAPI
ULONG
MM::Colors::GetPagingColors()
MM::Colors::GetPagingColors(VOID)
{
/* Return the total number of page colors */
return PagingColors;
@@ -88,7 +105,7 @@ MM::Colors::GetPagingColors()
*/
XTAPI
ULONG
MM::Colors::GetPagingColorsMask()
MM::Colors::GetPagingColorsMask(VOID)
{
/* Return the mask used for page coloring calculations */
return PagingColorsMask;

View File

@@ -12,6 +12,9 @@
/* Array of free page lists segregated by cache color */
PMMCOLOR_TABLES MM::Colors::FreePages[FreePageList + 1];
/* Array of modified pages segregated by cache color */
MMPFNLIST MM::Colors::ModifiedPages[MM_PAGING_COLORS];
/* Number of supported page colors */
ULONG MM::Colors::PagingColors;