mirror of
https://github.com/reactos/reactos.git
synced 2026-06-20 02:17:31 +08:00
[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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user