Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753231AbbLNR6F (ORCPT ); Mon, 14 Dec 2015 12:58:05 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:47637 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752751AbbLNR6C (ORCPT ); Mon, 14 Dec 2015 12:58:02 -0500 Date: Mon, 14 Dec 2015 17:57:56 +0000 From: Mark Brown To: Xiubo Li Cc: linux-kernel@vger.kernel.org Message-ID: <20151214175756.GW5727@sirena.org.uk> References: <1450077274-25942-1-git-send-email-lixiubo@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AEkhIf3vy/ReXTu0" Content-Disposition: inline In-Reply-To: <1450077274-25942-1-git-send-email-lixiubo@cmss.chinamobile.com> X-Cookie: revolutionary, adj.: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regmap: flat: introduce register striding to save some memories X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1707 Lines: 44 --AEkhIf3vy/ReXTu0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? --AEkhIf3vy/ReXTu0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWbwMjAAoJECTWi3JdVIfQqV0H/05mEt95VCfEFD+co/IPyilI pYJYxVo0+mPxIs9z98Dr9F6zDj86/1+6QNmFWe78ngojhPrPvujrfUqXVIp/MLTS a14EqlhsF4oUbF8Yh76kWaSbieX5+5h1HjPukeGjgyeKI/VJpOsbSnbRSPg5PPar C+HsQocyj+9JP1coyrq589P1+FWMJIfXF8V61U4YbpmwSAvSo4FAc4WgvzydSYXL L5H5QJ9/I67wYspoJ0/WkibnKGEr7+lvoiFDvhy86TBtXN6+Ch78/xCaYeP2aIE8 yKX0IUmfzX77E+wrNHoRWMnR2sS/n2kVhFDv1JYLS8uGf1/OnvgJd1qveGozAuI= =G/8J -----END PGP SIGNATURE----- --AEkhIf3vy/ReXTu0-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/