diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-08-29 10:26:33 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-29 14:32:40 +0200 |
commit | 472fdec7380cec483e241fa696d9b90bc37ddd4c (patch) | |
tree | d85e8d1fe6d2bd9fc5eb3a461338b2f4735166e4 /drivers/base/regmap/internal.h | |
parent | regmap: rbtree: Simplify adjacent node look-up (diff) | |
download | linux-472fdec7380cec483e241fa696d9b90bc37ddd4c.tar.xz linux-472fdec7380cec483e241fa696d9b90bc37ddd4c.zip |
regmap: rbtree: Reduce number of nodes, take 2
Support for reducing the number of nodes and memory consumption of the rbtree
cache by allowing for small unused holes in the node's register cache block was
initially added in commit 0c7ed856 ("regmap: Cut down on the average # of nodes
in the rbtree cache"). But the commit had problems and so its effect was
reverted again in commit 4e67fb5 ("regmap: rbtree: Fix overlapping rbnodes.").
This patch brings the feature back of reducing the average number of nodes,
which will speedup node look-up, while at the same time also reducing the memory
usage of the rbtree cache. This patch takes a slightly different approach than
the original patch though. It modifies the adjacent node look-up to not only
consider nodes that are just one to the left or the right of the register but
any node that falls in a certain range around the register. The range is
calculated based on how much memory it would take to allocate a new node
compared to how much memory it takes adding a set of unused registers to an
existing node. E.g. if a node takes up 24 bytes and each register in a block
uses 1 byte the range will be from the register address - 24 to the register
address + 24. If we find a node that falls within this range it is cheaper or as
expensive to add the register to the existing node and have a couple of unused
registers in the node's cache compared to allocating a new node.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base/regmap/internal.h')
0 files changed, 0 insertions, 0 deletions