Changing page size

I'd like to occasionally mine Monero on one of my FreeBSD machine. Machine has got a lot of ram 32GB to be precise.
According to my miners documentation I might get better performance with 1GB pages (see https://xmrig.com/docs/miner/hugepages)

When I start xmrig I get :
* ABOUT XMRig/6.22.2-mo1 clang/18.1.5 (built for FreeBSD x86-64, 64 bit)
* LIBS libuv/1.50.0 OpenSSL/3.0.16 hwloc/1.11.13
* HUGE PAGES supported
* 1GB PAGES unavailable
* CPU Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (1) 64-bit AES
L2:1.5 MB L3:12.0 MB 6C/12T NUMA:1

I'de like to see enabled and enabled.

On my system I have the following
root@NomadBSD:/boot # pagesize
4096

It seems I need to change `hw.pagesizes`. Looking at the possible values I see that :
root@NomadBSD:/boot # sysctl -a |grep pagesi
hw.pagesize: 4096
hw.pagesizes: { 4096, 2097152, 1073741824 }
p1003_1b.pagesize: 4096

I've tried modifying that using loader.conf and it looks like that :
cat /boot/loader.conf

# add 1GB page size
hw.pagesizes=1073741824
This doesn't change anything. Is there a way to enable these huge pages?
 
You can't just change the whole system and all apps to a different page size.

FreeBSD has transparent support for 2 MB pages. The only control is the MAP_ALIGNED_SUPER flag for mmap. So you have to have the source code support it if you don't get satisfactory amount of large pages by default.

It is unlikely that this makes a major performance difference. Going from 2 M to 1 G pages even less.
 
Back
Top