lkml.org 
[lkml]   [2022]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v12 08/14] mm: multi-gen LRU: support page table walks
On Tue, Jun 14, 2022 at 01:16:45AM -0600, Yu Zhao wrote:
> +static bool get_next_vma(unsigned long mask, unsigned long size, struct mm_walk *args,
> + unsigned long *vm_start, unsigned long *vm_end)
> +{
> + unsigned long start = round_up(*vm_end, size);
> + unsigned long end = (start | ~mask) + 1;
> +
> + VM_WARN_ON_ONCE(mask & size);
> + VM_WARN_ON_ONCE((start & mask) != (*vm_start & mask));
> +
> + while (args->vma) {
> + if (start >= args->vma->vm_end) {
> + args->vma = args->vma->vm_next;
> + continue;
> + }
> +
> + if (end && end <= args->vma->vm_start)
> + return false;
> +
> + if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args)) {
> + args->vma = args->vma->vm_next;
> + continue;
> + }
> +
> + *vm_start = max(start, args->vma->vm_start);
> + *vm_end = min(end - 1, args->vma->vm_end - 1) + 1;
> +
> + return true;
> + }
> +
> + return false;
> +}

Andrew,

The above function has a conflict with Maple Tree. Please use the
following fix-up if you apply MGLRU on top of Maple Tree. Thanks.

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 69a52aae1e03..05e62948e365 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3749,23 +3749,14 @@ static bool get_next_vma(unsigned long mask, unsigned long size, struct mm_walk
{
unsigned long start = round_up(*vm_end, size);
unsigned long end = (start | ~mask) + 1;
+ VMA_ITERATOR(vmi, args->mm, start);

VM_WARN_ON_ONCE(mask & size);
VM_WARN_ON_ONCE((start & mask) != (*vm_start & mask));

- while (args->vma) {
- if (start >= args->vma->vm_end) {
- args->vma = args->vma->vm_next;
+ for_each_vma_range(vmi, args->vma, end) {
+ if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args))
continue;
- }
-
- if (end && end <= args->vma->vm_start)
- return false;
-
- if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args)) {
- args->vma = args->vma->vm_next;
- continue;
- }

*vm_start = max(start, args->vma->vm_start);
*vm_end = min(end - 1, args->vma->vm_end - 1) + 1;
\
 
 \ /
  Last update: 2022-06-14 09:25    [W:0.488 / U:1.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site