Author: cgutman
Date: Tue Nov 29 18:32:23 2011
New Revision: 54540
URL:
http://svn.reactos.org/svn/reactos?rev=54540&view=rev
Log:
[NTOSKRNL]
- Always trim at least MiMinimumPagesPerRun for each call to MiTrimMemoryConsumer to
reduce cache thrashing
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] Tue Nov 29 18:32:23 2011
@@ -146,12 +146,9 @@
LONG Target;
ULONG NrFreedPages;
- Target = MiMemoryConsumers[Consumer].PagesUsed -
- MiMemoryConsumers[Consumer].PagesTarget;
- if (Target < 1)
- {
- Target = 1;
- }
+ Target = max(MiMinimumPagesPerRun,
+ MiMemoryConsumers[Consumer].PagesUsed -
+ MiMemoryConsumers[Consumer].PagesTarget);
if (MiMemoryConsumers[Consumer].Trim != NULL)
{