On Tue 13-01-26 08:51:45, Mathieu Desnoyers wrote:
> On 2026-01-13 04:24, Michal Hocko wrote:
[...]
> - Introduce new proc files, e.g.
> 
>   /proc/<pid>/rss/approximate
>   /proc/<pid>/rss/precise
> 
> Where the "approximate" file would export the following lines for each
> page type (MM_FILEPAGES, MM_ANONPAGES, MM_SWAPENTS, MM_SHMPAGES,
> allowing future additions):
> 
> <page type> <approximate> <precise_sum_min> <precise_sum_max>
> 
> And "precise" would export lines for each page type:
> 
> <page type> <precise_sum>
> 
> The key thing here is to have different files to query approximated
> vs precise values, so we don't have the overhead of the precise sum
> when all we need is an approximation.
> 
> This would expose all the bits and pieces needed to allow userspace to
> implement something similar to the 2-pass algorithm I'm proposing for
> the OOM killer, but tweaked for other use-cases.
> 
> This proposed ABI is purely hypothetical at this stage. Please let me
> know if you have something different in mind.

TBH, I am not convinced this is really needed. I would simply use the
new more-precise interface for /proc/<pid>/stat with numbers of
potential overhead payed by an increased precision. If we need to revert
to low precision then we can do that based on a specific report.

> When you mention "highlevel doc", which document do you have in mind ?
> Something related to lib/percpu_counter_tree.c or to the /proc ABI ?

Documentation/core-api/percpu_counter_tree.rst

-- 
Michal Hocko
SUSE Labs

Reply via email to