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

From: David S. Miller
Date: Tue Mar 22 2005 - 21:12:38 EST


On Wed, 23 Mar 2005 00:51:02 +0000 (GMT)
Hugh Dickins <hugh@xxxxxxxxxxx> wrote:

> This actual example helped to focus my mind a lot, thank you.

No problem, I needed to work through specific examples
to see things clearly too.

> > and things seem to behave. I'll try to analyze things
> > further and test this out on a real kernel, but all of
> > these adjustments at the top of free_pgd_range() really
> > start to look like pure spaghetti. :-)
>
> Well, it's trying to decide in reasonably few steps that it's not
> worth wasting time going down to the deeper levels. Lots of
> "return"s as it eliminates cases, yes.

Yes, I understand.

But let's recognize (as I mention in another email) that all of
the tests against ceiling are against "ceiling - 1". If we pass
-1 instead of 0 (and "foo - 1" instead of "foo") as the ceiling
arg, then adjust the tests to be against plain "ceiling", so much
of the special casing disappears.

There are probably other simplifications.

This is kind of what I was hinting at when I said it looks like
spaghetti. :-)
-
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/