Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4683223ybi; Mon, 15 Jul 2019 13:00:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRdwvjCm3LnbKPw/h9E+1JR4U5y8ogtQ0RdEMjb8/Lu8x+0ajTptHlZfbndykyg2vPZPap X-Received: by 2002:a17:902:b70e:: with SMTP id d14mr30027975pls.309.1563220814153; Mon, 15 Jul 2019 13:00:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563220814; cv=none; d=google.com; s=arc-20160816; b=PxuRkD2BXvGCNw/NxJIhvrVgjRF3c4hUSFaAbEOugCcbU0IwfyKlfQ4Asu8a+OlZAw gRHGo9vGXUszpIVz5pJV2LTyr4Vdzq1asEWb00IlAEQAVfHn/LOoAbzHHUIaBMzBm/WW gK4V2cpOEb6o+L8PUuqvS4F/wa/t5fREtiNw2cjRawO8yyYNRQ5J85e43ZGyfZGLVezS qSwJ3FKQFgdLBC7IFkFvbZ5IRa+tFe6gH9wrswAkHNPeSUxkrrinQPZxijmrGogf15+Q kKXxDDhxJWBJKjxVCdupIFvl/ZSAHVvZk3EsF1ssQ2hBD2G7rT8OXtuLLcQFDb0SK/z0 78jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ceLECMEmBKTfKlOu7paiH5PQ+8sxnNMR+mr/dxfQEl4=; b=zx3MGxtMwOLbwOSnqsXhgze4gAT6kKhXdz3Q5Mpgo4Vo6DP0AaXvTIiYHXYo4jquzg rlaYaDrmpJnNi/PoHRbuX9p1L0Y8EXHFdBSnHVIIQUKqjnMkDcNAUySOcUegE2wA2BsW EpXAnJYBOxGmZ7uR2NKZqiiD81ZUGxlrVT8wEjaHwTr9x7Z4QaP4JfIuBzSFoTQ+YNxD R8HQR4sqA+x1eAfBdbLs8wkwd56T5amKAlDdrB8jGc1FLYHnabVpDwXSQWv/RtSUYMM7 U4RQNLkPER5VU4VocOzDSOPwVpdPWw3uMQkyEJGJx6whkrgbtHrOrX03im221ra5DOq/ /usw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 y82si17265731pfb.58.2019.07.15.12.59.56; Mon, 15 Jul 2019 13:00:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731651AbfGOT6L (ORCPT + 99 others); Mon, 15 Jul 2019 15:58:11 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45484 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730712AbfGOT6K (ORCPT ); Mon, 15 Jul 2019 15:58:10 -0400 Received: by mail-pg1-f194.google.com with SMTP id o13so8206087pgp.12; Mon, 15 Jul 2019 12:58:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ceLECMEmBKTfKlOu7paiH5PQ+8sxnNMR+mr/dxfQEl4=; b=DVG25CA+YnRtwdSO7z+++PHnmtVxGy2AekQPf1X2D9muQnThshcJFGG+3kUAqZFrbK 1QIpkEPp4F0AKiXPZ2imbmS1ZbRw6WWiDTYLa3CfLHjvIX0S6X4LbQUAG+2/DvE1zKjM n4qrQXnUAlnqKG3B2UnpwIfwJ3imktX8ZNU5BnTBBroADzrbIZkhT9igbxhQalOn05Mj W72jQlgGwnzHu53a7/DOphPA5KsBfjEJjiAh5afkMIKuDsZD0tiI13RfEcmNPl9P4WmE S6WP6LpbnX1NDO9wHB87INmsC8fcDsgkieBSgYALwDD2TyQg/za5pY0vY9ha1phG8+Tb B0gQ== X-Gm-Message-State: APjAAAWY5GET6mMMIucp2N3B3Klr9QvVb61fcu1xBgZJipu2yT91Q4Mf /g4gEMOh9t1vgBH3WYa1GYQ= X-Received: by 2002:a17:90a:21cc:: with SMTP id q70mr32105249pjc.56.1563220690012; Mon, 15 Jul 2019 12:58:10 -0700 (PDT) Received: from dennisz-mbp ([2620:10d:c091:500::3:5b6b]) by smtp.gmail.com with ESMTPSA id p7sm18514921pfp.131.2019.07.15.12.58.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 12:58:09 -0700 (PDT) Date: Mon, 15 Jul 2019 15:58:06 -0400 From: Dennis Zhou To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dennis Zhou , Josef Bacik , Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.2 129/249] blk-iolatency: only account submitted bios Message-ID: <20190715195806.GA77907@dennisz-mbp> References: <20190715134655.4076-1-sashal@kernel.org> <20190715134655.4076-129-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190715134655.4076-129-sashal@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 15, 2019 at 09:44:54AM -0400, Sasha Levin wrote: > 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 > 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