mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTOSKRNL] Optimize a bit deferred writes.
In the lazy writer run, first post items that are queued for this. Only then, start executing deferred writes if any. If there were any, reschedule immediately a lazy writer run, to keep Cc warm and to make it unqueue write faster in case of high IOs situation. To make second lazy writer run happen faster, we keep our state active to use short delay (1s) instead of standard idle (3s).
This commit is contained in:
parent
db60cd219c
commit
65e29b4b1f
1 changed files with 16 additions and 10 deletions
|
@ -152,12 +152,6 @@ CcLazyWriteScan(VOID)
|
|||
DPRINT("Lazy writer done (%d)\n", Count);
|
||||
}
|
||||
|
||||
/* If we have deferred writes, try them now! */
|
||||
if (!IsListEmpty(&CcDeferredWrites))
|
||||
{
|
||||
CcPostDeferredWrites();
|
||||
}
|
||||
|
||||
/* Post items that were due for end of run */
|
||||
while (!IsListEmpty(&ToPost))
|
||||
{
|
||||
|
@ -166,10 +160,22 @@ CcLazyWriteScan(VOID)
|
|||
CcPostWorkQueue(WorkItem, &CcRegularWorkQueue);
|
||||
}
|
||||
|
||||
/* We're no longer active */
|
||||
OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
|
||||
LazyWriter.ScanActive = FALSE;
|
||||
KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
|
||||
/* If we have deferred writes, try them now! */
|
||||
if (!IsListEmpty(&CcDeferredWrites))
|
||||
{
|
||||
CcPostDeferredWrites();
|
||||
/* Reschedule immediately a lazy writer run
|
||||
* Keep us active to have short idle delay
|
||||
*/
|
||||
CcScheduleLazyWriteScan(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We're no longer active */
|
||||
OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
|
||||
LazyWriter.ScanActive = FALSE;
|
||||
KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
|
||||
}
|
||||
}
|
||||
|
||||
VOID CcScheduleLazyWriteScan(
|
||||
|
|
Loading…
Reference in a new issue