lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D708DGNQA4MO.1DD0OCM1TOHS2@gmail.com>
Date: Sun, 12 Jan 2025 17:21:22 +0100
From: "Javier Carrasco" <javier.carrasco.cruz@...il.com>
To: "Andy Shevchenko" <andy.shevchenko@...il.com>
Cc: "Matti Vaittinen" <mazziesaccount@...il.com>, "Jonathan Cameron"
 <jic23@...nel.org>, "Lars-Peter Clausen" <lars@...afoo.de>,
 <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Jonathan
 Cameron" <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2 3/4] iio: light: veml3235: extend regmap to add cache

On Sun Jan 12, 2025 at 5:11 PM CET, Andy Shevchenko wrote:
> On Sun, Jan 12, 2025 at 6:07 PM Javier Carrasco
> <javier.carrasco.cruz@...il.com> wrote:
> >
> > On Sun Jan 12, 2025 at 4:18 PM CET, Andy Shevchenko wrote:
> > > Tue, Dec 24, 2024 at 11:59:02AM +0100, Javier Carrasco kirjoitti:
> > > > The configuration and ID registers are not volatile and are not affected
> > > > by read operations (i.e. not precious), making them suitable to be
> > > > cached in order to reduce the number of accesses to the device.
> > >
> > > ...
> > >
> > > >  static const struct regmap_config veml3235_regmap_config = {
> > > >     .name = "veml3235_regmap",
> > > >     .reg_bits = 8,
> > > >     .val_bits = 16,
> > > >     .max_register = VEML3235_REG_ID,
> > > >     .val_format_endian = REGMAP_ENDIAN_LITTLE,
> > > > +   .rd_table = &veml3235_readable_table,
> > > > +   .wr_table = &veml3235_writable_table,
> > > > +   .volatile_table = &veml3235_volatile_table,
> > > > +   .cache_type = REGCACHE_RBTREE,
> > >
> > > Any specific reason why this is NOT a maple tree?
> >
> > Hello Andy,
> >
> > I followed the most common approach in IIO (52 RBTREE vs 2 MAPLE),
>
> But it's historical and can't be taken as an argument.
>
> > assuming that the "low-end systems" comment for the different REGCACHE_*
> > applies well to the typical systems that will make use of this driver,
> > and many others under IIO. I considered that *possible* performance
> > advantage for low-end systems above other considerations, like the
> > general rule about using maple tree.
>
> https://elixir.bootlin.com/linux/v6.13-rc3/source/include/linux/regmap.h#L58
>
> "Any new caches
>  * should usually use the maple tree cache unless they specifically
>  * require that there are never any allocations at runtime and can't
>  * provide defaults in which case they should use the flat cache."
>
> Can you reconsider?

That was exactly the comment I referenced, actually the part about
low-end systems that appears right after what you highlighted.

I have nothing against switching to MAPLE, if that is preferred even if
the main user of this driver will be a low-end system. I think that IIO
is a typical subsystem that addresses needs for very low-end systems
that are sometimes slightly more powerful than a microcontroller, but on
the other hand I am by no means an expert, and if MAPLE is the way to go
here as well, I will send a follow-up patch for it.

Thank you for your feedback!

Javier Carrasco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ