Re: [PATCH net-next] qlcnic: Optimize performance by replacing rw_lock with spinlock

From: Simon Horman
Date: Tue Mar 11 2025 - 07:15:45 EST


On Sun, Mar 09, 2025 at 12:35:29AM +0800, Yu-Chun Lin wrote:
> On Fri, Mar 07, 2025 at 01:29:29PM +0000, Simon Horman wrote:
> > On Fri, Mar 07, 2025 at 12:31:24AM +0800, Yu-Chun Lin wrote:
> > > The 'crb_lock', an rwlock, is only used by writers, making it functionally
> > > equivalent to a spinlock.
> > >
> > > According to Documentation/locking/spinlocks.rst:
> > >
> > > "Reader-writer locks require more atomic memory operations than simple
> > > spinlocks. Unless the reader critical section is long, you are better
> > > off just using spinlocks."
> > >
> > > Since read_lock() is never called, switching to a spinlock reduces
> > > overhead and improves efficiency.
> > >
> > > Signed-off-by: Yu-Chun Lin <eleanor15x@xxxxxxxxx>
> >
> > Hi Yu-Chun Lin,
> >
> > Thanks for your patch.
> >
> > My main question is if you have hardware to test this?
> > And if so, was a benefit observed?
> >
> > If not, my feeling is that although your change looks
> > correct, we'd be better off taking the lower risk option
> > of leaving things be.
>
> Hi Simon
>
> I perform a compile test to ensure correctness. But I don't have the
> hardware to run a full test.

Thanks Yu-Chun Lin,

Unfortunately I think we need hardware testing to accept this
kind of change.