I assume you are talking about x86.
There are different virtual memory split options in the kernel that can be set in its config file. Take a look at VMSPLIT_* options in arch/x86/Kconfig.
3G / 1G, 2G / 2G, 1G / 3G are all possible.
To reliably check if the address belongs to the user space or the kernel space, you can compare it against TASK_SIZE
value:
static int
is_user_space_address(unsigned long addr)
{
return (addr < TASK_SIZE);
}
Works on both 32-bit and 64-bit x86 systems at least.