https://bugs.winehq.org/show_bug.cgi?id=18745
--- Comment #21 from Austin English austinenglish@gmail.com --- (In reply to Saulius K. from comment #20)
Created attachment 53475 [details] test program for libhugetlbfs
(In reply to Austin English from comment #17)
I wasn't able to get that working on Fedora, using the sample code from https://stackoverflow.com/questions/17225200/how-to-get-the-value-of-huge- page-size (even after installing libhugetlbfs-devel).
And for me it worked . I extended source code of the test program a bit (attaching it) and got this:
huge page size = 2097152 huge page sizes [1] = 2097152 page sizes [2] = 4096 2097152 PF_LINUX_HUGETLB = 1048576
Austin, what exactly didn't work for you?
I can't easily retest and won't be able to for a few weeks. IIRC, I wasn't getting any information from libhugetlbfs (i.e., returned null or 0), but /proc/meminfo worked.
Getting it from /proc/meminfo seems to work though: [austin@localhost ~]$ cat /proc/meminfo | grep Huge AnonHugePages: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB
I've put together a patch that does that, instead.
On my system I get similar results only with an exception for AnonHugePages:
AnonHugePages: 102400 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB
But /proc/mem way is probably more hassle-free than linking to libhugetlbfs and using it.
I agree. As I said, I won't have time to look at this for a while, so feel free to submit your libhugetlbfs patch, or a modified version of my own if you've got time to work on this.