diff options
author | Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | 2011-05-19 12:45:29 (GMT) |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-20 10:21:53 (GMT) |
commit | 0944cc392e9a41dd36b65b2f8cb31dff437a9fdb (patch) | |
tree | 5ccf873f15156e9f525025b55adf6c5199af1777 /mm/page-writeback.c | |
parent | 0f3c6af92100193cf9a86bdd0ee35e6da3e0c56e (diff) | |
download | linux-fsl-qoriq-0944cc392e9a41dd36b65b2f8cb31dff437a9fdb.tar.xz |
ASoC: soc-cache: Block based rbtree compression
This patch prepares the ground for the actual rbtree optimization patch
which will save a pointer to the last accessed rbnode that was used
in either the read() or write() functions.
Each rbnode manages a variable length block of registers. There can be no
two nodes with overlapping blocks. Each block has a base register and a
currently top register, all the other registers, if any, lie in between these
two and in ascending order.
The reasoning behind the construction of this rbtree is simple. In the
snd_soc_rbtree_cache_init() function, we iterate over the register defaults
provided by the driver. For each register value that is non-zero we
insert it in the rbtree. In order to determine in which rbnode we need
to add the register, we first look if there is another register already
added that is adjacent to the one we are about to add. If that is the case
we append it in that rbnode block, otherwise we create a new rbnode
with a single register in its block and add it to the tree.
In the next patch, where a cached rbnode is used by both the write() and the
read() functions, we also check if the register we are about to add is in the
cached rbnode (the least recently accessed one) and if so we append it in that
rbnode block.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'mm/page-writeback.c')
0 files changed, 0 insertions, 0 deletions