Re: [PATCH] device property: Make modifications of fwnode "flags" thread safe
From: Andy Shevchenko
Date: Tue Mar 17 2026 - 04:07:26 EST
On Tue, Mar 17, 2026 at 10:04:43AM +0200, Andy Shevchenko wrote:
> On Tue, Mar 17, 2026 at 08:42:08AM +0100, Wolfram Sang wrote:
>
> > > > ... this change costs some memory on every system. Maybe it can be
> > > > avoided?
> > >
> > > How much memory does it cost? On most 64-bit architectures is +4 bytes,
> > > rarely +0 bytes, on m68k it might be +2bytes. On 32-bit it most likely
> > > +0 bytes. I expect that 64-bit machines will cope with this bump.
> >
> > I am not opposing that the issue should be fixed. If it is not possible
> > to take the lock everywhere, this is a proper solution. But if we don't
> > have to use more memory, then we could save it. Our new SoC easily has
> > 'struct device' in the hundreds.
>
> What's the alignment for the u8 member in your SoC? 4 bytes or 8 bytes?
> (I assume it's 64-bit SoC.)
FWIW, with the given change it will be still inside 64-byte data structure
which most likely occupies a single cache line (before this patch and after
as well).
--
With Best Regards,
Andy Shevchenko