Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1221749rdg; Fri, 13 Oct 2023 14:13:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyoqZ3rbDPu50tV4Qt+Nr0NKADpHOaxo9XqjEunW+B4s3oOnon3BHtvQVfLwuaeNwE4GXs X-Received: by 2002:a05:6358:63a1:b0:14c:d9d1:7ac4 with SMTP id k33-20020a05635863a100b0014cd9d17ac4mr29677076rwh.6.1697231605893; Fri, 13 Oct 2023 14:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697231605; cv=none; d=google.com; s=arc-20160816; b=azv+vV1yW1yoEuyR//KlwcO9CjHDnflNNS35BHvsi3LCzjVNM7zIA792O99JpFed2G 0PKwbY9Wz+rj2DQr/uOsVs1HdKfBjoU8ZuvVKU3ymjHVXJrx6SyPFIef3KfCuq8iEplD NgfLamcWydts0m+NQRmbMEoewJRYCiZAJ8rSPL7XVScKXVmiG2COocuYkbHzPWXDxOn/ t6Y8zcRGCK7fdDsJfTXq/NjOAHX9Yjc7dMYO3YPXiOGsVOTXYV7dfuzJofBW7tc2nrsL dHVN0LewX5EJv8J4vCwJ0zzyXTOhX3c0sZlGxtVWW70fumpUeqA46PXFbmRwPtKuFbIb KFnw== 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:to:content-language:subject:user-agent:mime-version:date :message-id; bh=PFfUBfp0ylGGMlfj6k7w0PNxEF/kGtQC5wyiNRvjhTE=; fh=Wo+e/csP/VZ5Z/xR0orApYUPUuYpOqLoc9e2v/twl8k=; b=o/YLAq+XxnqR+HI9DnGVDRPeaYVk+Q1coeh4OIqZN2D5WAFrHLY/vfkgw+D12FIejb yoUKpzYDDa3AhVOxj+BE6nxKSUe4EGhKi9Jb6rESHHukgJqyJON4FGO7UPS53F99Mk6m UBfAnzN7rjBcqhceuNHSP5j29n4ryjzIKI7rqLPh+cBpNAgK8JYVJeaE9bvt8r2iH3QS ijiYfB3/ShskQ6BTrslX4HD+4vi+VTIZcI15Nxdse1vSc/fgAxLTjMvIL7meCzOD9bSD QEldRrXqs0orP/h5Jlsy6g8SFROWuIEkVurLo//2rXzb0YqVgdNUV+SGc9Hvmdl6YLgZ QScw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id d17-20020a056a00245100b00696b367da55si1850761pfj.396.2023.10.13.14.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:13:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B5F7E83A295B; Fri, 13 Oct 2023 14:13:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjJMVNN (ORCPT + 99 others); Fri, 13 Oct 2023 17:13:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbjJMVNM (ORCPT ); Fri, 13 Oct 2023 17:13:12 -0400 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E949AB7; Fri, 13 Oct 2023 14:13:10 -0700 (PDT) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1c9b70b9656so18666705ad.1; Fri, 13 Oct 2023 14:13:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697231590; x=1697836390; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PFfUBfp0ylGGMlfj6k7w0PNxEF/kGtQC5wyiNRvjhTE=; b=N9D5LhZtHleJGbANPwZQ2m9I9zq9MdgC/t2CxAWflBJLdwWH5R2L8SFE2VDG1UxqJB y0QkAPHGisIEGonc0Iiy4IO8bE6WEKMxhQOML0TCW+q1/iFyoGLdjYRbpzE/FtQYsS2d SH9iSRtbYeAGINHxXeD4aBt4lGUuw4W2brwIaaj/FEfi5Wq8DGVMTls11kRw2G3fiA+A GCimIOpzJhMFI0ZZogwhlzL+AAY5S07OTOkdSh7nV1JydHtjni5dmtrQRYs7XALLhLYZ 1jsckniLIQjDr9x/WLAl5S7NyQKPnYnpo9S2C+DtPkPrP/bU1yvG0vUyBqYCHgJ+d9G0 9dCA== X-Gm-Message-State: AOJu0Yw4MUhr6iQLi+2sb1BrqyVq+eWkiPl0fx586vHePWyvyZYv/f+F KXlIj8lrj5UfBNS4aEaQl+Q= X-Received: by 2002:a17:902:e809:b0:1c7:1fbc:ba02 with SMTP id u9-20020a170902e80900b001c71fbcba02mr31279327plg.47.1697231590270; Fri, 13 Oct 2023 14:13:10 -0700 (PDT) Received: from ?IPV6:2601:647:4d7e:54f3:667:4981:ffa1:7be1? ([2601:647:4d7e:54f3:667:4981:ffa1:7be1]) by smtp.gmail.com with ESMTPSA id z6-20020a170902ee0600b001bba7aab822sm4344531plb.5.2023.10.13.14.13.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Oct 2023 14:13:09 -0700 (PDT) Message-ID: <35e3e173-8018-42d8-a6e8-7ba994ff6b17@acm.org> Date: Fri, 13 Oct 2023 14:13:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2] Consider inflight IO in io accounting for high latency devices Content-Language: en-US To: Gulam Mohamed , axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231013195559.1306345-1-gulam.mohamed@oracle.com> From: Bart Van Assche In-Reply-To: <20231013195559.1306345-1-gulam.mohamed@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 14:13:23 -0700 (PDT) On 10/13/23 12:55, Gulam Mohamed wrote: > @@ -1015,7 +1018,13 @@ static inline void blk_account_io_start(struct request *req) > req->part = req->q->disk->part0; > > part_stat_lock(); > - update_io_ticks(req->part, jiffies, false); > + > + if (req->q->nr_hw_queues == 1) { > + hctx = xa_load(&req->q->hctx_table, 0); > + inflight = blk_mq_hctx_has_tags(hctx); > + } > + > + update_io_ticks(req->part, jiffies, inflight); > part_stat_unlock(); > } > } blk_account_io_start() is called by blk_mq_bio_to_request(). So if I/O statistics are enabled and if there is only a single hardware queue, blk_mq_hctx_has_tags() will be called every time a bio is submitted? The blk_mq_hctx_has_tags() function iterates over all tags. I would be surprised if anyone would consider the overhead of this approach acceptable. Thanks, Bart.