Re: [RFC v2 PATCH 0/5] Promotion of Unmapped Page Cache Folios.

From: Gregory Price
Date: Sun Dec 22 2024 - 11:22:44 EST


On Sun, Dec 22, 2024 at 03:09:44PM +0800, Huang, Ying wrote:
> Gregory Price <gourry@xxxxxxxxxx> writes:
> > That's 3-6% performance in this contrived case.
>
> This is small too.
>

Small is relative. 3-6% performance increase across millions of servers
across a year is a non trivial speedup for such a common operation.

> > Can easily piggyback on that, just wasn't sure if overloading it was
> > an acceptable idea.
>
> It's the recommended setup in the original PMEM promotion
> implementation. Please check commit c959924b0dc5 ("memory tiering:
> adjust hot threshold automatically").
>
> > Although since that promotion rate limit is also
> > per-task (as far as I know, will need to read into it a bit more) this
> > is probably fine.
>
> It's not per-task. Please read the code, especially
> should_numa_migrate_memory().

Oh, then this is already throttled. We call mpol_misplaced which calls
should_numa_migrate_memory.

There's some duplication of candidate selection logic between
promotion_candidate and should_numa_migrate_memory, but it may be
beneficial to keep it that way. I'll have to look.

~Gregory