Re: [PATCH v4] Add /proc/PID/smaps support for DAX

From: Michal Hocko
Date: Fri Oct 27 2017 - 05:26:34 EST


On Fri 27-10-17 09:17:07, Du, Fan wrote:
[...]
> >But you cannot touch rss and pss because you are going to break existing
> >users as Dave already pointed out.
>
> Why it will break something? Do you mind to elaborate?
> The vma part of each smaps portion has associated file if does exist,
> The user spaces monitoring tools will definitely check this field.

Because there are tools which evaluate rss and pss as the real _memory_
consumption. If you put non-ram based memory there you would confuse
them and they would do wrong decisions. In fact we do not even include
all the RAM based memory there. For example hugetlb pages are not
involved and have their separate counter because there are tools which
would misjudge processes with large hugetlb mapping - e.g. kill them as
excessive consumers without any memory returned back to the system.

While all this is really far from ideal, this is how the userspace work
and we are not breaking existing usecases.

--
Michal Hocko
SUSE Labs