From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget() To: Ming Lei , linux-block@vger.kernel.org, Christoph Hellwig Cc: Bart Van Assche , Laurence Oberman , linux-scsi@vger.kernel.org, Omar Sandoval , John Garry References: <20171104015534.32684-1-ming.lei@redhat.com> From: Jens Axboe Message-ID: Date: Sat, 4 Nov 2017 08:19:58 -0600 MIME-Version: 1.0 In-Reply-To: <20171104015534.32684-1-ming.lei@redhat.com> Content-Type: text/plain; charset=utf-8 List-ID: On 11/03/2017 07:55 PM, Ming Lei wrote: > It is very expensive to atomic_inc/atomic_dec the host wide counter of > host->busy_count, and it should have been avoided via blk-mq's mechanism > of getting driver tag, which uses the more efficient way of sbitmap queue. > > Also we don't check atomic_read(&sdev->device_busy) in scsi_mq_get_budget() > and don't run queue if the counter becomes zero, so IO hang may be caused > if all requests are completed just before the current SCSI device > is added to shost->starved_list. This looks like an improvement. I have added it for 4.15. Bart, does this fix your hang? -- Jens Axboe