Confirming memory page size on Openwrt without getconf

For my RPi5B running ArchARM or RPiOS, I can confirm my 16k page size via:

% getconf PAGESIZE
16384

Openwrt does not seem to package getconf. Anyone know of a way to confirm the pagesize without getconf?

I found this, see the responses. https://stackoverflow.com/a/6261746/4166792

I tried one of the suggestions, looks like it works:

$ echo "$(( $(grep Mapped: /proc/meminfo | awk '{ print $2 }') * 1024 / $(grep nr_mapped /proc/vmstat | awk '{ print $2 }') ))"
4096

Thanks for the reply @efahl I also found this method, but it requires a kernel compiled with /proc page monitoring enabled. See this thread.

It does work though. On my RPi5B patched with this:

% grep -i -m 2 pagesize /proc/self/smaps
KernelPageSize:       16 kB
MMUPageSize:          16 kB
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.