Re: [PATCH v2] scsi: core: Drop Scsi_Host.default_lock

John Garry <[email protected]> Fri, 7 Aug 2026 09:18:24 +0100
Newsgroups gmane.linux.ide,gmane.linux.scsi,gmane.linux.kernel,gmane.linux.ports.ppc64.devel,gmane.linux.usb.general
Organization Oracle Corporation
Message-ID <[email protected]>
> 
> On 8/6/26 4:39 AM, John Garry wrote:
>    > Getting the address of embedded host_lock structure just requires adding
>    > a fixed offset value to the shost pointer. However, getting the value of
>    > the host_lock pointer requires loading from a fixed offset to the shost
>    > pointer. The latter should be very slightly slower, which is relevant as
>    > this lock is used a lot throughout the core code and drivers.
> 
> Hmm ... SCSI drivers for which performance matters shouldn't use the
> SCSI host lock in their hot path.

Any driver which uses DEF_SCSI_QCMD uses this lock in the fastpath. 
However I don't think that many are high performance HBAs. Maybe 
usb/storage/ or pmcraid could be consider higher performing.

Then there is stuff like xen-scsifront.c which uses this lock in the cmd 
done handler. It's used a lot in lpfc and also in code which looks to be 
fastpath...but that drivers is very complex.

> 
>    > @Bart, Can you kindly build test this? s390 and sh were causing some
> build
>    > issues for me. Thanks
> 
> This patch passes my build tests, but an update for the references to
> default_lock in the Documentation/ directory is missing.

I'll fix it

> 
> Otherwise this patch looks good to me. So with or without the
> Documentation/ update, feel free to add:
> 
> Reviewed-by: Bart Van Assche <[email protected]>
> 

thanks