Re: [PATCH v2] Revert "mm: skip CMA pages when they are not available"

From: Barry Song
Date: Thu Mar 21 2024 - 21:33:18 EST


On Wed, Mar 20, 2024 at 2:40 AM Michal Hocko <mhocko@xxxxxxxx> wrote:
>
> On Tue 19-03-24 19:09:18, Barry Song wrote:
> > On Tue, Mar 19, 2024 at 4:56 PM Michal Hocko <mhocko@xxxxxxxx> wrote:
> > >
> > > On Fri 15-03-24 16:18:03, liuhailong@xxxxxxxx wrote:
> > > > From: "Hailong.Liu" <liuhailong@xxxxxxxx>
> > > >
> > > > This reverts
> > > > commit b7108d66318a ("Multi-gen LRU: skip CMA pages when they are not eligible")
> > > > commit 5da226dbfce3 ("mm: skip CMA pages when they are not available")
> > > >
> > > > skip_cma may cause system not responding. if cma pages is large in lru_list
> > > > and system is in lowmemory, many tasks would direct reclaim and waste
> > > > cpu time to isolate_lru_pages and return.
> > > >
> > > > Test this patch on android-5.15 8G device
> > > > reproducer:
> > > > - cma_declare_contiguous 3G pages
> > > > - set /proc/sys/vm/swappiness 0 to enable direct_reclaim reclaim file
> > > > only.
> > > > - run a memleak process in userspace
> > >
> > > Does this represent a sane configuration? CMA memory is unusable for
> > > kernel allocations and memleak process is also hard to reclaim due to
> > > swap suppression. Isn't such a system doomed to struggle to reclaim any
> > > memory? Btw. how does the same setup behave with the regular LRU
> > > implementation? My guess would be that it would struggle as well.
> >
> > I assume the regular LRU implementation you are talking about is the LRU
> > without skip_cma()?
>
> No, I mean standard LRU reclaim implementation rather than MGLRU.

I guess Hailong was running the standard LRU with active/inactive lists
as his v1 even didn't touch MGLRU,
https://lore.kernel.org/linux-mm/20240314141516.31747-1-liuhailong@xxxxxxxx/

Hailong, please correct me if this is not the case.

>
> --
> Michal Hocko
> SUSE Labs