Re: [PATCH *] rmap VM, version 12

David S. Miller
2002-01-23T19:30:14Z

From: Rik van Riel <riel@conectiva.com.br>
Date: Wed, 23 Jan 2002 17:22:30 -0200 (BRST)

On Wed, 23 Jan 2002, David S. Miller wrote:

> Actually, this is just using the pte_free_fast() and
> {get,free}_pgd_fast() functions on non-pae machines.
>
> Rofl, you can't just do that. The page tables cache caches the kernel
> mappings and if you don't update them properly on SMP you die.

Umm, this list just contains _freed_ page tables without
any mappings, right ?

No.

If there is some specific magic I'm missing, could you
please point me to the code I'm overlooking ? ;)

Look at what get_pgd_slow() in pgalloc.h does, this is the
case where it isn't going to the cache and it is really allocating the
memory.

When the pgd comes fresh off the cache chain, it doesn't do any
of this stuff, it just gives you the cached PGD with all the PMD's
filled in already, including the kernel PMDs.

Hmmm... maybe the "we can fault on kernel mappings" thing takes
care of this because kernel PMDs can only appear, not go away.