Author: cgutman
Date: Tue Jun 1 22:06:53 2010
New Revision: 47516
URL:
http://svn.reactos.org/svn/reactos?rev=47516&view=rev
Log:
[NTOSKRNL]
- Revert the hack in r47514
- The ASSERT is there to make sure the PFN lock is held
- Fix the issue properly by holding the PFN lock while initializing
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] Tue Jun 1 22:06:53 2010
@@ -59,7 +59,7 @@
{
PFN_NUMBER OldBlink, EntryIndex = MiGetPfnEntryIndex(Entry);
- ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
+ ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
ASSERT_LIST_INVARIANT(ListHead);
/* Get the back link */
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] Tue Jun 1 22:06:53 2010
@@ -457,11 +457,15 @@
PMEMORY_ALLOCATION_DESCRIPTOR Md;
PLIST_ENTRY NextEntry;
ULONG NrSystemPages = 0;
+ KIRQL OldIrql;
/* This is what a used page looks like */
RtlZeroMemory(&UsedPage, sizeof(UsedPage));
UsedPage.u3.e1.PageLocation = ActiveAndValid;
UsedPage.u3.e2.ReferenceCount = 1;
+
+ /* Lock PFN database */
+ OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
/* Loop the memory descriptors */
for (NextEntry = KeLoaderBlock->MemoryDescriptorListHead.Flink;
@@ -518,6 +522,9 @@
MmPfnDatabase[0][i] = UsedPage;
NrSystemPages++;
}
+
+ /* Release the PFN database lock */
+ KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
KeInitializeEvent(&ZeroPageThreadEvent, NotificationEvent, TRUE);
DPRINT("Pages: %x %x\n", MmAvailablePages, NrSystemPages);