mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +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:
parent
34f4b218de
commit
5280deecfa
2 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue