[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/10] scsi/scsi_bus: Add scsi_device_get
From: |
Maxim Levitsky |
Subject: |
Re: [PATCH 08/10] scsi/scsi_bus: Add scsi_device_get |
Date: |
Wed, 30 Sep 2020 21:04:09 +0300 |
User-agent: |
Evolution 3.36.3 (3.36.3-1.fc32) |
On Wed, 2020-09-30 at 19:46 +0200, Paolo Bonzini wrote:
> On 30/09/20 16:32, Maxim Levitsky wrote:
> > > Compared to Maxim's patch, I am avoiding the extra argument
> > > to do_scsi_device_find by moving the RCU_READ_LOCK_GUARD()
> > > out of do_scsi_device_find itself.
> > Which is a good idea, although my mindset was like, I got a device,
> > lets just grab a ref to it before it disappears and then do
> > whatever I want.
>
> Understood, but "I got a device, I know I'm under RCU so it can't
> disappear" is more efficient and just as common. This also explains the
> difference in patch 7.
Fair point. I am still learing to correctly use RCU.
Best regards,
Maxim Levitsky
>
> Paolo
>
[PATCH 04/10] device_core: use drain_call_rcu in in hmp_device_del/qmp_device_add, Paolo Bonzini, 2020/09/25
[PATCH 09/10] virtio-scsi: use scsi_device_get, Paolo Bonzini, 2020/09/25
[PATCH 10/10] scsi/scsi_bus: fix races in REPORT LUNS, Paolo Bonzini, 2020/09/25
[PATCH 03/10] scsi/scsi_bus: switch search direction in scsi_device_find, Paolo Bonzini, 2020/09/25
Re: [PATCH 00/10] Fix scsi devices plug/unplug races w.r.t virtio-scsi iothread, no-reply, 2020/09/25