Author: arty
Date: Fri Dec 24 22:54:24 2010
New Revision: 50134
URL:
http://svn.reactos.org/svn/reactos?rev=50134&view=rev
Log:
Make sure to initialize our page operation mutex.
Scan the whole range of the MemoryArea for pages to evict.
This fixes cache section page eviction.
Modified:
trunk/reactos/ntoskrnl/cache/fssup.c
trunk/reactos/ntoskrnl/cache/section/swapout.c
Modified: trunk/reactos/ntoskrnl/cache/fssup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/fssup.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/fssup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/fssup.c [iso-8859-1] Fri Dec 24 22:54:24 2010
@@ -25,6 +25,7 @@
extern VOID NTAPI CcpLazyWriteThread(PVOID Unused);
HANDLE CcUnmapThreadHandle, CcLazyWriteThreadHandle;
CLIENT_ID CcUnmapThreadId, CcLazyWriteThreadId;
+FAST_MUTEX GlobalPageOperation;
typedef struct _NOCC_PRIVATE_CACHE_MAP
{
@@ -98,6 +99,7 @@
CcCacheBitmap->SizeOfBitMap = ROUND_UP(CACHE_NUM_SECTIONS, 32);
DPRINT("Cache has %d entries\n", CcCacheBitmap->SizeOfBitMap);
ExInitializeFastMutex(&CcMutex);
+ ExInitializeFastMutex(&GlobalPageOperation);
// MM stub
KeInitializeEvent(&MmWaitPageEvent, SynchronizationEvent, FALSE);
Modified: trunk/reactos/ntoskrnl/cache/section/swapout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/swa…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/swapout.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/swapout.c [iso-8859-1] Fri Dec 24 22:54:24 2010
@@ -480,8 +480,8 @@
MmLockCacheSectionSegment(Segment);
for (i = 0;
- i < Segment->Length.QuadPart -
- MemoryArea->Data.CacheData.ViewOffset.QuadPart &&
+ i < ((ULONG_PTR)MemoryArea->EndingAddress) -
+ ((ULONG_PTR)MemoryArea->StartingAddress) &&
Result < Target;
i += PAGE_SIZE) {
Offset.QuadPart = MemoryArea->Data.CacheData.ViewOffset.QuadPart + i;