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: <20150920105828.GB20562@dhcp22.suse.cz>
Date:	Sun, 20 Sep 2015 12:58:28 +0200
From:	Michal Hocko <mhocko@...nel.org>
To:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Vlastimil Babka <vbabka@...e.cz>,
	Pádraig Brady <P@...igBrady.com>,
	David Rientjes <rientjes@...gle.com>,
	Jörn Engel <joern@...estorage.com>,
	Mike Kravetz <mike.kravetz@...cle.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Naoya Horiguchi <nao.horiguchi@...il.com>
Subject: Re: [PATCH v6 2/2] mm: hugetlb: proc: add HugetlbPages field to
 /proc/PID/status

On Thu 17-09-15 09:09:31, Naoya Horiguchi wrote:
> Currently there's no easy way to get per-process usage of hugetlb pages, which
> is inconvenient because userspace applications which use hugetlb typically want
> to control their processes on the basis of how much memory (including hugetlb)
> they use. So this patch simply provides easy access to the info via
> /proc/PID/status.

Thank you for making this much more lightweight. If we ever have a
request for a per-size breakdown we can add HugetlbPages-$size: value kB

> Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
> Acked-by: Joern Engel <joern@...fs.org>
> Acked-by: David Rientjes <rientjes@...gle.com>

Acked-by: Michal Hocko <mhocko@...e.com>

Just a small nit-pick, feel free to ignore if this was really intended:

[...]
> +static inline void hugetlb_count_add(long l, struct mm_struct *mm)
> +{
> +	atomic_long_add(l, &mm->hugetlb_usage);
> +}
> +
> +static inline void hugetlb_count_sub(long l, struct mm_struct *mm)
> +{
> +	atomic_long_sub(l, &mm->hugetlb_usage);
> +}

I can see why you didn't use dec_mm_counter but the ordering could be
same. Other functions which handle counters follow the same template
(target, counter/count).

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ