Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9984407ybi; Wed, 24 Jul 2019 13:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz43RgmvgJTGSd0aCQ0uwSgfbHKr74/qU/s3qNjMjF4pWzo/prH6H43uh1Vx+CfQnGAF7zI X-Received: by 2002:a62:e308:: with SMTP id g8mr13718183pfh.162.1564000373761; Wed, 24 Jul 2019 13:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000373; cv=none; d=google.com; s=arc-20160816; b=h1nY3l1k69xLNMQMxnyREQxeXKLuOHGM1BUtMytggyyO8JEils7OmZbqBAPBVc7QHK SgIuROw6IVAJes0NUG6mDRIecFJkuk4Qv1AwQbPzyN82ygybE/2QwCxuhRAniy4XVmmA bLlkSxlAKuPg9CsBczLIbZ1yew0CXihDR5m1jXh1qdy9XTLgXfq2CIAS4N4U6BZNjxux tJbMlXKOfrPlR/VS0pOW4SXsxWZgGwuBMWwc/NGDYTi0bklzeOL2l4uod8Tz00EldEn9 9IIC4Dr2XF57ntNOAdAxPqG+m8tB1PkCGb7laCM76UXrucjHahK6PIE91c4UD00Na/7C 4CJQ== 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=NpSRT+BSd2Q/XsT4RLhpd3SG5Lext309WT5hM0wzyhA=; b=rt+2CQ2cNEiE3rIKHm8WPzU3u9aRZHxAiKsD3bUbc1bDepIrfEZAfOy+PWiLg/c3/Z kHvnnXkv1c78WX1HztTIEBd5gNoaA/TFTA/NsO843WHb6BagzJejp5R7ngZztbs6WJND Ce2c1PAHMdbDl/Eob/gtQ4XLLf9tT7JnxfI37V1Te4vEKcsmRsRZ0lYkqNNaOjtEFL6b TpraCFwXEIucG3fg/L3q8ZYv1bwevdxCjWk3qq/UVF9GVtjUefL7Er2Z4KwPJWOfnHBY oZwz2bdBwLVZoKGCpLZkqGKGB+nUXHtf3T9tMp8oh505XMi9Qv/gBcwk9KxjfBN74lsH 4cGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cXnGF6b7; 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 34si14715598pgl.397.2019.07.24.13.32.39; Wed, 24 Jul 2019 13:32:53 -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=cXnGF6b7; 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 S1729018AbfGXUbV (ORCPT + 99 others); Wed, 24 Jul 2019 16:31:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:50960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388383AbfGXTam (ORCPT ); Wed, 24 Jul 2019 15:30:42 -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 1D98621951; Wed, 24 Jul 2019 19:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996641; bh=LIJGF+UuwXoc24xOqPrYVuQP8Bd1KAdghCvRIVquvws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cXnGF6b7kAGfycFJ+kUcxcWP5+OoGxIJuw6RIKSsq1mTnT3sJsFHE9MI/MtG9FDzX iyHALcyU5aYYuTVKFs5onJJ2QPwxmtpI7Oj6OKwTObTzsBMxxXjqJUQOori9Ku3r/W uSaBoNcmtIwoBCC3VOuDQZ/SIb6x49zzJ72RXwes= 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 5.2 126/413] blk-iolatency: only account submitted bios Date: Wed, 24 Jul 2019 21:16:57 +0200 Message-Id: <20190724191744.147311482@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 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