2024-02-02 06:55:24

by Bo Liu

[permalink] [raw]
Subject: [PATCH] net: ieee802154: at86rf230: 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/net/ieee802154/at86rf230.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 164c7f605af5..6212164ffb36 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -316,7 +316,7 @@ static const struct regmap_config at86rf230_regmap_spi_config = {
.val_bits = 8,
.write_flag_mask = CMD_REG | CMD_WRITE,
.read_flag_mask = CMD_REG,
- .cache_type = REGCACHE_RBTREE,
+ .cache_type = REGCACHE_MAPLE,
.max_register = AT86RF2XX_NUMREGS,
.writeable_reg = at86rf230_reg_writeable,
.readable_reg = at86rf230_reg_readable,
--
2.31.1



2024-02-02 07:56:05

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

Hi Bo,

[email protected] wrote on Fri, 2 Feb 2024 01:45:12 -0500:

> 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.

What are the real intended benefits? Shall we expect any drawbacks?

> Signed-off-by: Bo Liu <[email protected]>

Thanks,
Miquèl

2024-02-02 08:09:05

by Bo Liu

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache


>Hi Bo,
>
>[email protected] wrote on Fri, 2 Feb 2024 01:45:12 -0500:
>
>> 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.
>
>What are the real intended benefits? Shall we expect any drawbacks?
>
Hi
The maple tree register cache has now got to the point where is is
roughly feature compatible with the rbtree cache. It's based on a much more modern data
structure than the rbtree cache

>> Signed-off-by: Bo Liu <[email protected]>
>
>Thanks,
>Miquèl

Thanks


Attachments:
smime.p7s (3.69 kB)

2024-02-04 14:35:32

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

On Fri, Feb 02, 2024 at 08:08:14AM +0000, Bo Liu (刘波)-浪潮信息 wrote:
>
> >Hi Bo,
> >
> >[email protected] wrote on Fri, 2 Feb 2024 01:45:12 -0500:
> >
> >> 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.
> >
> >What are the real intended benefits? Shall we expect any drawbacks?
> >
> Hi
> The maple tree register cache has now got to the point where is is
> roughly feature compatible with the rbtree cache. It's based on a much more modern data
> structure than the rbtree cache

Thanks Bo Liu,

You have stated that maple is more modern than rbtree.
But please address Miquel's questions: what are the real
expected benefits; what possible drawbacks are there?



2024-02-05 21:22:57

by Alexander Aring

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

Hi,

On Fri, Feb 2, 2024 at 2:56 AM Miquel Raynal <miquel.raynal@bootlincom> wrote:
>
> Hi Bo,
>
> [email protected] wrote on Fri, 2 Feb 2024 01:45:12 -0500:
>
> > 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.
>
> What are the real intended benefits? Shall we expect any drawbacks?
>

I doubt it has really any benefits, only the slowpath is using regmap
to set some registers. Maybe if you change phy setting frequently it
might have an impact, but this isn't even a path considered to run
fast.

- Alex


2024-02-06 09:25:30

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

Hi,

[email protected] wrote on Mon, 5 Feb 2024 14:42:09 -0500:

> Hi,
>
> On Fri, Feb 2, 2024 at 2:56 AM Miquel Raynal <[email protected]> wrote:
> >
> > Hi Bo,
> >
> > [email protected] wrote on Fri, 2 Feb 2024 01:45:12 -0500:
> >
> > > 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.
> >
> > What are the real intended benefits? Shall we expect any drawbacks?
> >
>
> I doubt it has really any benefits, only the slowpath is using regmap
> to set some registers. Maybe if you change phy setting frequently it
> might have an impact, but this isn't even a path considered to run
> fast.

Ok, thanks Alex for the info; in this case I'm fine:

Reviewed-by: Miquel Raynal <[email protected]>

Thanks,
Miquèl

2024-02-20 10:05:29

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

Hi,

[email protected] wrote on Mon, 5 Feb 2024 14:42:09 -0500:

> Hi,
>
> On Fri, Feb 2, 2024 at 2:56 AM Miquel Raynal <[email protected]> wrote:
> >
> > Hi Bo,
> >
> > [email protected] wrote on Fri, 2 Feb 2024 01:45:12 -0500:
> >
> > > 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.
> >
> > What are the real intended benefits? Shall we expect any drawbacks?
> >
>
> I doubt it has really any benefits, only the slowpath is using regmap
> to set some registers. Maybe if you change phy setting frequently it
> might have an impact, but this isn't even a path considered to run
> fast.

Ok, then let's take the series I guess. For the three patches:

Reviewed-by: Miquel Raynal <[email protected]>

Thanks,
Miquèl

2024-02-26 20:56:06

by Stefan Schmidt

[permalink] [raw]
Subject: Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

Hello,

On 02.02.24 07:45, 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]>
> ---
> drivers/net/ieee802154/at86rf230.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> index 164c7f605af5..6212164ffb36 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -316,7 +316,7 @@ static const struct regmap_config at86rf230_regmap_spi_config = {
> .val_bits = 8,
> .write_flag_mask = CMD_REG | CMD_WRITE,
> .read_flag_mask = CMD_REG,
> - .cache_type = REGCACHE_RBTREE,
> + .cache_type = REGCACHE_MAPLE,
> .max_register = AT86RF2XX_NUMREGS,
> .writeable_reg = at86rf230_reg_writeable,
> .readable_reg = at86rf230_reg_readable,

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt