https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6ba67b8152def148a87fd…
commit 6ba67b8152def148a87fdd6049e65956fb4656a9
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Tue Jan 23 21:36:19 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Tue Jan 23 23:25:26 2018 +0100
[NTOSKRNL] Bug fix: lazy write more often.
CcDirtyPageThreshold is not here to compute when you have to write,
but to know where you have to deny writes.
More commits to come in that direction!
CORE-14235
---
ntoskrnl/cc/view.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index 8fb7f5333c..0d1822c696 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -326,23 +326,18 @@ CciLazyWriter(PVOID Unused)
/* We're not sleeping anymore */
KeClearEvent(&iLazyWriterNotify);
- /* Only start operations if above threshold */
- DPRINT("TS: %lu, Count: %lu\n", CcDirtyPageThreshold,
CcTotalDirtyPages);
- if (CcTotalDirtyPages > CcDirtyPageThreshold)
+ /* Our target is one-eighth of the dirty pages */
+ Target = CcTotalDirtyPages / 8;
+ if (Target != 0)
{
- /* Our target is one-eighth of the dirty pages */
- Target = CcTotalDirtyPages / 8;
- if (Target != 0)
- {
- /* Flush! */
- DPRINT("Lazy writer starting (%d)\n", Target);
- CcRosFlushDirtyPages(Target, &Count, FALSE, TRUE);
-
- /* And update stats */
- CcLazyWritePages += Count;
- ++CcLazyWriteIos;
- DPRINT("Lazy writer done (%d)\n", Count);
- }
+ /* Flush! */
+ DPRINT("Lazy writer starting (%d)\n", Target);
+ CcRosFlushDirtyPages(Target, &Count, FALSE, TRUE);
+
+ /* And update stats */
+ CcLazyWritePages += Count;
+ ++CcLazyWriteIos;
+ DPRINT("Lazy writer done (%d)\n", Count);
}
/* Inform people waiting on us that we're done */