Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp559088ybz; Fri, 24 Apr 2020 05:25:40 -0700 (PDT) X-Google-Smtp-Source: APiQypJDPFj9wNqfFrG4bWSj8y+SRlBk8d1lCSuGj7lhbtNLYAOnDEkMglcL0tEbvoUvci7+tKO6 X-Received: by 2002:a17:906:804a:: with SMTP id x10mr7197223ejw.86.1587731140125; Fri, 24 Apr 2020 05:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731140; cv=none; d=google.com; s=arc-20160816; b=blobOlRSM6Ix396MslEFMHlyWVy+JWMwZ/pVS/2gRDG5CxEzOdzbR5iO4Er2masSjQ L2LTwvRgKdMACPGRiToUg+XUPJSABR17Cr9lZ59p0XLjzWW8WJqGkdZS9TeSwylb4TIE GVK5Koaa2UyiAeVsf+HK6kIjocpm6Vg6Nr4xCYwE8197XWncjDjKuO9UwNfk8x1VCdSk lkBiaANZk7lYw2ocuQ5DCrFJwTzpqgjUbHKBmBw2Gy2UWrx7JVv70qRGDbUGGlCv7z66 m1bMVXRO3FX512Rd9z20HO4DQ0/CjDT/7hrb306XbRUByAbw09Otj9BIUA+okYC2BDQw gIaQ== 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=6sqOobzlSK1VcV52Z7VSSGF/MIUQNRi0rB7fc3i/Lz4=; b=pflSCx4EBs7wdk4dozj+rzWaiPUJKnf1MPCVs/QS3iHMzsbuqiYisYgo97yB/zy/Mr hTo/0K7wgsOkXXIBiFvc69ye6M6LgLvQKhs0sNkarGSjNxmuyvHCHoteGAztYRSIp72K NUjHPwHr5+Eed8ZLk6goYUfQWXMM4Sox//4iU2jlUnCkH2RDSSIN5f0rvqZQ+mv/DoBx YSU2keKMNcZJamBlLFVwXXiEzS6INbOvR5ylnx+Wjyo74T64oCp/dEhqUXs1sJ85d4pV Y08yBsIV5DpSP5mf34XYg7HokCPTyjfHNlYBca+IQe1cEJX82cHfKM5fwL0qXRX0dCp4 O94w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ipv/rp2N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w1si2955025ejq.325.2020.04.24.05.25.16; Fri, 24 Apr 2020 05:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ipv/rp2N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727970AbgDXMXZ (ORCPT + 99 others); Fri, 24 Apr 2020 08:23:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:53026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727920AbgDXMXT (ORCPT ); Fri, 24 Apr 2020 08:23:19 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.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 1AA1C21569; Fri, 24 Apr 2020 12:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587730998; bh=AiHOas8FpZ+35GyVOzSMP/dUHuS5mXTYhtblJ3qlYeA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ipv/rp2N8Rp3Uq+pwD/I//v2eejjgONxhjiBq94EzBmN7IeNO233gSRjigbrz4JUZ hzmXDlZaeOx85kjU2LeGk/r2udy8FKMOW7msLj8OWGzbt0UkBjA9B/+AFUoQXwszNj llm09J5qumtsT9uuTVANIXPM3zIBkbaeu2Cjw3mM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: John Garry , Ming Lei , Jens Axboe , Sasha Levin , linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 5.6 36/38] blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget Date: Fri, 24 Apr 2020 08:22:34 -0400 Message-Id: <20200424122237.9831-36-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122237.9831-1-sashal@kernel.org> References: <20200424122237.9831-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: John Garry [ Upstream commit 5fe56de799ad03e92d794c7936bf363922b571df ] If in blk_mq_dispatch_rq_list() we find no budget, then we break of the dispatch loop, but the request may keep the driver tag, evaulated in 'nxt' in the previous loop iteration. Fix by putting the driver tag for that request. Reviewed-by: Ming Lei Signed-off-by: John Garry Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 37ff8dfb8ab9f..2c3a1b2e07537 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1205,8 +1205,10 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, rq = list_first_entry(list, struct request, queuelist); hctx = rq->mq_hctx; - if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) + if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) { + blk_mq_put_driver_tag(rq); break; + } if (!blk_mq_get_driver_tag(rq)) { /* -- 2.20.1