Author: sir_richard
Date: Fri Feb 19 19:29:29 2010
New Revision: 45625
URL: http://svn.reactos.org/svn/reactos?rev=45625&view=rev
Log:
[NTOS]: Fix premature setting of the page location of a newly allocated MDL page. Because the zeroing of non-zeroed pages is done after the initial page allocation loop (and by checking which list the page was on), setting the page location as ActiveAndValid made the zero loop believe the page was unzeroed (even though it could've come from the zeroed list), causing a superflous second zero operation.
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Fri Feb 19 19:29:29 2010
@@ -480,7 +480,6 @@
Pfn1->u3.e1.StartOfAllocation = 1;
Pfn1->u3.e1.EndOfAllocation = 1;
Pfn1->u3.e2.ReferenceCount = 1;
- Pfn1->u3.e1.PageLocation = ActiveAndValid;
Pfn1->SavedSwapEntry = 0;
//
Author: sir_richard
Date: Fri Feb 19 19:25:29 2010
New Revision: 45624
URL: http://svn.reactos.org/svn/reactos?rev=45624&view=rev
Log:
[NTOS]: Fix a logic error which could cause pages on the free list which failed to be zeroed out due to running out of hyperspace mappings to appear as being on the zero page list even though they were inserted back on the free page list.
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Fri Feb 19 19:25:29 2010
@@ -1000,15 +1000,16 @@
Status = MiZeroPage(Pfn);
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- PageDescriptor->u3.e1.PageLocation = ZeroedPageList;
if (NT_SUCCESS(Status))
{
InsertHeadList(&FreeZeroedPageListHead, ListEntry);
+ PageDescriptor->u3.e1.PageLocation = ZeroedPageList;
Count++;
}
else
{
InsertHeadList(&FreeUnzeroedPageListHead, ListEntry);
+ PageDescriptor->u3.e1.PageLocation = FreePageList;
UnzeroedPageCount++;
}
Author: sir_richard
Date: Fri Feb 19 19:23:07 2010
New Revision: 45623
URL: http://svn.reactos.org/svn/reactos?rev=45623&view=rev
Log:
[NTOS]: Fix an off-by-! error which caused MDL page allocation to use used pages instead of free pages.
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Fri Feb 19 19:23:07 2010
@@ -516,7 +516,7 @@
//
// Make sure it's free and if this is our first pass, zeroed
//
- if (!MiIsPfnInUse(Pfn1)) continue;
+ if (MiIsPfnInUse(Pfn1)) continue;
if ((Pfn1->u3.e1.PageLocation == ZeroedPageList) != LookForZeroedPages) continue;
//
Author: sir_richard
Date: Fri Feb 19 18:55:22 2010
New Revision: 45622
URL: http://svn.reactos.org/svn/reactos?rev=45622&view=rev
Log:
[NTOS]: It seems the code to release a page was not properly removing a page from the working set bitmap/list in one scenario, so I added the call here too.
Modified:
trunk/reactos/ntoskrnl/mm/balance.c
Modified: trunk/reactos/ntoskrnl/mm/balance.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Fri Feb 19 18:55:22 2010
@@ -120,6 +120,7 @@
if (IsListEmpty(&AllocationListHead) || MmAvailablePages < MiMinimumAvailablePages)
{
KeReleaseSpinLock(&AllocationListLock, OldIrql);
+ if(Consumer == MC_USER) MmRemoveLRUUserPage(Page);
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
MmDereferencePage(Page);
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);