diff options
| author | Tejun Heo <[email protected]> | 2013-02-27 17:05:08 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-02-27 19:10:21 -0800 |
| commit | 0ffc2a9c8072969253a20821c2c733a2cbb4c7c7 (patch) | |
| tree | ff6a9d270d4f0fa5c770837c6d9e5d5aac2637a7 /tools/perf/scripts/python | |
| parent | 54616283c2948812a44240858ced610e7cacbde1 (diff) | |
idr: implement lookup hint
While idr lookup isn't a particularly heavy operation, it still is too
substantial to use in hot paths without worrying about the performance
implications. With recent changes, each idr_layer covers 256 slots
which should be enough to cover most use cases with single idr_layer
making lookup hint very attractive.
This patch adds idr->hint which points to the idr_layer which
allocated an ID most recently and the fast path lookup becomes
if (look up target's prefix matches that of the hinted layer)
return hint->ary[ID's offset in the leaf layer];
which can be inlined.
idr->hint is set to the leaf node on idr_fill_slot() and cleared from
free_layer().
[[email protected]: always do slow path when hint is uninitialized]
Signed-off-by: Tejun Heo <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions