linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Pádraig Brady" <P@draigBrady.com>,
	"David Rientjes" <rientjes@google.com>,
	"Jörn Engel" <joern@purestorage.com>,
	"Mike Kravetz" <mike.kravetz@oracle.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Naoya Horiguchi" <nao.horiguchi@gmail.com>
Subject: Re: [PATCH v6 2/2] mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status
Date: Sun, 20 Sep 2015 12:58:28 +0200	[thread overview]
Message-ID: <20150920105828.GB20562@dhcp22.suse.cz> (raw)
In-Reply-To: <1442480955-7297-3-git-send-email-n-horiguchi@ah.jp.nec.com>

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@ah.jp.nec.com>
> Acked-by: Joern Engel <joern@logfs.org>
> Acked-by: David Rientjes <rientjes@google.com>

Acked-by: Michal Hocko <mhocko@suse.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2015-09-20 10:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17  9:09 [PATCH v6 0/2] hugetlb: display per-process/per-vma usage Naoya Horiguchi
2015-09-17  9:09 ` [PATCH v6 1/2] mm: hugetlb: proc: add hugetlb-related fields to /proc/PID/smaps Naoya Horiguchi
2015-10-29 19:04   ` [PATCH v7] " Hugh Dickins
2015-09-17  9:09 ` [PATCH v6 2/2] mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status Naoya Horiguchi
2015-09-20 10:58   ` Michal Hocko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150920105828.GB20562@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=P@draigBrady.com \
    --cc=akpm@linux-foundation.org \
    --cc=joern@purestorage.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=nao.horiguchi@gmail.com \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox