]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regmap: Reorder 'struct regmap'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 24 Jan 2025 13:37:58 +0000 (14:37 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 3 Feb 2025 00:38:32 +0000 (00:38 +0000)
commit995cf0e014b0144edf1125668a97c252c5ab775e
tree07e75bc5f655fc7bad39d48a4d831ad58dfed707
parent2014c95afecee3e76ca4a56956a936e23283f05b
regmap: Reorder 'struct regmap'

On a x86_64, with configured with allmodconfig, pahole states that the
regmap structure is:

/* size: 1048, cachelines: 17, members: 78 */
/* sum members: 1006, holes: 9, sum holes: 35 */
/* padding: 7 */
/* member types with holes: 2, total: 2 */
/* last cacheline: 24 bytes */

So, when such a struct is allocated, 2048 bytes are allocated, with most of
this space being wasted.

Move a few bools so that the size is reduced to 1024.

After this change, pahole gives:

/* size: 1024, cachelines: 16, members: 78 */
/* sum members: 1006, holes: 6, sum holes: 18 */
/* member types with holes: 2, total: 2 */

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/f01f900d15633d5cda5f27763723acb307c0d22f.1737725820.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h