Author: cgutman
Date: Sun Dec 4 19:22:51 2011
New Revision: 54591
URL:
http://svn.reactos.org/svn/reactos?rev=54591&view=rev
Log:
[NTOSKRNL]
- Fix a logic error
- Signal the balancer in the !CanWait case if we're too low on pages since it runs
asynchronously as of recently
Modified:
trunk/reactos/ntoskrnl/mm/balance.c
Modified: trunk/reactos/ntoskrnl/mm/balance.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Sun Dec 4 19:22:51 2011
@@ -239,7 +239,7 @@
/*
* Make sure we don't exceed our individual target.
*/
- PagesUsed = InterlockedIncrementUL(&MiMemoryConsumers[Consumer].PagesUsed) + 1;
+ PagesUsed = InterlockedIncrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
if (PagesUsed > MiMemoryConsumers[Consumer].PagesTarget &&
!MiIsBalancerThread())
{
@@ -275,6 +275,7 @@
if (!CanWait)
{
(void)InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
+ MmRebalanceMemoryConsumers();
return(STATUS_NO_MEMORY);
}