mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
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. svn path=/trunk/; revision=50134
This commit is contained in:
parent
1513741845
commit
9e8a4109b0
2 changed files with 4 additions and 2 deletions
2
reactos/ntoskrnl/cache/fssup.c
vendored
2
reactos/ntoskrnl/cache/fssup.c
vendored
|
@ -25,6 +25,7 @@ extern VOID NTAPI CcpUnmapThread(PVOID Unused);
|
||||||
extern VOID NTAPI CcpLazyWriteThread(PVOID Unused);
|
extern VOID NTAPI CcpLazyWriteThread(PVOID Unused);
|
||||||
HANDLE CcUnmapThreadHandle, CcLazyWriteThreadHandle;
|
HANDLE CcUnmapThreadHandle, CcLazyWriteThreadHandle;
|
||||||
CLIENT_ID CcUnmapThreadId, CcLazyWriteThreadId;
|
CLIENT_ID CcUnmapThreadId, CcLazyWriteThreadId;
|
||||||
|
FAST_MUTEX GlobalPageOperation;
|
||||||
|
|
||||||
typedef struct _NOCC_PRIVATE_CACHE_MAP
|
typedef struct _NOCC_PRIVATE_CACHE_MAP
|
||||||
{
|
{
|
||||||
|
@ -98,6 +99,7 @@ CcInitializeCacheManager(VOID)
|
||||||
CcCacheBitmap->SizeOfBitMap = ROUND_UP(CACHE_NUM_SECTIONS, 32);
|
CcCacheBitmap->SizeOfBitMap = ROUND_UP(CACHE_NUM_SECTIONS, 32);
|
||||||
DPRINT("Cache has %d entries\n", CcCacheBitmap->SizeOfBitMap);
|
DPRINT("Cache has %d entries\n", CcCacheBitmap->SizeOfBitMap);
|
||||||
ExInitializeFastMutex(&CcMutex);
|
ExInitializeFastMutex(&CcMutex);
|
||||||
|
ExInitializeFastMutex(&GlobalPageOperation);
|
||||||
|
|
||||||
// MM stub
|
// MM stub
|
||||||
KeInitializeEvent(&MmWaitPageEvent, SynchronizationEvent, FALSE);
|
KeInitializeEvent(&MmWaitPageEvent, SynchronizationEvent, FALSE);
|
||||||
|
|
4
reactos/ntoskrnl/cache/section/swapout.c
vendored
4
reactos/ntoskrnl/cache/section/swapout.c
vendored
|
@ -480,8 +480,8 @@ MiCacheEvictPages(PVOID BaseAddress, ULONG Target)
|
||||||
MmLockCacheSectionSegment(Segment);
|
MmLockCacheSectionSegment(Segment);
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < Segment->Length.QuadPart -
|
i < ((ULONG_PTR)MemoryArea->EndingAddress) -
|
||||||
MemoryArea->Data.CacheData.ViewOffset.QuadPart &&
|
((ULONG_PTR)MemoryArea->StartingAddress) &&
|
||||||
Result < Target;
|
Result < Target;
|
||||||
i += PAGE_SIZE) {
|
i += PAGE_SIZE) {
|
||||||
Offset.QuadPart = MemoryArea->Data.CacheData.ViewOffset.QuadPart + i;
|
Offset.QuadPart = MemoryArea->Data.CacheData.ViewOffset.QuadPart + i;
|
||||||
|
|
Loading…
Reference in a new issue