linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Zhou <dennis@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Dennis Zhou <dennis@kernel.org>,
	Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 5.2 129/249] blk-iolatency: only account submitted bios
Date: Mon, 15 Jul 2019 15:58:06 -0400	[thread overview]
Message-ID: <20190715195806.GA77907@dennisz-mbp> (raw)
In-Reply-To: <20190715134655.4076-129-sashal@kernel.org>

On Mon, Jul 15, 2019 at 09:44:54AM -0400, Sasha Levin wrote:
> From: Dennis Zhou <dennis@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 <dennis@kernel.org>
> Cc: Josef Bacik <josef@toxicpanda.com>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  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
> 

Hi Sasha,

If you're going to pick this up, c9b3007feca0 ("blk-iolatency: fix
STS_AGAIN handling") fixes this patch, so please pick that up too.

Thanks,
Dennis

  reply	other threads:[~2019-07-15 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190715134655.4076-1-sashal@kernel.org>
2019-07-15 13:44 ` [PATCH AUTOSEL 5.2 108/249] block: null_blk: fix race condition for null_del_dev Sasha Levin
2019-07-15 13:44 ` [PATCH AUTOSEL 5.2 129/249] blk-iolatency: only account submitted bios Sasha Levin
2019-07-15 19:58   ` Dennis Zhou [this message]
2019-07-22  0:39     ` Sasha Levin
2019-07-15 13:45 ` [PATCH AUTOSEL 5.2 137/249] lightnvm: pblk: fix freeing of merged pages Sasha Levin
2019-07-15 13:45 ` [PATCH AUTOSEL 5.2 138/249] lightnvm: fix uninitialized pointer in nvm_remove_tgt() Sasha Levin
2019-07-15 13:45 ` [PATCH AUTOSEL 5.2 169/249] block, bfq: fix rq_in_driver check in bfq_update_inject_limit Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715195806.GA77907@dennisz-mbp \
    --to=dennis@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).