Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8265293rwi; Tue, 25 Oct 2022 04:45:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7t4yF2S6GkvD2CUSKgIqPRTwTMRx6Img5GdH+tioM0EHMBCZQzTUfky7qRsBtF55BJX6La X-Received: by 2002:a17:903:124c:b0:179:da2f:2463 with SMTP id u12-20020a170903124c00b00179da2f2463mr38019096plh.128.1666698326805; Tue, 25 Oct 2022 04:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666698326; cv=none; d=google.com; s=arc-20160816; b=ZLHOEWjcUIR4K6agAKocKCgH72WztvJdZKBqKJ/eaj8maH72h7IRyRQbg557XPdCQY p54v/rjVDdCgoGNZIM2vsZaW5OXKNT5ycnSi32WIjl67dKib3FQnFdXILXiEJure8eiE oVnDYN53jygvaIRxpJIwN7X4F6b00QapXBrF9/iH6HxUd6lJgCruG0ebbZF+YOD3nNxc Pf3g+5qsfVgiYtKhaQcJ8Gb1iBYOvBoVXMvBYPUkwkKhIqvbDRrpRRmSBKS6OLr0JU9o L6PxXt67KQ3NDzarb4cVtF+Zbi8r129vBh+UcULrIBDRQ+vrzPzHQ7/8oCX4gyRfived i3tg== 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=7Z/8e5V1dxpLdxPlCBrq0LqktuHtc6on5ykeqrWsiuQ=; b=dB/+b69rd1sLVb2mrC5uhZWRYydSO3RpTs5RXTpV0iB68UZDb5SKGyLn+iesvk5r3y uLEFsUuJ875NGvkNKWzvmi5qqUEJgsi0Gi0mnuug4ubWgoj0Z5OGm2t9u37MG8fSCrZi jly8JeXkvvfkfwZak0meI4d1pQkdyfQNe6DreZ+pXnR5kBMKyb5TsIoehtdnI3Qh+Pbe TuyBS7N5tDR5pX34H37P1h3ijJADqCkl4SjW3fFERV8bNPO8VogPMuTN9ZOOyMSzDgrB PUIIQlpoTsEUtBSvCIdUD/h4hFwT5LHPCmb/t/IKbKoj3PiOQorf50+IaoCi3nFT73ad 4Mrg== 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 v6-20020a1709029a0600b00186ae557485si2469902plp.500.2022.10.25.04.45.14; Tue, 25 Oct 2022 04:45:26 -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 S230522AbiJYLgR (ORCPT + 99 others); Tue, 25 Oct 2022 07:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbiJYLgP (ORCPT ); Tue, 25 Oct 2022 07:36:15 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE3046CD10; Tue, 25 Oct 2022 04:36:14 -0700 (PDT) Received: from fraeml735-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MxVD96hy0z686Kq; Tue, 25 Oct 2022 19:32:41 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml735-chm.china.huawei.com (10.206.15.216) 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 13:36:12 +0200 Received: from [10.48.144.83] (10.48.144.83) 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 12:36:11 +0100 Message-ID: <05ae5abd-9b96-3ffe-6bd9-e996d28a8897@huawei.com> Date: Tue, 25 Oct 2022 12:36: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: <99c6ca81-746d-85f4-04d3-49d7a3de611b@huawei.com> <360c78dc-65ce-362f-389d-075f2259ce5b@huawei.com> <3513b14c-14e0-b865-628e-a83521090de9@huawei.com> <399a2c2d-0b56-e4e7-c309-a6b9537d8939@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.48.144.83] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) 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 12:21, Ming Lei wrote: >> Actually if final cpu in hctx->cpumask is going offline, then hctx won't >> queue any more requests, right? In this case I don't think we can queue on >> that hctx anyway. I need to think about this more. > It can be queued actually, but interrupt may not be delivered if managed > irq is used. Yes, I think it will be queued elsewhere. I would need to check the code again. > >>> If you just make it one driver private command, there can't be such >>> issue. >> Well we're trying to use reserved requests for EH commands, which that goes >> against. >> >>> Block layer is supposed for handling common case(normal io and pt io), >>> I'd suggest to not put such special cases into block layer. >> It also supports reserved commands, which I would assume would be suitable >> for EH scenarios. > Then you have to be careful, as I mentioned, EH has to provide forward > progress, if you let blk-mq allocate & submit EH request, the implied > dependency from blk-mq has to be payed attention. OK, thanks, I know that this carries risk, but it seems right approach. I have been thinking about my HW queue allocation requirement and maybe we can solve in low-level driver instead. The requirement is to send this abort command on same queue as erroneous command to ensure that they do not race in HW submission, even though chance of this is really tiny. Maybe we can make low-level driver wait until erroneous command is really submitted to HW by checking HW register, etc. before issuing abort on any HW queue (and so would not need blk_mq_alloc_request_hctx() or similar). BTW, I would still like to fix blk_mq_alloc_request_hctx() to properly init ->bio and other fields - ok? Thanks, John