Re: Kernel code and processor's Cache
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Fri, 9 Apr 2010 15:21:34 -0700 (PDT)
On Apr 9, 3:14 pm, feng <xu_feng...@xxxxxxxxx> wrote:
the kernel cache can be switched off when
not used.
Not easily. You can't switch the cache off without a full writeback.
Having to wait for the writeback before you could get the user-space
code running would be a disaster.
And, of course, if the cache is off, you can't use its data, since it
might be stale. So the kernel would always start on an empty cache.
Also, this would dramatically increase the cost of the most common
system calls. Consider how often the main reason you invoked the
kernel is to get some data from user-space (likely user-space put it
into in the cache) or to pass some data to user-space (likely through
the cache since user-space will use it as soon as the kernel returns
it). Using separate caches would make all these operations *much* more
expensive.
Think about a simple system call like 'gettimeofday'. The kernel would
put the result into the memory locations the user code specified,
putting it into the kernel cache in such a design. Now we're about to
switch to user space, with the data the user space program is about to
need in the kernel cache we're about to switch off, then what?
DS
.
- Follow-Ups:
- Re: Kernel code and processor's Cache
- From: John Hasler
- Re: Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- References:
- Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- From: David Schwartz
- Re: Kernel code and processor's Cache
- From: Joe Pfeiffer
- Re: Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- From: Tim Roberts
- Re: Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- From: David Schwartz
- Re: Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- From: David Schwartz
- Re: Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- From: feng
- Re: Kernel code and processor's Cache
- From: David Schwartz
- Re: Kernel code and processor's Cache
- From: feng
- Kernel code and processor's Cache
- Prev by Date: Re: Kernel code and processor's Cache
- Next by Date: Re: Kernel code and processor's Cache
- Previous by thread: Re: Kernel code and processor's Cache
- Next by thread: Re: Kernel code and processor's Cache
- Index(es):
Relevant Pages
|