mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[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 svn path=/trunk/; revision=47516
This commit is contained in:
parent
b5781444a5
commit
59aacb176f
2 changed files with 8 additions and 1 deletions
|
@ -59,7 +59,7 @@ MiInsertInListTail(IN PMMPFNLIST ListHead,
|
||||||
{
|
{
|
||||||
PFN_NUMBER OldBlink, EntryIndex = MiGetPfnEntryIndex(Entry);
|
PFN_NUMBER OldBlink, EntryIndex = MiGetPfnEntryIndex(Entry);
|
||||||
|
|
||||||
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
|
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
|
||||||
ASSERT_LIST_INVARIANT(ListHead);
|
ASSERT_LIST_INVARIANT(ListHead);
|
||||||
|
|
||||||
/* Get the back link */
|
/* Get the back link */
|
||||||
|
|
|
@ -457,12 +457,16 @@ MmInitializePageList(VOID)
|
||||||
PMEMORY_ALLOCATION_DESCRIPTOR Md;
|
PMEMORY_ALLOCATION_DESCRIPTOR Md;
|
||||||
PLIST_ENTRY NextEntry;
|
PLIST_ENTRY NextEntry;
|
||||||
ULONG NrSystemPages = 0;
|
ULONG NrSystemPages = 0;
|
||||||
|
KIRQL OldIrql;
|
||||||
|
|
||||||
/* This is what a used page looks like */
|
/* This is what a used page looks like */
|
||||||
RtlZeroMemory(&UsedPage, sizeof(UsedPage));
|
RtlZeroMemory(&UsedPage, sizeof(UsedPage));
|
||||||
UsedPage.u3.e1.PageLocation = ActiveAndValid;
|
UsedPage.u3.e1.PageLocation = ActiveAndValid;
|
||||||
UsedPage.u3.e2.ReferenceCount = 1;
|
UsedPage.u3.e2.ReferenceCount = 1;
|
||||||
|
|
||||||
|
/* Lock PFN database */
|
||||||
|
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||||
|
|
||||||
/* Loop the memory descriptors */
|
/* Loop the memory descriptors */
|
||||||
for (NextEntry = KeLoaderBlock->MemoryDescriptorListHead.Flink;
|
for (NextEntry = KeLoaderBlock->MemoryDescriptorListHead.Flink;
|
||||||
NextEntry != &KeLoaderBlock->MemoryDescriptorListHead;
|
NextEntry != &KeLoaderBlock->MemoryDescriptorListHead;
|
||||||
|
@ -519,6 +523,9 @@ MmInitializePageList(VOID)
|
||||||
NrSystemPages++;
|
NrSystemPages++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Release the PFN database lock */
|
||||||
|
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
|
||||||
|
|
||||||
KeInitializeEvent(&ZeroPageThreadEvent, NotificationEvent, TRUE);
|
KeInitializeEvent(&ZeroPageThreadEvent, NotificationEvent, TRUE);
|
||||||
DPRINT("Pages: %x %x\n", MmAvailablePages, NrSystemPages);
|
DPRINT("Pages: %x %x\n", MmAvailablePages, NrSystemPages);
|
||||||
MmInitializeBalancer(MmAvailablePages, NrSystemPages);
|
MmInitializeBalancer(MmAvailablePages, NrSystemPages);
|
||||||
|
|
Loading…
Reference in a new issue