On 11 January 2016 at 17:37, Markus Armbruster <arm...@redhat.com> wrote: > Paolo Bonzini <pbonz...@redhat.com> writes: > >> On 07/01/2016 10:53, Cao jin wrote: >>> On 01/07/2016 05:38 PM, Paolo Bonzini wrote: >>>> On 06/01/2016 14:43, Cao jin wrote: >>>> These functions are called in the data path; changes to use SCSI_BUS() >>>> should come with performance data proving that it doesn't slow down I/O. >>>> >>> >>> I see. I am not familiar with the procedure of scsi i/o performance >>> test, do have some guideline about it? >> >> Usually people test with FIO, but I think it's simpler to just keep >> DO_UPCAST here. > > DO_UPCAST() needs to die. > > SCSI_BUS() is a readable wrapper around OBJECT_CHECK(): > > #define SCSI_BUS(obj) OBJECT_CHECK(SCSIBus, (obj), TYPE_SCSI_BUS) > > OBJECT_CHECK() is semantically a type cast, but in actual code it does > more:
Yes. We need to stop avoiding our QOM cast macros because of performance worries. (We already do this for the CPU casts.) We either need to fix the QOM cast macros to be faster, or accept the performance hit. thanks -- PMM