mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 12:40:33 +00:00
[NTOSKRNL]
- Only return the dirty bit if the PTE is actually valid - Avoid an unneeded TLB flush when setting the dirty bit svn path=/trunk/; revision=54993
This commit is contained in:
parent
292cd6d2b7
commit
cc334002e9
1 changed files with 3 additions and 5 deletions
|
@ -539,7 +539,7 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage,
|
||||||
*/
|
*/
|
||||||
if (WasDirty != NULL)
|
if (WasDirty != NULL)
|
||||||
{
|
{
|
||||||
*WasDirty = Pte & PA_DIRTY ? TRUE : FALSE;
|
*WasDirty = ((Pte & PA_DIRTY) && (Pte & PA_PRESENT)) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
if (Page != NULL)
|
if (Page != NULL)
|
||||||
{
|
{
|
||||||
|
@ -687,12 +687,10 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address)
|
||||||
{
|
{
|
||||||
KeBugCheck(MEMORY_MANAGEMENT);
|
KeBugCheck(MEMORY_MANAGEMENT);
|
||||||
}
|
}
|
||||||
else if (!(Pte & PA_DIRTY))
|
|
||||||
{
|
|
||||||
MiFlushTlb(Pt, Address);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* The processor will never clear this bit itself, therefore
|
||||||
|
* we do not need to flush the TLB here when setting it */
|
||||||
MmUnmapPageTable(Pt);
|
MmUnmapPageTable(Pt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue