[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/10] scsi/scsi_bus: Add scsi_device_get
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 08/10] scsi/scsi_bus: Add scsi_device_get |
Date: |
Wed, 30 Sep 2020 19:46:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
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.
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