Re: [PATCH 2/4] idr: reduce the number of MAX_IDR_FREE

2014-04-22 Thread Lai Jiangshan
On 04/23/2014 03:58 AM, Tejun Heo wrote: > 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) id

Re: [PATCH 2/4] idr: reduce the number of MAX_IDR_FREE

2014-04-22 Thread Tejun Heo
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 em

[PATCH 2/4] idr: reduce the number of MAX_IDR_FREE

2014-04-22 Thread Lai Jiangshan
Whe need to prepare MAX_IDR_FREE idr_layers for allocation. But 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. So max((MAX_IDR_LEVEL * 2 - 2), MAX_IDR_