Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4299746ybi; Mon, 15 Jul 2019 06:57:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxln/9vqBYv1XzFBtomh7WSNeYDFkiXkAltpEKrr4QbiJZwGCmJMuiO62R0eEaJgAx97GkO X-Received: by 2002:a17:902:1486:: with SMTP id k6mr28103711pla.177.1563199057718; Mon, 15 Jul 2019 06:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563199057; cv=none; d=google.com; s=arc-20160816; b=eRprn4JaPEteuf5BfwRXw0Ga9UCYw9MSnY3qm7EQti3umpOLrEZrfk9CNqXc2XI52I llIPID3OH6N3F8crqfAnExjWRUseU03kYdGZV3lO8Pp0pEL5Reg3alXLK9ck+hCZizEB veUIFsKd+xcE1qBZWl34++1H8umpPX8gqq/qfW6WJJDXVT9cdrDnqZePx0465v/5d2h9 ZYx0N8S6NsC8Vd2srLA/CgPiEQJt1AVCB2yhuJe2B+et/TSvrgkfYOmbrXjbo258jXK4 rgt4ujbzF24b6ujIfOlJ1bV8KSmxq+XBn/sqUpo1kyqKtm6s3jJx70DxBx97pZWpaazd iIcg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RccEZF8GGTMIwsP7ldet+KuKCzrhpZb6oRViw7EFIVU=; b=UVkGQ7alzLAW7dgGIClt/qFO3h+Z9rp1ZazL1hOJyNYDEzesaJTUuhhnjFz+dVX69k 4KYUtFhL7qxoatk8yVC9mWL3H4ewfPW9tDnX9EUxgSB0a4NqkPhfN96IkpMaztDXFk7f 2AOXVTqj/mRks92mHxgdl6CIWxEgmoNNVG1X305H+qqyX3gKeffALhBDgZlub4rfYDa7 yduJBnRB9vrhtZbEb1FJm5sNyeMPe3i0ZKXIqoHsQHEQOnPIEtB2h7lWtjbELuRtzpxT pUoMdu9OZRsnQH+mLvAm+95lDMXVo24UgPVtmFpLtKpijRzdoqOIVvMaXePdOMRGy/3A vhZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Xbf/oMhP"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k65si16158418pge.422.2019.07.15.06.57.20; Mon, 15 Jul 2019 06:57:37 -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="Xbf/oMhP"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732576AbfGONyx (ORCPT + 99 others); Mon, 15 Jul 2019 09:54:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:55834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732553AbfGONyu (ORCPT ); Mon, 15 Jul 2019 09:54:50 -0400 Received: from sasha-vm.mshome.net (unknown [73.61.17.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C0CDC212F5; Mon, 15 Jul 2019 13:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563198889; bh=gj0zBDm52IIackDZtC7KVsYGiEuhEY9qeD30u0iD1ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xbf/oMhPRWW5zjmncl0vn6JnaOBfY86I2kZ3gcFcavEfYx5V/JCO1WA6w+sFS4PDR 4dGFtuHaNlj+gSQlLZa/1qz+oH8uG2oFcZySelpq1/TiFd27ASqTUL8cELlLdhxEuS tgg2DR2Gfjhf6O438IXn0v4QYfGdr7jIL//d1dso= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dennis Zhou , Josef Bacik , Jens Axboe , Sasha Levin , linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 129/249] blk-iolatency: only account submitted bios Date: Mon, 15 Jul 2019 09:44:54 -0400 Message-Id: <20190715134655.4076-129-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190715134655.4076-1-sashal@kernel.org> References: <20190715134655.4076-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dennis Zhou [ 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 d22e61bced86..c91b84bb9d0a 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -600,6 +600,10 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) if (!blkg || !bio_flagged(bio, BIO_TRACKED)) 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