Re: [PATCH] genalloc: make possible to use a custom allocation algorithm

From: Benjamin Gaignard
Date: Mon Sep 10 2012 - 03:56:52 EST


In my mind 'data' is for custom algorithms that could need additional
data to perform the allocation (it is very similar to what is done in
gen_pool_for_each_chunk function).

In gen_pool_set_algo function I have test 'algo' just be sure that we
alway have a valid algorithm function.
gen_pool_alloc doesn't take pool->lock, only rcu_lock, and I want to
avoid changing allocation function while gen_pool_alloc use it, so I
have only protect pool->algo with rcu_lock.
I need to export gen_pool_best_fit so I have do the same for gen_pool_first_fit.

I will add more detail about that in kerneldoc and fix the other
mistakes before send a new version of this patch.

Regards,
Benjamin Gaignard
--
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/