Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4072046rwl; Sun, 2 Apr 2023 22:22:51 -0700 (PDT) X-Google-Smtp-Source: AKy350Y3DrpungUQYytcfZhI6IhhQXG/qwchNGCMZ8OE6bPylrGGecwDSGYL7zSueOqcmg+GHC8d X-Received: by 2002:a17:902:db0e:b0:1a1:ab92:5c88 with SMTP id m14-20020a170902db0e00b001a1ab925c88mr41294147plx.13.1680499371724; Sun, 02 Apr 2023 22:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680499371; cv=none; d=google.com; s=arc-20160816; b=okB2xHdveFnncKZTIT/ROEXxfGgHmw0w8tZ+3kBfj9UxLKR+iXXtIvVqpfZhNKYgcr Xj1Dv4a+b6ze3nQnbFPt00v11fqeuqMu1AbMwYhFUS7N98F2nP6NyIpz7HKvlm0gpMBn EGSVs7rm7w3pG3jjseU/37/jjn5xzUezAvfd9hVUd0HQEjy7pTwnZAu5/GKL9T8+vVLP GORzadc8wTzeXD2HiP1nRiMA+ESDnQvRin/Wgndx/tk5Iy8C3QPjBOkbmNYttRVFR2EY byiUTqP8a9L5nF2PwWnE9mw0E+Wx2r7PgQIPnQdRptNoMc0EP36NduQ2PNKX2c4pfYgS WVkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:reply-to:user-agent :mime-version:date:message-id; bh=CsG9YObl5oBjc3imOMXiDE3NVkWSWkx+6e9xSKQ+gbY=; b=ZmubextY4QZNMPJdenXCnpnaOR4fWe7+/juLSOEP4anQvEL2eNkJ+HTFLC2WAWMElR 7dYFCm5IqmutWdJ1rembxw4GZAmClflrR/OAcz2S0zJIrAGWYACI3NduRxkPq7l5ivtk 99fVF4u1twDkWyP9uiYyPlYykIDP3TW/2XEoRaTiA8A4emcGXhAuzRpbKKqGH7iAwxh7 1H8TS/I1lqx0Tw8I95JNGTTcSDvhctAPRmUmvUdrD2cpmXTPzEAP4L4I0DS+C+DKqhcf N6GVL1I7Y5Q2oc5Yhh5emFWk5bpW9fHeRpGi/bHPtcagFCZpsfzPjvGJLl3sSIyjTsMt nImQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a170902b60e00b001a216fddcfesi6997166pls.644.2023.04.02.22.22.40; Sun, 02 Apr 2023 22:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231493AbjDCFVo (ORCPT + 99 others); Mon, 3 Apr 2023 01:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbjDCFVn (ORCPT ); Mon, 3 Apr 2023 01:21:43 -0400 Received: from mp-relay-01.fibernetics.ca (mp-relay-01.fibernetics.ca [208.85.217.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6851EB463; Sun, 2 Apr 2023 22:21:40 -0700 (PDT) Received: from mailpool-fe-02.fibernetics.ca (mailpool-fe-02.fibernetics.ca [208.85.217.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mp-relay-01.fibernetics.ca (Postfix) with ESMTPS id 81EF3E1AC3; Mon, 3 Apr 2023 05:21:39 +0000 (UTC) Received: from localhost (mailpool-mx-01.fibernetics.ca [208.85.217.140]) by mailpool-fe-02.fibernetics.ca (Postfix) with ESMTP id 70093609E9; Mon, 3 Apr 2023 05:21:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at X-Spam-Score: -0.2 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from mailpool-fe-02.fibernetics.ca ([208.85.217.145]) by localhost (mail-mx-01.fibernetics.ca [208.85.217.140]) (amavisd-new, port 10024) with ESMTP id Lxs6gqH2fgK7; Mon, 3 Apr 2023 05:21:39 +0000 (UTC) Received: from [192.168.48.17] (host-184-164-23-94.dyn.295.ca [184.164.23.94]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: dgilbert@interlog.com) by mail.ca.inter.net (Postfix) with ESMTPSA id C6C5560529; Mon, 3 Apr 2023 05:21:38 +0000 (UTC) Message-ID: <40fbe93a-c39f-9887-2fe7-93532fee4771@interlog.com> Date: Mon, 3 Apr 2023 01:21:38 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Reply-To: dgilbert@interlog.com Subject: Re: [PATCH v3 09/11] scsi: scsi_debug: Use scsi_host_busy() in delay_store() and ndelay_store() Content-Language: en-CA To: John Garry , jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, bvanassche@acm.org References: <20230327074310.1862889-1-john.g.garry@oracle.com> <20230327074310.1862889-10-john.g.garry@oracle.com> From: Douglas Gilbert In-Reply-To: <20230327074310.1862889-10-john.g.garry@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-03-27 03:43, John Garry wrote: > The functions to update ndelay and delay value first check whether we have > any in-flight IO for any host. It does this by checking if any tag is used > in the global submit queues. > > We can achieve the same by setting the host as blocked and then ensuring > that we have no in-flight commands with scsi_host_busy(). > > Note that scsi_host_busy() checks SCMD_STATE_INFLIGHT flag, which is only > set per command after we ensure that the host is not blocked, i.e. we > see more commands active after the check for scsi_host_busy() returns 0. > > Signed-off-by: John Garry Acked-by: Douglas Gilbert Thanks.