RE: [LINUX-NEWBIE] What's the deal with 1/3G separation between kernel address space and user address space?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

>> 
>> Why is there a division at all? As I understand, there occurs a
>> context switch between user-level process and the kernel when syscall
>> is made. Then why are we reserving 1G for kernel? Why isn't it
>> possible to give full 4G address space to the user process, and
>> kernel gets full 4G space when switched in?

I'm not an expert, but if asked, I think performance can be one of the reasons. Assume that a 4G address space is given to all the processes. Hence for every context switch, we'll need to switch the 4G address space. Out of this address space, we know that a BIG chunk (kernel code + kernel data structures) is always the same for all the processes. So why not switch just the pages that the user is going to use. And hence it might be thought that 3G is enough for application, and 1G can be spared for kernel. Hope I'm making some sense...

> 
> Since userspace applications calls kernel functions (read(), open()
> and so on), those kernel functions used must be mapped in the address
> space that an application may see, i.e. the userspace and kernel
> space must share the address range. 

The user space applications never "call" kernel code / functions. They just make a syscall....

Thanks,

Rajat
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux