Linux s390 Architecture development
 help / color / mirror / Atom feed
* Re: [PATCH v2] scsi: core: Drop Scsi_Host.default_lock
       [not found] <20260806113958.3127942-1-john.g.garry@oracle.com>
@ 2026-08-06 16:30 ` Damien Le Moal
  2026-08-06 17:15 ` Bart Van Assche
  1 sibling, 0 replies; 3+ messages in thread
From: Damien Le Moal @ 2026-08-06 16:30 UTC (permalink / raw)
  To: John Garry, James.Bottomley, martin.petersen
  Cc: linux-scsi, bvanassche, linux-s390, linux-ide, linux-kernel,
	linuxppc-dev, linux-usb, John Garry

On 2026/08/06 4:39, John Garry wrote:
> From: John Garry <john.garry@linux.dev>
> 
> Back in the 2.6.xx days, it was possible to for low-level drivers to set

s/to for/for

> the shost lock pointer. That is why there is a default lock and a pointer
> to the shost lock.
> 
> However, support for this has long been removed, so drop
> Scsi_Host.default_lock and make Scsi_Host.host_lock as the actual lock.
> 
> 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.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>
For the ata bits,

Acked-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] scsi: core: Drop Scsi_Host.default_lock
       [not found] <20260806113958.3127942-1-john.g.garry@oracle.com>
  2026-08-06 16:30 ` [PATCH v2] scsi: core: Drop Scsi_Host.default_lock Damien Le Moal
@ 2026-08-06 17:15 ` Bart Van Assche
  2026-08-07  8:18   ` John Garry
  1 sibling, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2026-08-06 17:15 UTC (permalink / raw)
  To: John Garry, James.Bottomley, martin.petersen
  Cc: linux-scsi, linux-s390, linux-ide, linux-kernel, linuxppc-dev,
	linux-usb, John Garry

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.

 > @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.

Otherwise this patch looks good to me. So with or without the
Documentation/ update, feel free to add:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] scsi: core: Drop Scsi_Host.default_lock
  2026-08-06 17:15 ` Bart Van Assche
@ 2026-08-07  8:18   ` John Garry
  0 siblings, 0 replies; 3+ messages in thread
From: John Garry @ 2026-08-07  8:18 UTC (permalink / raw)
  To: Bart Van Assche, James.Bottomley, martin.petersen
  Cc: linux-scsi, linux-s390, linux-ide, linux-kernel, linuxppc-dev,
	linux-usb, John Garry


> 
> 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 <bvanassche@acm.org>
> 

thanks


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-07  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260806113958.3127942-1-john.g.garry@oracle.com>
2026-08-06 16:30 ` [PATCH v2] scsi: core: Drop Scsi_Host.default_lock Damien Le Moal
2026-08-06 17:15 ` Bart Van Assche
2026-08-07  8:18   ` John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox