One can just add APIs to the Linux kernel, and this would be a pretty straightforward one. (though it might be a little more difficult to avoid a syscall here)
I'm sure an agent can work on this and get some numbers with a day's worth of tokens.
You don’t need an api. Just touch the page.
The API already exists: mlock.