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

From: Chen, Kenneth W
Date: Tue Mar 30 2004 - 15:08:09 EST

>>>>> Andy Whitcroft wrote on Tuesday, March 30, 2004 4:58 AM
> >
> > 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.

Not quite, I can simply mmap on a hugetlbfs backed file to get hugetlb
pages. File expansion is transparent. It gets even trickier with file
that has holes in it.

I can do:
fd = open("/mnt/htlb/myhtlbfile", O_CREAT|O_RDWR, 0755);
mmap(..., fd, offset);

Accounting didn't happen in this case, (grep Huge /proc/meminfo):

HugePages_Total: 10
HugePages_Free: 9
Hugepagesize: 262144 kB
HugeCommitted_AS: 0 kB

Now if I remove the file "myhtlbfile", accounting is done for inode
removal and hugetlb_committed_space underflows.

HugePages_Total: 10
HugePages_Free: 10
Hugepagesize: 262144 kB
HugeCommitted_AS: 18446744073709289472 kB

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at