From c69ad5efa2d1962b6931599fb36060edd09a14e5 Mon Sep 17 00:00:00 2001 From: Thamatip Chitpong Date: Tue, 24 Dec 2024 20:02:23 +0700 Subject: [PATCH] [NTOS:MM] MmRequestPageMemoryConsumer: Properly mark CORE-17624 delay hack Addendum to commit 2b14056600bae80532f7ab9320fdc0853a55e30a. --- ntoskrnl/mm/balance.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/mm/balance.c b/ntoskrnl/mm/balance.c index bdb50c78707..eb5e6f1d05f 100644 --- a/ntoskrnl/mm/balance.c +++ b/ntoskrnl/mm/balance.c @@ -314,10 +314,12 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, PPFN_NUMBER AllocatedPage) { PFN_NUMBER Page; + + /* Delay some requests for the Memory Manager to recover pages (CORE-17624). + * FIXME: This is suboptimal. + */ static INT i = 0; static LARGE_INTEGER TinyTime = {{-1L, -1L}}; - - /* Delay some requests for the Memory Manager to recover pages */ if (i++ >= 100) { KeDelayExecutionThread(KernelMode, FALSE, &TinyTime);