[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-newbie
Subject:    RE: [LINUX-NEWBIE] What's the deal with 1/3G separation between kernel address space and user addres
From:       "Rajat Jain" <Rajat.Jain () infogain ! com>
Date:       2008-03-31 5:55:08
Message-ID: C86899CCB10A6C4E93D5978DCB232D4B0801A58C () GDCMX01 ! igglobal ! com
[Download RAW message or body]



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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic