From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753774AbdA3Qln (ORCPT ); Mon, 30 Jan 2017 11:41:43 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:38355 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752807AbdA3Qlf (ORCPT ); Mon, 30 Jan 2017 11:41:35 -0500 Subject: Re: Device or HBA level QD throttling creates randomness in sequetial workload To: Bart Van Assche , "osandov@osandov.com" , "kashyap.desai@broadcom.com" References: <2d656e9c9fbde7206e40a635c61a6084@mail.gmail.com> <298b6ff6-9feb-4b70-ec4c-d1295a0e1f41@kernel.dk> <1485793840.2712.1.camel@sandisk.com> Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "hch@infradead.org" , "linux-block@vger.kernel.org" , "paolo.valente@linaro.org" From: Jens Axboe Message-ID: <22a9792c-098d-eb8d-b7d4-87a79cf1d31f@kernel.dk> Date: Mon, 30 Jan 2017 09:32:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1485793840.2712.1.camel@sandisk.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/30/2017 09:30 AM, Bart Van Assche wrote: > On Mon, 2017-01-30 at 19:22 +0530, Kashyap Desai wrote: >> - if (atomic_inc_return(&instance->fw_outstanding) > >> - instance->host->can_queue) { >> - atomic_dec(&instance->fw_outstanding); >> - return SCSI_MLQUEUE_HOST_BUSY; >> - } >> + if (atomic_inc_return(&instance->fw_outstanding) > safe_can_queue) { >> + is_nonrot = blk_queue_nonrot(scmd->device->request_queue); >> + /* For rotational device wait for sometime to get fusion command >> from pool. >> + * This is just to reduce proactive re-queue at mid layer which is >> not >> + * sending sorted IO in SCSI.MQ mode. >> + */ >> + if (!is_nonrot) >> + udelay(100); >> + } > > The SCSI core does not allow to sleep inside the queuecommand() callback > function. udelay() is a busy loop, so it's not sleeping. That said, it's obviously NOT a great idea. We want to fix the reordering due to requeues, not introduce random busy delays to work around it. -- Jens Axboe