• Dimitris Papastamos's avatar
    regmap: Cut down on the average # of nodes in the rbtree cache · 0c7ed856
    Dimitris Papastamos authored
    This patch aims to bring down the average number of nodes
    in the rbtree cache and increase the average number of registers
    per node.  This should improve general lookup and traversal times.
    This is achieved by setting the minimum size of a block within the
    rbnode to the size of the rbnode itself.  This will essentially
    cache possibly non-existent registers so to combat this scenario,
    we keep a separate bitmap in memory which keeps track of which register
    exists.  The memory overhead of this change is likely in the order of
    ~5-10%, possibly less depending on the register file layout.  On my test
    system with a bitmap of ~4300 bits and a relatively sparse register
    layout, the memory requirements for the entire cache did not increase
    (the cutting down of nodes which was about 50% of the original number
    compensated the situation).
    
    A second patch that can be built on top of this can look at the
    ratio `sizeof(*rbnode) / map->cache_word_size' in order to suitably
    adjust the block length of each block.
    Signed-off-by: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    0c7ed856
regcache-rbtree.c 12.6 KB