Re: [PATCH 1/5] freepgt: free_pgtables use vma list

From: David S. Miller
Date: Tue Mar 22 2005 - 18:35:07 EST


On Tue, 22 Mar 2005 14:40:55 -0800
"Luck, Tony" <tony.luck@xxxxxxxxx> wrote:

> Then I don't see how we decide when to clear a pointer at each
> level. Are there counters of how many entries are active in each
> table at all levels (pgd/pud/pmd/pte)?

No, there are no counters.

How it works is that it knows the extent in each direction
where mappings do not exist.

Once we know we have a clear span up to the next PMD_SIZE
modulo (and PUD_SIZE and so on and so forth) we know we
can liberate the page table chunks covered by such ranges.

Say we are unmapping a page at some address. The next VMA
in the address space says where the next potentially valid
mapping resides. The previous VMA says similarly. If this
is the first or last VMA, we use the beginning or end of
the virtual address space as our value.

Play around with my little simulator I posted, you'll see how
it works ;-) Actually, this is the second such simulator you
have seen Tony :-)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" 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.tux.org/lkml/