Author: mbosma
Date: Wed Jul 26 13:26:12 2006
New Revision: 23300
URL:
http://svn.reactos.org/svn/reactos?rev=23300&view=rev
Log:
Merge 23213
Modified:
branches/cache_manager_rewrite/mm/mminit.c
branches/cache_manager_rewrite/mm/process.c
Modified: branches/cache_manager_rewrite/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/mminit…
==============================================================================
--- branches/cache_manager_rewrite/mm/mminit.c (original)
+++ branches/cache_manager_rewrite/mm/mminit.c Wed Jul 26 13:26:12 2006
@@ -29,7 +29,7 @@
static BOOLEAN IsThisAnNtAsSystem = FALSE;
-static MM_SYSTEM_SIZE MmSystemSize = MmSmallSystem;
+MM_SYSTEM_SIZE MmSystemSize = MmSmallSystem;
PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress;
Modified: branches/cache_manager_rewrite/mm/process.c
URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/proces…
==============================================================================
--- branches/cache_manager_rewrite/mm/process.c (original)
+++ branches/cache_manager_rewrite/mm/process.c Wed Jul 26 13:26:12 2006
@@ -17,11 +17,35 @@
extern ULONG NtMinorVersion;
extern ULONG NtOSCSDVersion;
extern ULONG NtGlobalFlag;
+extern MM_SYSTEM_SIZE MmSystemSize;
#define MM_HIGHEST_VAD_ADDRESS \
(PVOID)((ULONG_PTR)MM_HIGHEST_USER_ADDRESS - (16 * PAGE_SIZE))
/* FUNCTIONS *****************************************************************/
+
+NTSTATUS
+NTAPI
+MmSetMemoryPriorityProcess(IN PEPROCESS Process,
+ IN UCHAR MemoryPriority)
+{
+ UCHAR OldPriority;
+
+ /* Check if we have less then 16MB of Physical Memory */
+ if ((MmSystemSize == MmSmallSystem) &&
+ (MmStats.NrTotalPages < ((15 * 1024 * 1024) / PAGE_SIZE)))
+ {
+ /* Always use background priority */
+ MemoryPriority = 0;
+ }
+
+ /* Save the old priority and update it */
+ OldPriority = Process->Vm.Flags.MemoryPriority;
+ Process->Vm.Flags.MemoryPriority = MemoryPriority;
+
+ /* Return the old priority */
+ return OldPriority;
+}
LCID
NTAPI