Re: [RFC PATCH 0/3] Cgroup accounting of memory tier usage

From: Michal Hocko
Date: Wed Jun 15 2022 - 07:11:47 EST


On Tue 14-06-22 15:25:32, Tim Chen wrote:
> For controlling usage of a top tiered memory by a cgroup, accounting
> of top tier memory usage is needed. This patch set implements the
> following:
>
> Patch 1 introduces interface and simple implementation to retrieve
> cgroup tiered memory usage
> Patch 2 introduces more efficient accounting with top tier memory page counter
> Patch 3 provides a sysfs interface to repot the the top tiered memory
> usage.

I guess you meant cgroupfs here, right?

> The patchset works with Aneesh's v6 memory-tiering implementation [1].
> It is a preparatory patch set before introducing features to
> control top tiered memory in cgroups.
>
> I'll like to first get feedback to see if
> (1) Controllng the topmost tiered memory is enough
> or
> (2) Multiple tiers at the top levels need to be grouped into "toptier"
> or
> (3) There are use cases not covered by (1) and (2).

I would start by asking why do we need a dedicated interface in the
first place. Why the existing numa_stat is not a proper interface. Right
now we only report LRU per node stats. Is this insufficient?
What is userspace expect to do based on the reported data?

--
Michal Hocko
SUSE Labs