[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

svn path=/trunk/; revision=54591
This commit is contained in:
Cameron Gutman
2011-12-04 19:22:51 +00:00
parent c42d4ae0f0
commit 6764aa97c8
+2 -1
View File
@@ -239,7 +239,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
/*
* 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 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
if (!CanWait)
{
(void)InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
MmRebalanceMemoryConsumers();
return(STATUS_NO_MEMORY);
}