lkml.org 
[lkml]   [2022]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/4] spidev: Do not use atomic bit operations when allocating minor
On Wed, Mar 23, 2022 at 07:06:25PM +0000, Mark Brown wrote:
> On Wed, Mar 23, 2022 at 07:22:52PM +0200, Andy Shevchenko wrote:
> > On Wed, Mar 23, 2022 at 04:39:01PM +0000, Mark Brown wrote:
>
> > > There's no *need* but the __ looks suspicious... what's the upside
> > > here?
>
> > It's exactly what is written in the commit message
>
> > __*_bit() are non-atomic
> > *_bit() are atomic
>
> > Since they are wrapped by mutex, the atomic ones are not needed.
>
> Yes, it's not needed but what meaningful harm does it do?

There are basically two points:

1) in one driver the additional lock may not be influential, but
if many drivers will do the same, it will block CPUs for no
purpose;

2) derived from the above, if one copies'n'pastes the code, esp.
using spin locks, it may become an unneeded code and performance
degradation.



--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-03-24 10:26    [W:0.101 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site