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 >