[NTOSKRNL]

- Tweak the balancer a bit to favor RosMm allocations in low memory scenarios
- Fix the balancer out of memory warning

svn path=/trunk/; revision=54693
This commit is contained in:
Cameron Gutman
2011-12-19 08:49:42 +00:00
parent 85ba8df340
commit b3677f395e

View File

@@ -108,8 +108,7 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
{
if(Consumer == MC_USER) MmRemoveLRUUserPage(Page);
(void)InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
if (MmAvailablePages < MiMinimumAvailablePages ||
(Entry = ExInterlockedRemoveHeadList(&AllocationListHead, &AllocationListLock)) == NULL)
if ((Entry = ExInterlockedRemoveHeadList(&AllocationListHead, &AllocationListLock)) == NULL)
{
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
MmDereferencePage(Page);
@@ -166,9 +165,6 @@ MiTrimMemoryConsumer(ULONG Consumer)
DPRINT("Trimming consumer %d: Freed %d pages with a target of %d pages\n", Consumer, NrFreedPages, Target);
if (NrFreedPages == 0)
DPRINT1("Ran out of pages to swap!\n");
if (!NT_SUCCESS(Status))
{
KeBugCheck(MEMORY_MANAGEMENT);
@@ -356,6 +352,12 @@ MiBalancerThread(PVOID Unused)
{
MiTrimMemoryConsumer(i);
}
if (MmAvailablePages < MiMinimumAvailablePages)
{
/* This is really bad... */
DPRINT1("Balancer failed to resolve low memory condition! Complete memory exhaustion is imminent!\n");
}
}
else
{