Messages in this thread | | | Date | Tue, 22 Apr 2014 15:58:21 -0400 | From | Tejun Heo <> | Subject | Re: [PATCH 2/4] idr: reduce the number of MAX_IDR_FREE |
| |
On Tue, Apr 22, 2014 at 06:16:19PM +0800, Lai Jiangshan wrote: > +/* > + * Number of idr_layer structs to leave in free list. > + * When idr is not empty, we need atmost (MAX_IDR_LEVEL - 1) idr_layers > + * to build up and atmost (MAX_IDR_LEVEL - 1) idr_layers to allocate down. > + * When idr is empty need atmost MAX_IDR_LEVEL layers. > + */ > +#define MAX_IDR_FREE max((MAX_IDR_LEVEL * 2 - 2), MAX_IDR_LEVEL)
I don't know. Do we really wanna be this sophiscated about it when the cost of mistake would be an unexpected id allocation failure which would *EXTREMELY* difficult to track down or reproduce? Let's please keep it dumb and safe. With preloading we aren't even caching it per-idr. I don't think this is something we want to do.
Nacked-by: Tejun Heo <tj@kernel.org>
Thanks.
-- tejun
| |