Re: [RFC] memblock; Properly handle overlaps

From: Benjamin Herrenschmidt
Date: Sat Mar 05 2011 - 19:50:40 EST


On Sat, 2011-03-05 at 15:20 -0800, Yinghai Lu wrote:
>
> maybe we can omit rgn->size == 0 checking here.
> with that case, dummy array will go though to some extra checking.
>
> if (rgn->base <= base && rend >= end)
> if (base < rgn->base && end >= rgn->base) {
> if (base <= rend && end >= rend) {
>
> but we can spare more checking regarding
> rgn->size == 0

Well, the array can be collasped to dummy by the removal of the last
block when doing a top overlap, then on the next loop around, we can
potentially hit the if (base <= rend && end >= rend) test, and loop
again no ?

I'd rather keep the test in .. won't hurt.

Cheers,
Ben.

--
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/