- Initialize the used page count for the non paged pool in MmInitializeBalancer.
authorHartmut Birr <osexpert@googlemail.com>
Thu, 23 Oct 2003 20:28:08 +0000 (20:28 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Thu, 23 Oct 2003 20:28:08 +0000 (20:28 +0000)
svn path=/trunk/; revision=6420

reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/mm/balance.c
reactos/ntoskrnl/mm/freelist.c

index 825233b..9dd2742 100644 (file)
@@ -501,7 +501,7 @@ MmInitializeMemoryConsumer(ULONG Consumer,
                           NTSTATUS (*Trim)(ULONG Target, ULONG Priority, 
                                            PULONG NrFreed));
 VOID
                           NTSTATUS (*Trim)(ULONG Target, ULONG Priority, 
                                            PULONG NrFreed));
 VOID
-MmInitializeBalancer(ULONG NrAvailablePages);
+MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages);
 NTSTATUS
 MmReleasePageMemoryConsumer(ULONG Consumer, PHYSICAL_ADDRESS Page);
 NTSTATUS
 NTSTATUS
 MmReleasePageMemoryConsumer(ULONG Consumer, PHYSICAL_ADDRESS Page);
 NTSTATUS
index c7c6c7f..1543fd5 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: balance.c,v 1.21 2003/10/12 17:05:48 hbirr Exp $
+/* $Id: balance.c,v 1.22 2003/10/23 20:28:08 hbirr Exp $
  *
  * PROJECT:     ReactOS kernel 
  * FILE:        ntoskrnl/mm/balance.c
  *
  * PROJECT:     ReactOS kernel 
  * FILE:        ntoskrnl/mm/balance.c
@@ -73,7 +73,7 @@ VOID MmPrintMemoryStatistic(VOID)
 }
 
 VOID INIT_FUNCTION
 }
 
 VOID INIT_FUNCTION
-MmInitializeBalancer(ULONG NrAvailablePages)
+MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages)
 {
   memset(MiMemoryConsumers, 0, sizeof(MiMemoryConsumers));
   InitializeListHead(&AllocationListHead);
 {
   memset(MiMemoryConsumers, 0, sizeof(MiMemoryConsumers));
   InitializeListHead(&AllocationListHead);
@@ -88,6 +88,7 @@ MmInitializeBalancer(ULONG NrAvailablePages)
     NrAvailablePages - MiMinimumAvailablePages;
   MiMemoryConsumers[MC_PPOOL].PagesTarget = NrAvailablePages / 2;
   MiMemoryConsumers[MC_NPPOOL].PagesTarget = 0xFFFFFFFF;
     NrAvailablePages - MiMinimumAvailablePages;
   MiMemoryConsumers[MC_PPOOL].PagesTarget = NrAvailablePages / 2;
   MiMemoryConsumers[MC_NPPOOL].PagesTarget = 0xFFFFFFFF;
+  MiMemoryConsumers[MC_NPPOOL].PagesUsed = NrSystemPages;
 }
 
 VOID INIT_FUNCTION
 }
 
 VOID INIT_FUNCTION
index 6c13326..7313084 100644 (file)
@@ -506,7 +506,7 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
   
    MmStats.NrTotalPages = MmStats.NrFreePages + MmStats.NrSystemPages +
      MmStats.NrReservedPages + MmStats.NrUserPages;
   
    MmStats.NrTotalPages = MmStats.NrFreePages + MmStats.NrSystemPages +
      MmStats.NrReservedPages + MmStats.NrUserPages;
-   MmInitializeBalancer(MmStats.NrFreePages);
+   MmInitializeBalancer(MmStats.NrFreePages, MmStats.NrSystemPages + MmStats.NrReservedPages);
    return((PVOID)LastKernelAddress);
 }
 
    return((PVOID)LastKernelAddress);
 }