Subject: [nacked] idr-reduce-the-number-of-max_idr_free.patch removed from -mm tree To: laijs@xxxxxxxxxxxxxx,tj@xxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 22 Apr 2014 13:02:38 -0700 The patch titled Subject: idr: reduce the number of MAX_IDR_FREE has been removed from the -mm tree. Its filename was idr-reduce-the-number-of-max_idr_free.patch This patch was dropped because it was nacked ------------------------------------------------------ From: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Subject: idr: reduce the number of MAX_IDR_FREE Whe need to prepare MAX_IDR_FREE idr_layers for allocation. But when idr is not empty, we need at most (MAX_IDR_LEVEL - 1) idr_layers to build up and at most (MAX_IDR_LEVEL - 1) idr_layers to allocate down. When idr is empty we need at most MAX_IDR_LEVEL layers. So max((MAX_IDR_LEVEL * 2 - 2), MAX_IDR_LEVEL) idr_layers is enough. Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/idr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff -puN lib/idr.c~idr-reduce-the-number-of-max_idr_free lib/idr.c --- a/lib/idr.c~idr-reduce-the-number-of-max_idr_free +++ a/lib/idr.c @@ -38,8 +38,13 @@ /* Leave the possibility of an incomplete final layer */ #define MAX_IDR_LEVEL ((MAX_IDR_SHIFT + IDR_BITS - 1) / IDR_BITS) -/* Number of id_layer structs to leave in free list */ -#define MAX_IDR_FREE (MAX_IDR_LEVEL * 2) +/* + * 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) static struct kmem_cache *idr_layer_cache; static DEFINE_PER_CPU(struct idr_layer *, idr_preload_head); _ Patches currently in -mm which might be from laijs@xxxxxxxxxxxxxx are mem-hotplug-implement-get-put_online_mems.patch slab-get_online_mems-for-kmem_cache_createdestroyshrink.patch idr-fix-overflow-bug-during-maximum-id-calculation-at-maximum-height.patch idr-fix-unexpected-id-removal-when-idr_removeunallocated_id.patch idr-fix-null-pointer-dereference-when-ida_removeunallocated_id.patch idr-fix-idr_replaces-returned-error-code.patch idr-dont-need-to-shink-the-free-list-when-idr_remove.patch idr-reduce-the-unneeded-check-in-free_layer.patch ida-in-place-ida-allocation.patch idr-reorder-the-fields.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html