mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[NTOSKRNL] Fix lazy writer for in-use VACB.
Adjusting refcount and enabling lazy-write for pinned VACB makes it actually more efficient, often purging data to disk, reducing memory stress for the system. This is required for defering writes. This commit unfortunately (?) reverts a previous revert. CORE-12081 CORE-14582 CORE-14313
This commit is contained in:
parent
3055afce81
commit
f2c44aa483
2 changed files with 9 additions and 1 deletions
|
@ -275,6 +275,10 @@ CcSetDirtyPinnedData (
|
|||
Bcb, Lsn);
|
||||
|
||||
iBcb->Dirty = TRUE;
|
||||
if (!iBcb->Vacb->Dirty)
|
||||
{
|
||||
CcRosMarkDirtyVacb(iBcb->Vacb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -205,6 +205,8 @@ CcRosFlushDirtyPages (
|
|||
|
||||
while ((current_entry != &DirtyVacbListHead) && (Target > 0))
|
||||
{
|
||||
ULONG Refs;
|
||||
|
||||
current = CONTAINING_RECORD(current_entry,
|
||||
ROS_VACB,
|
||||
DirtyVacbListEntry);
|
||||
|
@ -231,7 +233,9 @@ CcRosFlushDirtyPages (
|
|||
ASSERT(current->Dirty);
|
||||
|
||||
/* One reference is added above */
|
||||
if (CcRosVacbGetRefCount(current) > 2)
|
||||
Refs = CcRosVacbGetRefCount(current);
|
||||
if ((Refs > 3 && current->PinCount == 0) ||
|
||||
(Refs > 4 && current->PinCount > 1))
|
||||
{
|
||||
current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite(
|
||||
current->SharedCacheMap->LazyWriteContext);
|
||||
|
|
Loading…
Reference in a new issue