Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10423215ybi; Wed, 24 Jul 2019 22:58:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUa7hvHt6FM0+pHEn8HhnnoojFtWOxvVkaampN6fsUd12qmb91T7pbrMiomPirfVeJKbSU X-Received: by 2002:a17:90a:fa18:: with SMTP id cm24mr88832941pjb.120.1564034290232; Wed, 24 Jul 2019 22:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034290; cv=none; d=google.com; s=arc-20160816; b=YSBFrR9W4xaAEhwq4sD+Ku1AFEp28ngMLPi6GcHDGlQFZ1gaNKr0MuspafJjDAyzHI HtusrsVydSPDig6Ohc3EAXXc+wRhAaNwRWX5DsGpul22FhW9KFYuaEucingmSv/kPiCw CagKWUF7AtTfD8J+/9L2VJ8ua/Yz78eLlJYUDQywFfSqQNJvyKaUWciHMS57U9oMQrvW dHPkILYwsWOqUVQV/EVnQee3JR7Eix8OLeGCFgssA/XqURBD9VXoitEIxFEQKtYPahAG vxfhH05+q+WXqHECeVPHCpGYBsGM/Qs+bmsEGqQLo54GVj1ZUfxTS8a8s683DHX2LcJU bksQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9oFQX+Yh1ZqPVFsc6OxOBW+4jCoOiFqtLVU2DI/834I=; b=a90e/k2wvd0BxR/9rug6cuKOB1Al9lIhOvSSuK4CQssMDWIfByx2qxMlnZyRQ/cj/3 LFTOBdoeVNAM+VnmA/NnpLc/2/uu7sbyufJw8qlhqoFRDFff74J5WgHkx+tueuX+2Nqa +QWjASa7cy5zBOcnU9koJgOaGVIRIy2K7IijaeIfSPrZn1KEmXWDFPUfzxXhMipSP+mO 3M8jZkJy1DWABBjEKQyeMSNHQrKR/PWZqGpUpO1bB9CQpehgHuXZact6px7FF7bYh+H1 lxLRc7LqT5IqwoJG+JIWQfwk9kWJQwvCZmMvVebuwvPHX5U+CmGzhUpEuuk5IKiyfXWe Ql3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xrlcp4TW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v62si19966253pgv.126.2019.07.24.22.57.55; Wed, 24 Jul 2019 22:58:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xrlcp4TW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404229AbfGYFjz (ORCPT + 99 others); Thu, 25 Jul 2019 01:39:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:54226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404214AbfGYFjy (ORCPT ); Thu, 25 Jul 2019 01:39:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8FFA022BEF; Thu, 25 Jul 2019 05:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033194; bh=WO7lM+upPBvUtwOll1Wkav1Vka6e95b0zA6c7vFYhfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xrlcp4TWiyzfAxlYCE1s4Y/HSsmMWmY2OmpCrp7JaJwjMci55MUHjkJ9TRkJDrfDO 4DE6rE2Kwg9uiPsoTESYl99FrydIDM5gKRntaVujfaOfilxcOTUozJUxdrnijVJs5x QLTh8UJQsaoNShJtOyToepZhYKzs8YjA8L8qwGEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dennis Zhou , Josef Bacik , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 084/271] blk-iolatency: only account submitted bios Date: Wed, 24 Jul 2019 21:19:13 +0200 Message-Id: <20190724191702.387111366@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit a3fb01ba5af066521f3f3421839e501bb2c71805 ] As is, iolatency recognizes done_bio and cleanup as ending paths. If a request is marked REQ_NOWAIT and fails to get a request, the bio is cleaned up via rq_qos_cleanup() and ended in bio_wouldblock_error(). This results in underflowing the inflight counter. Fix this by only accounting bios that were actually submitted. Signed-off-by: Dennis Zhou Cc: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-iolatency.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 6b8396ccb5c4..75df47ad2e79 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -565,6 +565,10 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) if (!blkg) return; + /* We didn't actually submit this bio, don't account it. */ + if (bio->bi_status == BLK_STS_AGAIN) + return; + iolat = blkg_to_lat(bio->bi_blkg); if (!iolat) return; -- 2.20.1