Re: [PATCH 4/6] regmap: Add the LZO cache support

From: Dimitris Papastamos
Date: Thu Sep 15 2011 - 05:35:43 EST


On Mon, Sep 05, 2011 at 06:18:30PM +0200, Lars-Peter Clausen wrote:
> On 09/05/2011 03:51 PM, Dimitris Papastamos wrote:
> > This patch adds support for LZO compression when storing the register
> > cache.
> >
> > For a typical device whose register map would normally occupy 25kB or 50kB
> > by using the LZO compression technique, one can get down to ~5-7kB. There
> > might be a performance penalty associated with each individual read/write
> > due to decompressing/compressing the underlying cache, however that should not
> > be noticeable. These memory benefits depend on whether the target architecture
> > can get rid of the memory occupied by the original register defaults cache
> > which is marked as __devinitconst. Nevertheless there will be some memory
> > gain even if the target architecture can't get rid of the original register
> > map, this should be around ~30-32kB instead of 50kB.
> >
> > Signed-off-by: Dimitris Papastamos <dp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> > ---
> > drivers/base/regmap/Makefile | 2 +-
> > drivers/base/regmap/internal.h | 2 +
> > drivers/base/regmap/regcache-lzo.c | 361 ++++++++++++++++++++++++++++++++++++
> > drivers/base/regmap/regcache.c | 1 +
> > include/linux/regmap.h | 1 +
> > 5 files changed, 366 insertions(+), 1 deletions(-)
> > create mode 100644 drivers/base/regmap/regcache-lzo.c
> >
>
> Fails to compile due to CONFIG_LZO_{COMPRESS,DECOMPRESS} not being selected.
> Also it will have issues, with caches where we don't use raw cache defaults.

Yes, the LZO code will need to use cache_defaults instead of
cache_defaults_raw. Since there are no users at the moment and since
most of the potential users do actually use cache_defaults_raw, I think
I can fix this incrementally.

Thanks,
Dimitris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/