Return-Path: Subject: Re: [PATCH 5/5] scsi: virtio_scsi: fix IO hang by irq vector automatic affinity To: Ming Lei , Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , Mike Snitzer Cc: linux-scsi@vger.kernel.org, Arun Easi , Omar Sandoval , "Martin K . Petersen" , James Bottomley , Christoph Hellwig , Don Brace , Kashyap Desai , Peter Rivera , Paolo Bonzini , Laurence Oberman References: <20180203042112.15239-1-ming.lei@redhat.com> <20180203042112.15239-6-ming.lei@redhat.com> From: Hannes Reinecke Message-ID: <4b831a39-1024-48d3-bb7c-3395f85cd4db@suse.de> Date: Mon, 5 Feb 2018 07:57:29 +0100 MIME-Version: 1.0 In-Reply-To: <20180203042112.15239-6-ming.lei@redhat.com> Content-Type: text/plain; charset=utf-8 List-ID: On 02/03/2018 05:21 AM, Ming Lei wrote: > Now 84676c1f21e8ff5(genirq/affinity: assign vectors to all possible CPUs) > has been merged to V4.16-rc, and it is easy to allocate all offline CPUs > for some irq vectors, this can't be avoided even though the allocation > is improved. > > For example, on a 8cores VM, 4~7 are not-present/offline, 4 queues of > virtio-scsi, the irq affinity assigned can become the following shape: > > irq 36, cpu list 0-7 > irq 37, cpu list 0-7 > irq 38, cpu list 0-7 > irq 39, cpu list 0-1 > irq 40, cpu list 4,6 > irq 41, cpu list 2-3 > irq 42, cpu list 5,7 > > Then IO hang is triggered in case of non-SCSI_MQ. > > Given storage IO is always C/S model, there isn't such issue with SCSI_MQ(blk-mq), > because no IO can be submitted to one hw queue if the hw queue hasn't online > CPUs. > > Fix this issue by forcing to use blk_mq. > > BTW, I have been used virtio-scsi(scsi_mq) for several years, and it has > been quite stable, so it shouldn't cause extra risk. > > Cc: Hannes Reinecke > Cc: Arun Easi > Cc: Omar Sandoval , > Cc: "Martin K. Petersen" , > Cc: James Bottomley , > Cc: Christoph Hellwig , > Cc: Don Brace > Cc: Kashyap Desai > Cc: Peter Rivera > Cc: Paolo Bonzini > Cc: Laurence Oberman > Cc: Mike Snitzer > Signed-off-by: Ming Lei > --- > drivers/scsi/virtio_scsi.c | 59 +++------------------------------------------- > 1 file changed, 3 insertions(+), 56 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)