On Mon, Mar 10, 2025 at 02:37:37PM +0100, Kevin Wolf wrote: > Am 13.02.2025 um 19:00 hat Stefan Hajnoczi geschrieben: > > SCSIDevice keeps track of in-flight requests for device reset and Task > > Management Functions (TMFs). The request list requires protection so > > that multi-threaded SCSI emulation can be implemented in commits that > > follow. > > > > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > > Some of this feels quite heavy-handed, and I imagine that having to take > the lock in every request could cause considerable lock contention only > so that we can iterate all requests in a slow path. > > This works for now, but maybe in the long run, we want to teach the > SCSI layer about (virt)queues, and have a separate request list per > queue (= AioContext)?
I had ideas about AioContext local storage but decided it was complex. Now that I think about it, maybe it's not that much more complex because TMF processing still needs to schedule BHs in different AioContexts even when there is a single requests lock. So keeping AioContext local request lists might be in the same ballpark while avoiding contention. For the time being let's use this code and if optimization is needed, then this would be a place to start. Stefan
signature.asc
Description: PGP signature