To get page size:
Code:
#include <stdio.h>
#include <unistd.h>
int main()
{
printf("%i, getpagesize());
return 0;
}
Simply put, you cant change the page size. And due to the way the kernel allocates memory and fragmentation within the system's physical memory, memory allocation with kmalloc isn't precise as with malloc. You'll often get a pointer to a larger chunk of memory than requested, sometimes up to double the amount.