Re: [PATCH] regmap: flat: introduce register striding to save some memories

From: Mark Brown
Date: Mon Dec 14 2015 - 12:58:09 EST


On Mon, Dec 14, 2015 at 03:14:34PM +0800, Xiubo Li wrote:

> static int regcache_flat_write(struct regmap *map, unsigned int reg,
> unsigned int value)
> {
> + unsigned int index = reg / map->reg_stride;

So, this does save some memory. On the other hand one of the big goals
for the flat cache is to be as fast as possible to match the performance
of MMIO and divisions aren't the cheapest operations. If this was the
rbtree cache then it'd not be an issue but in the flat cache speed is
definitely the top priority, at least by default.

I'm guessing for your particular register maps the performance isn't too
big an issue... do you have any numbers for how much space you're
saving overall? Is it worth finding a way to make this possible to
enable on maps that benefit?

Attachment: signature.asc
Description: PGP signature