[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 all, I was looking into Linux kernel documentation, and I ran into one very fundamental question: Why does Linux divide virtual address space into 1/3G between kernel and user address space? Please note that I'm not asking "why 1/3G? why not 2/2G?". I was able to find some discussion online about this matter. However, my question is more basic - naive, some may say. 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 don't really understand the whole protection domain thing either...(i.e., using special instruction to make certain range of memory address visible.) I mean, sure, user process should not be able to access kernel data structures and so on. But can't that be done with page table (access control flags)? I mean, one of the reasons to use virtual memory is for protecting process from each other. Why couldn't that be directly applied for user process and kernel? BTW, 1G for kernel means kernel should only reside within this range? (I highly doubt it....) For me, without clear understanding on why we need such division, the scheme seems meaningless, and wasteful (since user space is now 1G short). I'm sure I have a huge conceptual mess-up somewhere, but I can't seem to figure out. Please lend me your wisdom! :) P.S. Since we're in the topic of memory management in Linux, let me bring in another question that I've been having difficult time with... What is HIGH_MEM, and why is it important? How is this concept used in Linux? I had this question since beginning of this year... It's time to get to the bottom of it. Thank you all. -- Antino Kim -- 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