mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-27 11:53:32 +00:00
[NTOS:MM] Fix MmZeroingPageThreadActive race condition.
If a thread calls MiInsertPageInFreeList after the zero page thread has woken up from its wait but before it acquired the PFN lock, MmZeroingPageEvent might get set again even though there is no additional work to be done. By setting MmZeroingPageThreadActive together with the event, the variable correctly indicates for future callers that the zero thread will process newly added free pages. This partially reverts r72990.
This commit is contained in:
@@ -704,6 +704,7 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
|
||||
if ((ListHead->Total >= 8) && !(MmZeroingPageThreadActive))
|
||||
{
|
||||
/* Set the event */
|
||||
MmZeroingPageThreadActive = TRUE;
|
||||
KeSetEvent(&MmZeroingPageEvent, IO_NO_INCREMENT, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ MmZeroPageThread(VOID)
|
||||
NULL,
|
||||
NULL);
|
||||
OldIrql = MiAcquirePfnLock();
|
||||
MmZeroingPageThreadActive = TRUE;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user