Hugetlb HPTE hashing weirdness

Adam Litke agl at
Fri Sep 23 00:02:27 EST 2005

On Thu, 2005-09-22 at 09:27 +1000, Benjamin Herrenschmidt wrote:
> > I may be mistaken, but it looks like for small pages the vsid is used as
> > the "key" to the hardware hash table but for huge pages only the virtual
> > page frame number (vpn) is used.  Could someone explain the difference
> > between the way huge pages and normal pages are hashed?  Using only the
> > vpn seems like it would result in false hash hits whenever separate
> > programs map huge pages at the same virtual address.
> The vsid should be used in both case, it "smells" like we may not be
> invalidating pages properly on exit, I'll have a look.

Thanks.  I suppose I should mention that I've been working with David
Gibson on demand faulting for huge pages (which is where I first
discovered the issue).  It does definitely show up (though not quite as
bad) in mainline kernels too.

> Can you send me the test program ?

Attached is my somewhat hacky hugetlb test suite.  Build it with 'make
all'.  I've been reproducing with:
	for i in `seq 1 10`; do ./mmap-gettest 1 10; done
After about the third or fourth iteration, you should start to see test

Adam Litke - (agl at
IBM Linux Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hugetlb-tests.tar.gz
Type: application/x-compressed-tar
Size: 9013 bytes
Desc: not available
Url : 

More information about the Linuxppc64-dev mailing list