RE: [PATCH] [0/6] HUGETLB memory commitment

From: Andy Whitcroft <apw_at_shadowen.org>
Date: 2004-03-30 22:57:39
--On 29 March 2004 12:45 -0800 "Chen, Kenneth W" <kenneth.w.chen@intel.com> wrote:

> +int hugetlbfs_report_meminfo(char *buf)
> +{
> +	long htlb = atomic_read(&hugetlb_committed_space);
> +	return sprintf(buf, "HugeCommited_AS: %5lu\n", htlb);
> +}
> 
> "HugeCommited_AS", typo?? Should that be double "t"?  Also can we print
> in terms of kB instead of num pages to match all other entries? Something
> Like: htlb<<(PAGE_SHIFT-10)?

Doh and Doh.  Yes, we went though a stage where this was in hugetlb
pages, but it has ended up in the same units as the small page
pool.  Attached is a replacement patch with this changed, below
is a relative diff against the previous patch.

> overcomit is not checked for hugetlb mmap, is it intentional here?

> Just to follow up myself, I meant overcommit accounting is not done
> for mmap hugetlb page.  (typical Monday morning symptom :))

Essentially, hugetlb pages can only be part of a shared mapping in
the current implementation.  As a result all commitments are made
and checked at segment create time.  The commitment cannot change.

Hope that's what you meant.

Martin, perhaps this is a candidate for your -mjb tree?

-apw

diff -X /home/apw/lib/vdiff.excl -rupN reference/fs/hugetlbfs/inode.c current/fs/hugetlbfs/inode.c
--- reference/fs/hugetlbfs/inode.c	2004-03-29 14:05:22.000000000 +0100
+++ current/fs/hugetlbfs/inode.c	2004-03-30 09:52:59.000000000 +0100
@@ -47,8 +47,10 @@ int hugetlb_acct_memory(long delta)
 
 int hugetlbfs_report_meminfo(char *buf)
 {
+#define K(x) ((x) << (PAGE_SHIFT - 10))
 	long htlb = atomic_read(&hugetlb_committed_space);
-	return sprintf(buf, "HugeCommited_AS: %5lu\n", htlb);
+	return sprintf(buf, "HugeCommitted_AS: %5lu kB\n", K(htlb));
+#undef K
 }
 
 static struct super_operations hugetlbfs_ops;



-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Tue Mar 30 07:57:09 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:25 EST