[NTOSKRNL]

- Revert part of r54530
- Try to rebalance RosMm's pages if we're low on memory in ARM3
- ROS runs with 48 MB RAM again (but setup is very slow due to horrendous paging caused by cache pollution)

svn path=/trunk/; revision=54539
This commit is contained in:
Cameron Gutman 2011-11-29 18:03:09 +00:00
parent de008de9a4
commit 832bc7ab3f
2 changed files with 12 additions and 4 deletions

View file

@ -848,17 +848,23 @@ MiAllocatePfn(IN PMMPTE PointerPte,
/* Make an empty software PTE */
MI_MAKE_SOFTWARE_PTE(&TempPte, MM_READWRITE);
/* Lock the PFN database */
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
/* Check if we're running low on pages */
if (MmAvailablePages < 128)
{
DPRINT1("Warning, running low on memory: %d pages left\n", MmAvailablePages);
//MiEnsureAvailablePageOrWait(NULL, OldIrql);
/* Call RosMm and see if it can release any pages for us */
MmRebalanceMemoryConsumers();
DPRINT1("Rebalance complete: %d pages left\n", MmAvailablePages);
}
/* Lock the PFN database */
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
/* Grab a page */
ASSERT_LIST_INVARIANT(&MmFreePageListHead);
ASSERT_LIST_INVARIANT(&MmZeroedPageListHead);

View file

@ -122,6 +122,7 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
Entry = RemoveHeadList(&AllocationListHead);
Request = CONTAINING_RECORD(Entry, MM_ALLOCATION_REQUEST, ListEntry);
KeReleaseSpinLock(&AllocationListLock, OldIrql);
if(Consumer == MC_USER) MmRemoveLRUUserPage(Page);
MiZeroPhysicalPage(Page);
Request->Page = Page;
KeSetEvent(&Request->Event, IO_NO_INCREMENT, FALSE);
@ -310,6 +311,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
KeBugCheck(NO_PAGES_AVAILABLE);
}
if(Consumer == MC_USER) MmInsertLRULastUserPage(Page);
*AllocatedPage = Page;
(void)InterlockedDecrementUL(&MiPagesRequired);