[NTOS:MM] Get rid of unnecessary MmZeroingPageThreadActive.

This commit is contained in:
Thomas Faber 2020-02-22 12:31:54 +01:00
parent 5280deecfa
commit 25a5aee86f
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
4 changed files with 4 additions and 8 deletions

View file

@ -639,7 +639,6 @@ extern PMMPDE MiHighestUserPde;
extern PFN_NUMBER MmSystemPageDirectory[PPE_PER_PAGE]; extern PFN_NUMBER MmSystemPageDirectory[PPE_PER_PAGE];
extern PMMPTE MmSharedUserDataPte; extern PMMPTE MmSharedUserDataPte;
extern LIST_ENTRY MmProcessList; extern LIST_ENTRY MmProcessList;
extern BOOLEAN MmZeroingPageThreadActive;
extern KEVENT MmZeroingPageEvent; extern KEVENT MmZeroingPageEvent;
extern ULONG MmSystemPageColor; extern ULONG MmSystemPageColor;
extern ULONG MmProcessColorSeed; extern ULONG MmProcessColorSeed;

View file

@ -2181,9 +2181,8 @@ MmArmInitSystem(IN ULONG Phase,
/* Initialize the Loader Lock */ /* Initialize the Loader Lock */
KeInitializeMutant(&MmSystemLoadLock, FALSE); KeInitializeMutant(&MmSystemLoadLock, FALSE);
/* Set the zero page event */ /* Set up the zero page event */
KeInitializeEvent(&MmZeroingPageEvent, SynchronizationEvent, FALSE); KeInitializeEvent(&MmZeroingPageEvent, NotificationEvent, FALSE);
MmZeroingPageThreadActive = FALSE;
/* Initialize the dead stack S-LIST */ /* Initialize the dead stack S-LIST */
InitializeSListHead(&MmDeadStackSListHead); InitializeSListHead(&MmDeadStackSListHead);

View file

@ -701,10 +701,9 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
ColorTable->Count++; ColorTable->Count++;
/* Notify zero page thread if enough pages are on the free list now */ /* Notify zero page thread if enough pages are on the free list now */
if ((ListHead->Total >= 8) && !(MmZeroingPageThreadActive)) if (ListHead->Total >= 8)
{ {
/* Set the event */ /* Set the event */
MmZeroingPageThreadActive = TRUE;
KeSetEvent(&MmZeroingPageEvent, IO_NO_INCREMENT, FALSE); KeSetEvent(&MmZeroingPageEvent, IO_NO_INCREMENT, FALSE);
} }

View file

@ -17,7 +17,6 @@
/* GLOBALS ********************************************************************/ /* GLOBALS ********************************************************************/
BOOLEAN MmZeroingPageThreadActive;
KEVENT MmZeroingPageEvent; KEVENT MmZeroingPageEvent;
/* PRIVATE FUNCTIONS **********************************************************/ /* PRIVATE FUNCTIONS **********************************************************/
@ -73,7 +72,7 @@ MmZeroPageThread(VOID)
{ {
if (!MmFreePageListHead.Total) if (!MmFreePageListHead.Total)
{ {
MmZeroingPageThreadActive = FALSE; KeClearEvent(&MmZeroingPageEvent);
MiReleasePfnLock(OldIrql); MiReleasePfnLock(OldIrql);
break; break;
} }