diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-13 14:45:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:03 -0400 |
commit | 72dba584b695d8bc8c1a50ed54ad4cba7c62314d (patch) | |
tree | b0938ea773953f869b22101bb021e5710d0a0fec /crypto | |
parent | e33ac8bdb0c84fe7afd2c45537b763faf28c589e (diff) |
ida: implement idr based id allocator
Implement idr based id allocator. ida is used the same way idr is
used but lacks id -> ptr translation and thus consumes much less
memory. struct ida_bitmap is attached as leaf nodes to idr tree which
is managed by the idr code. Each ida_bitmap is 128bytes long and
contains slightly less than a thousand slots.
ida is more aggressive with releasing extra resources acquired using
ida_pre_get(). After every successful id allocation, ida frees one
reserved idr_layer if possible. Reserved ida_bitmap is not freed
automatically but only one ida_bitmap is reserved and it's almost
always used right away. Under most circumstances, ida won't hold on
to memory for too long which isn't actively used.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions