Revert "[NTOS:MM] Do proper checks & acquire proper locks when sweeping user pages"

This reverts commit 7c006df7e0.
Note to self: This is what happens when you have too many branch and push the wrong one.
This commit is contained in:
Jérôme Gardou 2021-08-04 23:57:39 +02:00
parent 7c006df7e0
commit 676dc4b441

View file

@ -213,22 +213,15 @@ MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
MmLockAddressSpace(&Process->Vm); MmLockAddressSpace(&Process->Vm);
if (!Process->VmDeleted) /* Be sure this is still valid. */
PMMPTE Pte = MiAddressToPte(Address);
if (Pte->u.Hard.Valid)
{ {
MiLockProcessWorkingSetUnsafe(Process, PsGetCurrentThread()); Accessed = Accessed || Pte->u.Hard.Accessed;
Pte->u.Hard.Accessed = 0;
/* Be sure this is still valid. */ /* There is no need to invalidate, the balancer thread is never on a user process */
if (MmIsAddressValid(Address)) //KeInvalidateTlbEntry(Address);
{
PMMPTE Pte = MiAddressToPte(Address);
Accessed = Accessed || Pte->u.Hard.Accessed;
Pte->u.Hard.Accessed = 0;
/* There is no need to invalidate, the balancer thread is never on a user process */
//KeInvalidateTlbEntry(Address);
}
MiUnlockProcessWorkingSet(Process, PsGetCurrentThread());
} }
MmUnlockAddressSpace(&Process->Vm); MmUnlockAddressSpace(&Process->Vm);