Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8095023rwi; Tue, 25 Oct 2022 02:21:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ypds3JHgzWs6NE4SDpUgC8w8zQipNb12g5xgQG2zhQZPzihx/hfEBPYNK9DGQLdKPlVwO X-Received: by 2002:a17:907:2c75:b0:78d:c201:e9aa with SMTP id ib21-20020a1709072c7500b0078dc201e9aamr31625232ejc.235.1666689671430; Tue, 25 Oct 2022 02:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666689671; cv=none; d=google.com; s=arc-20160816; b=z8Xn02gy7UtpgyOsdAOuhZTOsKihS0bWlJW5/WoQmrXmSUypAci2pbzpHKPD6DGqCt 3XHMn6GBlTfjLCrln8Xdwm+inc0gHANu9dsCe4OwJ5sjffSmTpJAqQQ2eMv1um6sZTBV PmqkLQepPO9JFvHKJWyGJuldwWz0euE/RuZZ9DDO29TPTeDQmNQ5WDwEftxEFmXLNstN p5+GNIbSjKvsxZSFHTWYhO3avHb4HjovtlZSz6vv9cX8qPm0eIoGoU26vxQ/go1+bHSa Kdqd+sJnpu1bgYItbzXntF58Up3GkMCA+MtYdFaspfQuH+fynctXnkEcdvOGFHmuqyDP D5bA== 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:subject:user-agent:mime-version:date:message-id; bh=46Qk+5quS0f4DDGTljhfLWkumby3VaRvYnQXN/9xvaY=; b=DiszKJtCqP8KYTPSPEvRKy0v6rLxmqOENmnz4Qd1DpKLFcEDaa+got+fOJBmjSmg5l zrO0XJPgO+EBdVHG/aod8Bv930YUZVKih7dCnq81eOQG9aSqsKBSAEomK5gk+bAVrdAP 4hRoe4Bn06Op+R2GI6BMY+hgvhOLEIFdFwJp2IKJ4rrLQUM3xUPR+9ef0wus5juy3TFw smUdPhwHymOu2OLcbSl4xya1CRxuUUirxcb6VFOTF78qFQ0n13WBOMSVEd2dnHtbftdB o3nVnRAuDmfskiZRv3hhMtkirX7r6ZAqFwhj+qAGHpuoUd/3ZZeZ/JE9HKsSLo90j7Sa 0UAw== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb1-20020a1709071c8100b00780837381d8si2338798ejc.591.2022.10.25.02.20.45; Tue, 25 Oct 2022 02:21:11 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232345AbiJYJPw (ORCPT + 99 others); Tue, 25 Oct 2022 05:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232346AbiJYJPX (ORCPT ); Tue, 25 Oct 2022 05:15:23 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C85E17D851; Tue, 25 Oct 2022 02:08:16 -0700 (PDT) Received: from frapeml100006.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MxQzJ61yrz67bjw; Tue, 25 Oct 2022 17:06:20 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by frapeml100006.china.huawei.com (7.182.85.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 11:08:13 +0200 Received: from [10.195.245.7] (10.195.245.7) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 10:08:12 +0100 Message-ID: Date: Tue, 25 Oct 2022 10:08:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] blk-mq: Properly init bios from blk_mq_alloc_request_hctx() To: Ming Lei CC: , , , , Bart Van Assche References: <1666454846-11749-1-git-send-email-john.garry@huawei.com> <99c6ca81-746d-85f4-04d3-49d7a3de611b@huawei.com> <360c78dc-65ce-362f-389d-075f2259ce5b@huawei.com> <3513b14c-14e0-b865-628e-a83521090de9@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.195.245.7] X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 25/10/2022 10:00, Ming Lei wrote: >> My use case is in SCSI EH domain. For my HBA controller of interest, to >> abort an erroneous IO we must send a controller proprietary abort >> command on same HW queue as original command. So we would need to >> allocate this abort request for a specific HW queue. > IMO, it is one bad hw/sw interface. > > First such request has to be reserved, since all inflight IOs can be in error. Right > > Second error handling needs to provide forward-progress, and it is supposed > to not require external dependency, otherwise easy to cause deadlock, but > here request from specific HW queue just depends on this queue's cpumask. > > Also if it has to be reserved, it can be done as one device/driver private > command, so why bother blk-mq for this special use case? I have a series for reserved request support, which I will send later. Please have a look. And as I mentioned, I would prob not end up using blk_mq_alloc_request_hctx() anyway. > >> I mentioned before that if no hctx->cpumask is online then we don't need >> to allocate a request. That is because if no hctx->cpumask is online, >> this means that original erroneous IO must be completed due to nature of >> how blk-mq cpu hotplug handler works, i.e. drained, and then we don't >> actually need to abort it any longer, so ok to not get a request. > No, it is really not OK, if all cpus in hctx->cpumask are offline, you > can't allocate > request on the specified hw queue, then the erroneous IO can't be handled, > then cpu hotplug handler may hang for ever. If the erroneous IO is still in-flight from blk-mq perspective, then how can hctx->cpumask still be offline? I thought that we guarantee that hctx->cpumask cannot go offline until drained. Thanks, John