Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5243130rdb; Sat, 16 Sep 2023 08:24:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJCH47wmRlXstbAERiW1U8O6ULUFOV3CDhUFEJaqVXbUOZOiLZ7woLLme+OGmwKLjMpFHR X-Received: by 2002:a05:6a21:4849:b0:14c:ca56:69f7 with SMTP id au9-20020a056a21484900b0014cca5669f7mr4773246pzc.28.1694877873185; Sat, 16 Sep 2023 08:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694877873; cv=none; d=google.com; s=arc-20160816; b=zian9FLNT9DoH1iFg6/tpW4qDqhy2xjonQRyt/ydHHzolY0uAoArJPIBSCezeuaIfM GQzyqMJSH24O2F5KUVsXCfkCK0rfFaTnl987BHz0oabFJDLC6oBcBrk9U7mzcn+tIssw EkRgdSyv1YdX0r9VGWq7J0O4oTYx4Eh9v6xQDuL7ra87hd//HHElpgW1uUUJZyBs3vno KuWKjsfFvG7TGY6yW88llF3msPzTAjVswGJLtQbxz03tUjujyhRjiRH9zD3xDCynPYSr rZCtRkdx30tapxAnLPeLyCEbl6ywn23uW1xBkd8r1NA8+EKnnYXWCJOXtvoT2n7SjRMw /GcA== 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 :content-language:references:cc:to:subject:mime-version:date :dkim-signature:message-id; bh=ZF32vfY+QsmaR5/VYssON92iTEQMNzL9mloi6Y3iFaM=; fh=eQEDdqxd0VTF205pDV1L2QWaKm9riUCvKhS6CjE+SVg=; b=Te8kUnwkdpEIuLcZKlm6B9ABLXiEvWAkY85EHZucGjBb0itpGWGH9W6EHMYFhjb3Mf yAGohaQPFYJt2LKVcTWaoMMa0RhIWxzust/RP+0E887kw7iONlo2nD923DFFKOkacVbX s/GONfcq3Cz1KHHnKTSH5u2tpHSy56YIJ1UPUFYLnAwl4l9q4LHxJLZ1dhcSt/TJrEmY RUYCsf+F7h2V/hCropNeIbfYIbVie+MZJGPxPUKYNGCazFmpjBxmlW+t3lpYUdeZA6rp sd8uTO3J0JGOs/e2m0V74W/d3fdcdeFW8bD7vk5yPLJjHYKlen9Nj3lZJUqiEk4vFU2e G43Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uxmBO6nK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m1-20020a656a01000000b0056fa1ac3722si5448768pgu.698.2023.09.16.08.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 08:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uxmBO6nK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4C438836EAA6; Sat, 16 Sep 2023 03:08:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238885AbjIPJeJ (ORCPT + 99 others); Sat, 16 Sep 2023 05:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232127AbjIPJde (ORCPT ); Sat, 16 Sep 2023 05:33:34 -0400 Received: from out-228.mta0.migadu.com (out-228.mta0.migadu.com [91.218.175.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3439BE3 for ; Sat, 16 Sep 2023 02:33:29 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694856807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZF32vfY+QsmaR5/VYssON92iTEQMNzL9mloi6Y3iFaM=; b=uxmBO6nK4ty+VXCIcM5E2NxfFqxxuywvQMv0AyqN5Cozm8WHhyPXlUWAnXOahBAMtTv+60 6urWdcDzV5h9hexhdy8LPoDblZ0SGihhRiAjGJCkVQ0Gw+5zt1Q5w7aiQ/hedHviKIeVUl cJiFvuf+kEyAVEn9ncBX49zJ7rUCCQU= Date: Sat, 16 Sep 2023 17:32:58 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v2 1/5] blk-mq: account active requests when get driver tag To: Ming Lei Cc: axboe@kernel.dk, hch@lst.de, bvanassche@acm.org, kbusch@kernel.org, mst@redhat.com, damien.lemoal@opensource.wdc.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Chengming Zhou References: <20230913151616.3164338-1-chengming.zhou@linux.dev> <20230913151616.3164338-2-chengming.zhou@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 16 Sep 2023 03:08:04 -0700 (PDT) On 2023/9/16 17:23, Ming Lei wrote: > On Wed, Sep 13, 2023 at 03:16:12PM +0000, chengming.zhou@linux.dev wrote: >> From: Chengming Zhou >> >> There is a limit that batched queue_rqs() can't work on shared tags >> queue, since the account of active requests can't be done there. >> >> Now we account the active requests only in blk_mq_get_driver_tag(), >> which is not the time we get driver tag actually (with none elevator). >> >> To support batched queue_rqs() on shared tags queue, we move the >> account of active requests to where we get the driver tag: >> >> 1. none elevator: blk_mq_get_tags() and blk_mq_get_tag() >> 2. other elevator: __blk_mq_alloc_driver_tag() >> >> This is clearer and match with the unaccount side, which just happen >> when we put the driver tag. >> >> The other good point is that we don't need RQF_MQ_INFLIGHT trick >> anymore, which used to avoid double account of flush request. >> Now we only account when actually get the driver tag, so all is good. >> We will remove RQF_MQ_INFLIGHT in the next patch. > > RQF_MQ_INFLIGHT is only set for BLK_MQ_F_TAG_QUEUE_SHARED, so we can > avoid the extra atomic accounting for !BLK_MQ_F_TAG_QUEUE_SHARED. > > But now your patch switches to account unconditionally by removing > RQF_MQ_INFLIGHT, not friendly for !BLK_MQ_F_TAG_QUEUE_SHARED. > Hi Ming, blk_mq_add_active_requests() will check hctx->flags before doing atomic accounting and only account for BLK_MQ_F_TAG_QUEUE_SHARED. Yes, we don't need any atomic accounting in non-shared queue. Thanks.