summaryrefslogtreecommitdiff
path: root/Documentation/core-api/idr.rst
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2017-11-30 21:45:11 +0300
committerMatthew Wilcox <mawilcox@microsoft.com>2018-02-07 00:41:29 +0300
commit6ce711f2750031d12cec91384ac5cfa0a485b60a (patch)
treed1d3b3754641b22e51cc0fdeecb02a0ac7b31b54 /Documentation/core-api/idr.rst
parent72fd6c7be701d80eef34da305a6294c61520fe13 (diff)
downloadlinux-6ce711f2750031d12cec91384ac5cfa0a485b60a.tar.xz
idr: Make 1-based IDRs more efficient
About 20% of the IDR users in the kernel want the allocated IDs to start at 1. The implementation currently searches all the way down the left hand side of the tree, finds no free ID other than ID 0, walks all the way back up, and then all the way down again. This patch 'rebases' the ID so we fill the entire radix tree, rather than leave a gap at 0. Chris Wilson says: "I did the quick hack of allocating index 0 of the idr and that eradicated idr_get_free() from being at the top of the profiles for the many-object stress tests. This improvement will be much appreciated." Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'Documentation/core-api/idr.rst')
0 files changed, 0 insertions, 0 deletions