Re: [PATCH] slob: poor man's NUMA, take 2.

Matt Mackall
2007-06-13T03:28:57Z

On Wed, Jun 13, 2007 at 12:12:03PM +0900, Paul Mundt wrote:
> Here's an updated copy of the patch adding simple NUMA support to SLOB,
> against the current -mm version of SLOB this time.
>
> I've tried to address all of the comments on the initial version so far,
> but there's obviously still room for improvement.
>
> This approach is not terribly scalable in that we still end up using a
> global freelist (and a global spinlock!) across all nodes, making the
> partial free page lookup rather expensive. The next step after this will
> be moving towards split freelists with finer grained locking.
>
> The scanning of the global freelist could be sped up by simply ignoring
> the node id unless __GFP_THISNODE is set. This patch defaults to trying
> to match up the node id for the partial pages (whereas the last one just
> grabbed the first partial page from the list, regardless of node
> placement), but perhaps that's the wrong default and should only be done
> for __GFP_THISNODE?

Hmmm. There's not a whole lot that uses __GFP_THISNODE. Dunno.

> +static inline void *slob_new_page(gfp_t gfp, int order, int node)
> +{
> + void *page;
> +
> +#ifdef CONFIG_NUMA
> + if (node != -1)
> + page = alloc_pages_node(node, gfp, order);
> + else
> +#endif
> + page = alloc_pages(gfp, order);
> +
> + if (!page)
> + return NULL;
> +
> + return page_address(page);

We might want to leave the inlining decision here to the compiler. The
ifdef may change that decision..

> -void *__kmalloc(size_t size, gfp_t gfp)
> +static void *slob_node_alloc(size_t size, gfp_t gfp, int node)

See my comment in the last message.

--
Mathematics is the supreme nostalgia of our time.