aboutsummaryrefslogtreecommitdiffstats
path: root/lib/idr.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2014-06-06 17:37:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:12 -0400
commitaefb76829742803751725bc75bcdc43fe803ac22 (patch)
tree85004d21e1aa64ac890e6032d16538b242e0d8ed /lib/idr.c
parentb93804b2fcdb35cc45f95ad77cbe23cc620f6593 (diff)
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/idr.c')
-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 @@
18 * pointer or what ever, we treat it as a (void *). You can pass this 18 * pointer or what ever, we treat it as a (void *). You can pass this
19 * id to a user for him to pass back at a later time. You then pass 19 * id to a user for him to pass back at a later time. You then pass
20 * that id to this code and it returns your pointer. 20 * that id to this code and it returns your pointer.
21
22 * You can release ids at any time. When all ids are released, most of
23 * the memory is returned (we keep MAX_IDR_FREE) in a local pool so we
24 * don't need to go to the memory "store" during an id allocate, just
25 * so you don't need to be too concerned about locking and conflicts
26 * with the slab allocator.
27 */ 21 */
28 22
29#ifndef TEST // to test in user space... 23#ifndef TEST // to test in user space...
@@ -584,16 +578,6 @@ void idr_remove(struct idr *idp, int id)
584 bitmap_clear(to_free->bitmap, 0, IDR_SIZE); 578 bitmap_clear(to_free->bitmap, 0, IDR_SIZE);
585 free_layer(idp, to_free); 579 free_layer(idp, to_free);
586 } 580 }
587 while (idp->id_free_cnt >= MAX_IDR_FREE) {
588 p = get_from_free_list(idp);
589 /*
590 * Note: we don't call the rcu callback here, since the only
591 * layers that fall into the freelist are those that have been
592 * preallocated.
593 */
594 kmem_cache_free(idr_layer_cache, p);
595 }
596 return;
597} 581}
598EXPORT_SYMBOL(idr_remove); 582EXPORT_SYMBOL(idr_remove);
599 583