Messages in this thread | | | Date | Mon, 10 Sep 2012 09:56:59 +0200 | Subject | Re: [PATCH] genalloc: make possible to use a custom allocation algorithm | From | Benjamin Gaignard <> |
| |
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
| |