Message ID | 20220614071650.206064-1-yuzhao@google.com (mailing list archive) |
---|---|
Headers | show |
Series | Multi-Gen LRU Framework | expand |
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;
On Tue, Jun 14, 2022 at 1:17 AM Yu Zhao <yuzhao@google.com> wrote: > > What's new > ========== > 1. Fixed a bug (using pmd_addr_end() when __PAGETABLE_PMD_FOLDED) > reported by: > Thomas Graichen <thomas.graichen@googlemail.com> > https://forum.armbian.com/topic/20018-mglru-patches-to-bring-down-kswapd-cpu-usage/ > 2. Retested on v5.19-rc1 and rebased to v5.19-rc2. > 3. Nits. > > TLDR > ==== > The current page reclaim is too expensive in terms of CPU usage and it > often makes poor choices about what to evict. This patchset offers an > alternative solution that is performant, versatile and > straightforward. I don't see any action items left for me. Are we good for the next merge window?
On Wed, 22 Jun 2022 00:21:47 -0600 Yu Zhao <yuzhao@google.com> wrote: > > TLDR > > ==== > > The current page reclaim is too expensive in terms of CPU usage and it > > often makes poor choices about what to evict. This patchset offers an > > alternative solution that is performant, versatile and > > straightforward. > > I don't see any action items left for me. Are we good for the next merge window? Qi Zheng just found an item ;) Yes, I'd like to get this in soon. I've been waiting for the mapletree work to converge a bit further.
On Wed, Jun 22, 2022 at 12:46 PM Andrew Morton <akpm@linux-foundation.org> wrote: > > On Wed, 22 Jun 2022 00:21:47 -0600 Yu Zhao <yuzhao@google.com> wrote: > > > > TLDR > > > ==== > > > The current page reclaim is too expensive in terms of CPU usage and it > > > often makes poor choices about what to evict. This patchset offers an > > > alternative solution that is performant, versatile and > > > straightforward. > > > > I don't see any action items left for me. Are we good for the next merge window? > > Qi Zheng just found an item ;) Well, an embarrassing one, and I hope it's the last one :) > Yes, I'd like to get this in soon. I've been waiting for the mapletree work > to converge a bit further. No worries. We are not in any rush, just planning ahead, since this patchset has conflicts with Muchun's LRU page reparenting work [1]. [1] https://lore.kernel.org/linux-mm/20220621125658.64935-1-songmuchun@bytedance.com/