summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2014-06-06 14:37:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 16:08:12 -0700
commitaefb76829742803751725bc75bcdc43fe803ac22 (patch)
tree85004d21e1aa64ac890e6032d16538b242e0d8ed /lib
parentb93804b2fcdb35cc45f95ad77cbe23cc620f6593 (diff)
downloadlwn-aefb76829742803751725bc75bcdc43fe803ac22.tar.gz
lwn-aefb76829742803751725bc75bcdc43fe803ac22.zip
idr: don't need to shink the free list when idr_remove()
After idr subsystem is changed to RCU-awared, the free layer will not go to the free list. The free list will not be filled up when idr_remove(). So we don't need to shink it too. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/idr.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/idr.c b/lib/idr.c
index e79e051bddc1..9ed37a7a031d 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -18,12 +18,6 @@
* pointer or what ever, we treat it as a (void *). You can pass this
* id to a user for him to pass back at a later time. You then pass
* that id to this code and it returns your pointer.
-
- * You can release ids at any time. When all ids are released, most of
- * the memory is returned (we keep MAX_IDR_FREE) in a local pool so we
- * don't need to go to the memory "store" during an id allocate, just
- * so you don't need to be too concerned about locking and conflicts
- * with the slab allocator.
*/
#ifndef TEST // to test in user space...
@@ -584,16 +578,6 @@ void idr_remove(struct idr *idp, int id)
bitmap_clear(to_free->bitmap, 0, IDR_SIZE);
free_layer(idp, to_free);
}
- while (idp->id_free_cnt >= MAX_IDR_FREE) {
- p = get_from_free_list(idp);
- /*
- * Note: we don't call the rcu callback here, since the only
- * layers that fall into the freelist are those that have been
- * preallocated.
- */
- kmem_cache_free(idr_layer_cache, p);
- }
- return;
}
EXPORT_SYMBOL(idr_remove);