Re: [PATCH] SLUB: revert direct page allocator pass through

From: Nick Piggin
Date: Mon Feb 02 2009 - 20:34:21 EST


On Tuesday 27 January 2009 04:17:28 Christoph Lameter wrote:
> On Sat, 24 Jan 2009, Nick Piggin wrote:

> > Other ones which could be changed but could introduce regressions are
> > watermarks, buddy merging, and struct page error checking and setup.
>
> Isnt it possible to defer that (queuing them (sigh)).

If you defer it then you lose merge opportunities and effectively increase
the rate of fragmentation.


> A bitmap could be
> used to avoid queuing and may even allow fully concurrent allocations
> without locks. Use a counter to check watermarks once in a while.

Bitmap? Involving locks or atomic operations, right?


> > (I did make that patch to enable refcounting to be avoided FWIW, which
> > avoids a couple of atomic operations, but I don't think it brought
> > performance up too much, but I still intend to dust it off at some
> > point).
>
> Well if the page stays with a refcount of one then we do not need to check
> the refcount at all but just push it in an out of some queue / bitmap or
> something.

I sent you the patch but I don't think you ever came back with numbers.
It's trivial, you just can avoid the put_page_testzero if the caller does
not need refcounting and the refcount remains at 0 (has to remain 0, not
1, because of speculative page references).

The page refcounting layer lives on top of the buddy/queueing/etc layers,
so the same technique works no matter what the underlying allocator looks
like.

The only reason I didn't merge it is that it added another branch. I wanted
to rework the APIs a little bit to avoid it.

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