Re: [RFC PATCH 1/3] mm/memory-tiers Add functions for tier memory usage in a cgroup

From: Tim Chen
Date: Thu Jun 23 2022 - 19:07:43 EST


On Tue, 2022-06-21 at 09:48 +0530, Aneesh Kumar K.V wrote:
> Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx> writes:
>
> +unsigned long mem_cgroup_toptier_usage(struct mem_cgroup *memcg)
> > +{
> > + struct memory_tier *top_tier;
> > +
> > + top_tier = list_first_entry(&memory_tiers, struct memory_tier, list);
> > + if (top_tier)
> > + return mem_cgroup_memtier_usage(memcg, top_tier);
> > + else
> > + return 0;
> > +}
>
> As discussed here, we would want to consider all memory tiers that got
> compute as top tier.
>
> https://lore.kernel.org/linux-mm/11f94e0c50f17f4a6a2f974cb69a1ae72853e2be.camel@xxxxxxxxx
>
> V6 patchset actually walk the full memory tier hierarchy reverse and consider any
> memory tier with higher or equal rank value than the first memory tier with CPU as top tier.
>
> https://lore.kernel.org/linux-mm/20220610135229.182859-12-aneesh.kumar@xxxxxxxxxxxxx
>

Thanks. Will take that into consideration for future patches.

Tim