[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <109ca1ea59b9dd6f2daf7b7fbc74e83ae074fbdf.1693287931.git.raghavendra.kt@amd.com>
Date: Tue, 29 Aug 2023 11:36:13 +0530
From: Raghavendra K T <raghavendra.kt@....com>
To: <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
CC: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
"Mel Gorman" <mgorman@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
"David Hildenbrand" <david@...hat.com>, <rppt@...nel.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Bharata B Rao <bharata@....com>,
Aithal Srikanth <sraithal@....com>,
"kernel test robot" <oliver.sang@...el.com>,
Raghavendra K T <raghavendra.kt@....com>,
Sapkal Swapnil <Swapnil.Sapkal@....com>,
K Prateek Nayak <kprateek.nayak@....com>
Subject: [RFC PATCH V1 5/6] sched/numa: Allow recently accessed VMAs to be scanned
This ensures hot VMAs get scanned on priority irresepctive of their
access by current task.
Suggested-by: Bharata B Rao <bharata@....com>
Signed-off-by: Raghavendra K T <raghavendra.kt@....com>
---
kernel/sched/fair.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3ae2a1a3ef5c..6529da7f370a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2971,8 +2971,22 @@ static inline bool vma_test_access_pid_history(struct vm_area_struct *vma)
return test_bit(pid_bit, &pids);
}
+static inline bool vma_accessed_recent(struct vm_area_struct *vma)
+{
+ unsigned long *pids, pid_idx;
+
+ pid_idx = vma->numab_state->access_pid_idx;
+ pids = vma->numab_state->access_pids + pid_idx;
+
+ return (bitmap_weight(pids, BITS_PER_LONG) >= 1);
+}
+
static bool vma_is_accessed(struct vm_area_struct *vma)
{
+ /* Check at least one task had accessed VMA recently. */
+ if (vma_accessed_recent(vma))
+ return true;
+
/* Check if the current task had historically accessed VMA. */
if (vma_test_access_pid_history(vma))
return true;
--
2.34.1
Powered by blists - more mailing lists