From: Yu Zhao <yuzhao@google.com>
To: Barry Song <21cnbao@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
corbet@lwn.net, linux-mm@kvack.org,
lsf-pc@lists.linux-foundation.org
Subject: Re: [Chapter One] THP zones: the use cases of policy zones
Date: Tue, 5 Mar 2024 22:05:03 -0500 [thread overview]
Message-ID: <CAOUHufbn1+g7gy3Dq4RxVzojDYMr1hFgYmqFQ6Em=t8TX9Qmrw@mail.gmail.com> (raw)
In-Reply-To: <CAGsJ_4w5z38RBMvZ_kGJpd0-4Ny=dqZQnCmed6KntBv1wj3DdA@mail.gmail.com>
On Tue, Mar 5, 2024 at 4:04 PM Barry Song <21cnbao@gmail.com> wrote:
>
> On Tue, Mar 5, 2024 at 11:07 PM Vlastimil Babka <vbabka@suse.cz> wrote:
> >
> > On 3/5/24 09:41, Barry Song wrote:
> > > We did implement similar idea in the pageblock granularity on OPPO's
> > > phones by extending two special migratetypes[1]:
> > >
> > > * QUAD_TO_TRIP - this is mainly for 4-order mTHP allocation which can use
> > > ARM64's CONT-PTE; but can rarely be splitted into 3 order to dull the pain
> > > of 3-order allocation if and only if 3-order allocation has failed in both
> > > normal buddy and the below TRIP_TO_QUAD.
> > >
> > > * TRIP_TO_QUAD - this is mainly for 4-order mTHP allocation which can use
> > > ARM64's CONT-PTE; but can sometimes be splitted into 3 order to dull the
> > > pain of 3-order allocation if and only if 3-order allocation has failed in
> > > normal buddy.
> > >
> > > neither of above will be merged into 5 order or above; neither of above
> > > will be splitted into 2 order or lower.
> > >
> > > in compaction, we will skip both of above. I am seeing one disadvantage
> > > of this approach is that I have to add a separate LRU list in each
> > > zone to place those mTHP folios. if mTHP and small folios are put
> > > in the same LRU list, the reclamation efficiency is extremely bad.
> > >
> > > A separate zone, on the other hand, can avoid a separate LRU list
> > > for mTHP as the new zone has its own LRU list.
> >
> > But we switched from per-zone to per-node LRU lists years ago?
> > Is that actually a complication for the policy zones? Or does this work
> > silently assume multigen lru which (IIRC) works differently?
>
> the latter. based on the below code, i believe mglru is different
> with active/inactive,
>
> void lru_gen_init_lruvec(struct lruvec *lruvec)
> {
> int i;
> int gen, type, zone;
> struct lru_gen_folio *lrugen = &lruvec->lrugen;
>
> lrugen->max_seq = MIN_NR_GENS + 1;
> lrugen->enabled = lru_gen_enabled();
>
> for (i = 0; i <= MIN_NR_GENS + 1; i++)
> lrugen->timestamps[i] = jiffies;
>
> for_each_gen_type_zone(gen, type, zone)
> INIT_LIST_HEAD(&lrugen->folios[gen][type][zone]);
>
> lruvec->mm_state.seq = MIN_NR_GENS;
> }
>
> A fundamental difference is that mglru has a different aging and
> eviction mechanism,
> This can synchronize the LRUs of each zone to move forward at the same
> pace while
> the active/inactive might be unable to compare the ages of folios across zones.
That's correct. The active/inactive should also work with the extra
zones, just like it does for ZONE_MOVABLE. But it's not as optimized
as MGLRU, e.g., targeting eligible zones without search the entire LRU
list containing folios from all zones.
next prev parent reply other threads:[~2024-03-06 3:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 18:34 [LSF/MM/BPF TOPIC] TAO: THP Allocator Optimizations Yu Zhao
2024-02-29 18:34 ` [Chapter One] THP zones: the use cases of policy zones Yu Zhao
2024-02-29 20:28 ` Matthew Wilcox
2024-03-06 3:51 ` Yu Zhao
2024-03-06 4:33 ` Matthew Wilcox
2024-02-29 23:31 ` Yang Shi
2024-03-03 2:47 ` Yu Zhao
2024-03-04 15:19 ` Matthew Wilcox
2024-03-05 17:22 ` Matthew Wilcox
2024-03-05 8:41 ` Barry Song
2024-03-05 10:07 ` Vlastimil Babka
2024-03-05 21:04 ` Barry Song
2024-03-06 3:05 ` Yu Zhao [this message]
2024-05-24 8:38 ` Barry Song
2024-11-01 2:35 ` Charan Teja Kalla
2024-11-01 16:55 ` Yu Zhao
2024-02-29 18:34 ` [Chapter Two] THP shattering: the reverse of collapsing Yu Zhao
2024-02-29 21:55 ` Zi Yan
2024-03-03 1:17 ` Yu Zhao
2024-03-03 1:21 ` Zi Yan
2024-06-11 8:32 ` Barry Song
2024-02-29 18:34 ` [Chapter Three] THP HVO: bring the hugeTLB feature to THP Yu Zhao
2024-02-29 22:54 ` Yang Shi
2024-03-01 15:42 ` David Hildenbrand
2024-03-03 1:46 ` Yu Zhao
2024-02-29 18:34 ` [Epilogue] Profile-Guided Heap Optimization and THP fungibility Yu Zhao
2024-03-05 8:37 ` [LSF/MM/BPF TOPIC] TAO: THP Allocator Optimizations Barry Song
2024-03-06 15:51 ` Johannes Weiner
2024-03-06 16:40 ` Zi Yan
2024-03-13 22:09 ` Kaiyang Zhao
2024-05-15 21:17 ` Yu Zhao
2024-05-15 21:52 ` Yu Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOUHufbn1+g7gy3Dq4RxVzojDYMr1hFgYmqFQ6Em=t8TX9Qmrw@mail.gmail.com' \
--to=yuzhao@google.com \
--cc=21cnbao@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox