lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171025065527.wmii7ce5y5i4exx5@dhcp22.suse.cz>
Date:   Wed, 25 Oct 2017 08:55:27 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     Prakash Sangappa <prakash.sangappa@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, minchan@...nel.org, rientjes@...gle.com,
        dancol@...gle.com, Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Subject: Re: [PATCH] Hugetlb pages rss accounting is incorrect in
 /proc/<pid>/smaps

[CCing Naoya]

On Tue 24-10-17 16:56:08, Prakash Sangappa wrote:
> Resident set size(Rss) accounting of hugetlb pages is not done
> currently in /proc/<pid>/smaps. The pmap command reads rss from
> this file and so it shows Rss to be 0 in pmap -x output for
> hugetlb mapped vmas. This patch fixes it.

We do not account in rss because we do have a dedicated counters
depending on whether the hugetlb page is mapped privately or it is
shared. The reason this is not in RSS IIRC is that a large unexpected
RSS from hugetlb pages might confuse system monitors. This is one of
those backward compatibility issues when you start accounting something
too late.

> Signed-off-by: Prakash Sangappa <prakash.sangappa@...cle.com>
> ---
>  fs/proc/task_mmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 5589b4b..c7e1048 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -724,6 +724,7 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask,
>  			mss->shared_hugetlb += huge_page_size(hstate_vma(vma));
>  		else
>  			mss->private_hugetlb += huge_page_size(hstate_vma(vma));
> +		mss->resident += huge_page_size(hstate_vma(vma));
>  	}
>  	return 0;
>  }
> -- 
> 2.7.4
> 

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ