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

David S. Miller
2005-03-22T20:36:02Z

On Tue, 22 Mar 2005 19:36:46 +0000 (GMT)
Hugh Dickins <hugh@veritas.com> wrote:

> I notice that although both i386 and sparc64 use pgtable-nopud.h, the
> i386 pud_clear does nothing at all and the sparc64 pud_clear resets to 0.

This was a dead end. I386 doesn't do anything with pud_clear() in
order to work around a chip erratum.

IA64 does clear in pud_clear() just like sparc64.

I think it's the floor/ceiling stuff.

At that pud_clear(), we do it if floor-->ceiling (after masking)
covers the whole PUD. Not whether start/end do, which is what
the code sort of does right now.

"start" and "end" say which specific entries we might be purging.
"floor" and "ceiling" say that once that purging is done, the
extent of the potential address space freed.

I cooked up a quick patch that changes the logic to:

floor &= PUD_MASK;
ceiling &= PUD_MASK;
if (floor - 1 >= ceiling - 1)
return;

pmd = pmd_offset(pud, start);
pud_clear(pud);
pmd_free_tlb(tlb, pmd);

and things start to basically work.

When X started up my machine rebooted, but this was with
all the tracing printk()'s enabled so I'm skeptical as to
the reason. I'll back out the debugging and play with this
some more.