2024-02-06 07:34:31

by Bo Liu

[permalink] [raw]
Subject: [PATCH 00/18] mfd: convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Bo Liu (18):
mfd: ac100: convert to use maple tree register cache
mfd: as3711: convert to use maple tree register cache
mfd: as3722: convert to use maple tree register cache
mfd: axp20x: convert to use maple tree register cache
mfd: bcm590xx: convert to use maple tree register cache
mfd: bd9571mwv: convert to use maple tree register cache
mfd: dialog: convert to use maple tree register cache
mfd: khadas-mcu: convert to use maple tree register cache
mfd: lochnagar-i2c: convert to use maple tree register cache
mfd: wolfson: convert to use maple tree register cache
mfd: rohm: convert to use maple tree register cache
mfd: rk8xx: convert to use maple tree register cache
mfd: rn5t618: convert to use maple tree register cache
mfd: rsmu_i2c: convert to use maple tree register cache
mfd: si476x: convert to use maple tree register cache
mfd: stmfx: convert to use maple tree register cache
mfd: stpmic1: convert to use maple tree register cache
mfd: rc5t583: convert to use maple tree register cache

drivers/mfd/ac100.c | 2 +-
drivers/mfd/as3711.c | 2 +-
drivers/mfd/as3722.c | 2 +-
drivers/mfd/axp20x.c | 4 ++--
drivers/mfd/bcm590xx.c | 4 ++--
drivers/mfd/bd9571mwv.c | 4 ++--
drivers/mfd/da9052-core.c | 2 +-
drivers/mfd/da9055-core.c | 2 +-
drivers/mfd/da9062-core.c | 4 ++--
drivers/mfd/da9063-i2c.c | 2 +-
drivers/mfd/da9150-core.c | 2 +-
drivers/mfd/khadas-mcu.c | 2 +-
drivers/mfd/lochnagar-i2c.c | 4 ++--
drivers/mfd/rc5t583.c | 2 +-
drivers/mfd/rk8xx-spi.c | 2 +-
drivers/mfd/rn5t618.c | 2 +-
drivers/mfd/rohm-bd71828.c | 4 ++--
drivers/mfd/rohm-bd718x7.c | 2 +-
drivers/mfd/rohm-bd9576.c | 2 +-
drivers/mfd/rsmu_i2c.c | 2 +-
drivers/mfd/si476x-prop.c | 2 +-
drivers/mfd/stmfx.c | 2 +-
drivers/mfd/stpmic1.c | 2 +-
drivers/mfd/wm5102-tables.c | 2 +-
drivers/mfd/wm5110-tables.c | 2 +-
drivers/mfd/wm8350-regmap.c | 2 +-
drivers/mfd/wm8400-core.c | 2 +-
drivers/mfd/wm97xx-core.c | 6 +++---
28 files changed, 36 insertions(+), 36 deletions(-)

--
2.18.2



2024-02-06 07:39:53

by Bo Liu

[permalink] [raw]
Subject: [PATCH 09/18] mfd: lochnagar-i2c: convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <[email protected]>
---
drivers/mfd/lochnagar-i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/lochnagar-i2c.c b/drivers/mfd/lochnagar-i2c.c
index 0b76fcccd0bd..6c930c57f2e2 100644
--- a/drivers/mfd/lochnagar-i2c.c
+++ b/drivers/mfd/lochnagar-i2c.c
@@ -70,7 +70,7 @@ static const struct regmap_config lochnagar1_i2c_regmap = {
.use_single_read = true,
.use_single_write = true,

- .cache_type = REGCACHE_RBTREE,
+ .cache_type = REGCACHE_MAPLE,
};

static const struct reg_sequence lochnagar1_patch[] = {
@@ -163,7 +163,7 @@ static const struct regmap_config lochnagar2_i2c_regmap = {
.readable_reg = lochnagar2_readable_register,
.volatile_reg = lochnagar2_volatile_register,

- .cache_type = REGCACHE_RBTREE,
+ .cache_type = REGCACHE_MAPLE,
};

static const struct reg_sequence lochnagar2_patch[] = {
--
2.18.2


2024-02-06 09:33:47

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 00/18] mfd: convert to use maple tree register cache

Hi Bo,

CC broonie

Thanks for your series!

On Tue, Feb 6, 2024 at 8:16 AM Bo Liu <[email protected]> wrote:
> The maple tree register cache is based on a much more modern data structure
> than the rbtree cache and makes optimisation choices which are probably

probably?

> more appropriate for modern systems than those made by the rbtree cache.
>
> Bo Liu (18):
> mfd: ac100: convert to use maple tree register cache
> mfd: as3711: convert to use maple tree register cache
> mfd: as3722: convert to use maple tree register cache
> mfd: axp20x: convert to use maple tree register cache
> mfd: bcm590xx: convert to use maple tree register cache
> mfd: bd9571mwv: convert to use maple tree register cache
> mfd: dialog: convert to use maple tree register cache
> mfd: khadas-mcu: convert to use maple tree register cache
> mfd: lochnagar-i2c: convert to use maple tree register cache
> mfd: wolfson: convert to use maple tree register cache
> mfd: rohm: convert to use maple tree register cache
> mfd: rk8xx: convert to use maple tree register cache
> mfd: rn5t618: convert to use maple tree register cache
> mfd: rsmu_i2c: convert to use maple tree register cache
> mfd: si476x: convert to use maple tree register cache
> mfd: stmfx: convert to use maple tree register cache
> mfd: stpmic1: convert to use maple tree register cache
> mfd: rc5t583: convert to use maple tree register cache

If all of this is true, is there any reason to keep REGCACHE_RBTREE
around? If not, perhaps REGCACHE_RBTREE should be treated as
REGCACHE_MAPLE in the regmap core code first, followed by a single
tree-wide patch to replace REGCACHE_RBTREE?

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68korg

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2024-02-06 09:59:56

by Charles Keepax

[permalink] [raw]
Subject: Re: [PATCH 09/18] mfd: lochnagar-i2c: convert to use maple tree register cache

On Tue, Feb 06, 2024 at 02:13:05AM -0500, Bo Liu wrote:
> The maple tree register cache is based on a much more modern data structure
> than the rbtree cache and makes optimisation choices which are probably
> more appropriate for modern systems than those made by the rbtree cache.
>
> Signed-off-by: Bo Liu <[email protected]>
> ---

Tested-by: Charles Keepax <[email protected]>
Reviewed-by: Charles Keepax <[email protected]>

Thanks,
Charles

2024-02-06 10:09:12

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 00/18] mfd: convert to use maple tree register cache

On Tue, Feb 06, 2024 at 10:33:22AM +0100, Geert Uytterhoeven wrote:

> If all of this is true, is there any reason to keep REGCACHE_RBTREE
> around? If not, perhaps REGCACHE_RBTREE should be treated as
> REGCACHE_MAPLE in the regmap core code first, followed by a single
> tree-wide patch to replace REGCACHE_RBTREE?

There is a very small niche for devices where cache syncs are a
particularly important part of the workload where rbtree's choices might
give better performance, especially on systems with low end CPUs.


Attachments:
(No filename) (532.00 B)
signature.asc (499.00 B)
Download all attachments

2024-02-06 10:16:37

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 00/18] mfd: convert to use maple tree register cache

Hi Mark,

On Tue, Feb 6, 2024 at 11:09 AM Mark Brown <[email protected]> wrote:
> On Tue, Feb 06, 2024 at 10:33:22AM +0100, Geert Uytterhoeven wrote:
> > If all of this is true, is there any reason to keep REGCACHE_RBTREE
> > around? If not, perhaps REGCACHE_RBTREE should be treated as
> > REGCACHE_MAPLE in the regmap core code first, followed by a single
> > tree-wide patch to replace REGCACHE_RBTREE?
>
> There is a very small niche for devices where cache syncs are a
> particularly important part of the workload where rbtree's choices might
> give better performance, especially on systems with low end CPUs.

The REGCACHE_* value is specified by the device, not by the CPU?
While some of these MFD devices are on-SoC, and thus there is some
relation between device and CPU, several others (e.g. PMICs) are
external, and thus might be present on systems with a variety of CPU
performance.

Perhaps the value should depend on some CPU heuristic instead?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68korg

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2024-02-06 11:05:14

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 00/18] mfd: convert to use maple tree register cache

On Tue, Feb 06, 2024 at 11:14:11AM +0100, Geert Uytterhoeven wrote:
> On Tue, Feb 6, 2024 at 11:09 AM Mark Brown <[email protected]> wrote:

> > There is a very small niche for devices where cache syncs are a
> > particularly important part of the workload where rbtree's choices might
> > give better performance, especially on systems with low end CPUs.

> The REGCACHE_* value is specified by the device, not by the CPU?

The device is going to dominate here, the main thing is how much of the
workload consists of syncs.

> While some of these MFD devices are on-SoC, and thus there is some
> relation between device and CPU, several others (e.g. PMICs) are
> external, and thus might be present on systems with a variety of CPU
> performance.

> Perhaps the value should depend on some CPU heuristic instead?

No.


Attachments:
(No filename) (842.00 B)
signature.asc (499.00 B)
Download all attachments

2024-02-08 14:26:40

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 00/18] mfd: convert to use maple tree register cache

On Thu, 08 Feb 2024, Lee Jones wrote:

> On Tue, 06 Feb 2024 02:12:56 -0500, Bo Liu wrote:
> > The maple tree register cache is based on a much more modern data structure
> > than the rbtree cache and makes optimisation choices which are probably
> > more appropriate for modern systems than those made by the rbtree cache.
> >
> > Bo Liu (18):
> > mfd: ac100: convert to use maple tree register cache
> > mfd: as3711: convert to use maple tree register cache
> > mfd: as3722: convert to use maple tree register cache
> > mfd: axp20x: convert to use maple tree register cache
> > mfd: bcm590xx: convert to use maple tree register cache
> > mfd: bd9571mwv: convert to use maple tree register cache
> > mfd: dialog: convert to use maple tree register cache
> > mfd: khadas-mcu: convert to use maple tree register cache
> > mfd: lochnagar-i2c: convert to use maple tree register cache
> > mfd: wolfson: convert to use maple tree register cache
> > mfd: rohm: convert to use maple tree register cache
> > mfd: rk8xx: convert to use maple tree register cache
> > mfd: rn5t618: convert to use maple tree register cache
> > mfd: rsmu_i2c: convert to use maple tree register cache
> > mfd: si476x: convert to use maple tree register cache
> > mfd: stmfx: convert to use maple tree register cache
> > mfd: stpmic1: convert to use maple tree register cache
> > mfd: rc5t583: convert to use maple tree register cache
> >
> > [...]
>
> Applied, thanks!
>
> [01/18] mfd: ac100: convert to use maple tree register cache
> commit: 8745a81ac22f42c7233fbddc6aa5922b231aac2a
> [02/18] mfd: as3711: convert to use maple tree register cache
> commit: 780b1aa441a3d64e400cb2ea96bc3e162322eb31
> [03/18] mfd: as3722: convert to use maple tree register cache
> commit: aea5c3cbc51eee3ac25ff8f936252901c4549011
> [04/18] mfd: axp20x: convert to use maple tree register cache
> commit: 009073d504f67146d936cc45f21cc27c1bc15490
> [05/18] mfd: bcm590xx: convert to use maple tree register cache
> commit: 684c1f0b79417cf08810dfd57c5a549a9741ad7a
> [06/18] mfd: bd9571mwv: convert to use maple tree register cache
> commit: 35b1b8622ca3172b3c6b2a377e5913bac0367634
> [07/18] mfd: dialog: convert to use maple tree register cache
> commit: 1cb7a3bca56c124ca9e5c13fcac7de884c195c5c
> [08/18] mfd: khadas-mcu: convert to use maple tree register cache
> commit: 5f734f5f374f68960afd2130a5ce982912c14c15
> [09/18] mfd: lochnagar-i2c: convert to use maple tree register cache
> commit: 8881896e05b6a91251dde0ce21ce79c2c201888d
> [10/18] mfd: wolfson: convert to use maple tree register cache
> commit: f353b2c639e4f4ac9831d94c8237026cebaa8e73
> [11/18] mfd: rohm: convert to use maple tree register cache
> commit: aabd38f3779b8108b65cc7ae8b5c20a6c352b0a2
> [12/18] mfd: rk8xx: convert to use maple tree register cache
> commit: 08aa1e797a5cc97d2106476263f938342e72015e
> [13/18] mfd: rn5t618: convert to use maple tree register cache
> commit: a011cacb63c3ff6562bd86afae8cdd49d0f075c9
> [14/18] mfd: rsmu_i2c: convert to use maple tree register cache
> commit: b85821cecdf933420a6ba93658e1e4710644f5c1
> [15/18] mfd: si476x: convert to use maple tree register cache
> commit: 030473871c3f4f126bd43018517abfcb070f6b95
> [16/18] mfd: stmfx: convert to use maple tree register cache
> commit: 87a48e35ce2ef992287b828b1268bedc7415d2de
> [17/18] mfd: stpmic1: convert to use maple tree register cache
> commit: ab993d2d68951db3ebfeaa44567a790ec566526d
> [18/18] mfd: rc5t583: convert to use maple tree register cache
> commit: d5132d176d6f21742ac67fd311ccc61fe830e999

Next time you send a large patch-set, could you please ensure the
subject line format matches that of the subsystem you're submitting to
please? It would have a saved me from a whole bunch of fix-ups.

Thanks.

--
Lee Jones [李琼斯]

2024-02-08 14:36:01

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 00/18] mfd: convert to use maple tree register cache

On Tue, 06 Feb 2024 02:12:56 -0500, Bo Liu wrote:
> The maple tree register cache is based on a much more modern data structure
> than the rbtree cache and makes optimisation choices which are probably
> more appropriate for modern systems than those made by the rbtree cache.
>
> Bo Liu (18):
> mfd: ac100: convert to use maple tree register cache
> mfd: as3711: convert to use maple tree register cache
> mfd: as3722: convert to use maple tree register cache
> mfd: axp20x: convert to use maple tree register cache
> mfd: bcm590xx: convert to use maple tree register cache
> mfd: bd9571mwv: convert to use maple tree register cache
> mfd: dialog: convert to use maple tree register cache
> mfd: khadas-mcu: convert to use maple tree register cache
> mfd: lochnagar-i2c: convert to use maple tree register cache
> mfd: wolfson: convert to use maple tree register cache
> mfd: rohm: convert to use maple tree register cache
> mfd: rk8xx: convert to use maple tree register cache
> mfd: rn5t618: convert to use maple tree register cache
> mfd: rsmu_i2c: convert to use maple tree register cache
> mfd: si476x: convert to use maple tree register cache
> mfd: stmfx: convert to use maple tree register cache
> mfd: stpmic1: convert to use maple tree register cache
> mfd: rc5t583: convert to use maple tree register cache
>
> [...]

Applied, thanks!

[01/18] mfd: ac100: convert to use maple tree register cache
commit: 8745a81ac22f42c7233fbddc6aa5922b231aac2a
[02/18] mfd: as3711: convert to use maple tree register cache
commit: 780b1aa441a3d64e400cb2ea96bc3e162322eb31
[03/18] mfd: as3722: convert to use maple tree register cache
commit: aea5c3cbc51eee3ac25ff8f936252901c4549011
[04/18] mfd: axp20x: convert to use maple tree register cache
commit: 009073d504f67146d936cc45f21cc27c1bc15490
[05/18] mfd: bcm590xx: convert to use maple tree register cache
commit: 684c1f0b79417cf08810dfd57c5a549a9741ad7a
[06/18] mfd: bd9571mwv: convert to use maple tree register cache
commit: 35b1b8622ca3172b3c6b2a377e5913bac0367634
[07/18] mfd: dialog: convert to use maple tree register cache
commit: 1cb7a3bca56c124ca9e5c13fcac7de884c195c5c
[08/18] mfd: khadas-mcu: convert to use maple tree register cache
commit: 5f734f5f374f68960afd2130a5ce982912c14c15
[09/18] mfd: lochnagar-i2c: convert to use maple tree register cache
commit: 8881896e05b6a91251dde0ce21ce79c2c201888d
[10/18] mfd: wolfson: convert to use maple tree register cache
commit: f353b2c639e4f4ac9831d94c8237026cebaa8e73
[11/18] mfd: rohm: convert to use maple tree register cache
commit: aabd38f3779b8108b65cc7ae8b5c20a6c352b0a2
[12/18] mfd: rk8xx: convert to use maple tree register cache
commit: 08aa1e797a5cc97d2106476263f938342e72015e
[13/18] mfd: rn5t618: convert to use maple tree register cache
commit: a011cacb63c3ff6562bd86afae8cdd49d0f075c9
[14/18] mfd: rsmu_i2c: convert to use maple tree register cache
commit: b85821cecdf933420a6ba93658e1e4710644f5c1
[15/18] mfd: si476x: convert to use maple tree register cache
commit: 030473871c3f4f126bd43018517abfcb070f6b95
[16/18] mfd: stmfx: convert to use maple tree register cache
commit: 87a48e35ce2ef992287b828b1268bedc7415d2de
[17/18] mfd: stpmic1: convert to use maple tree register cache
commit: ab993d2d68951db3ebfeaa44567a790ec566526d
[18/18] mfd: rc5t583: convert to use maple tree register cache
commit: d5132d176d6f21742ac67fd311ccc61fe830e999

--
Lee Jones [李琼斯]