From patchwork Mon Aug 17 15:10:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66262C433DF for ; Mon, 17 Aug 2020 15:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28470221E2 for ; Mon, 17 Aug 2020 15:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677739; bh=VhMqv89aKVSu2wYlMStOJnpTIrVpsgyXhjWZ+wheO74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HPREwa82vD7XGwTO04zdww7d4azV9Vp3za0AJjyAnNm0oohnkDHc84jg9ZWp42UCA k3ta8n3RJFSDHAgoZ7W+c6rS9Xfp1lrcYhQWUFbi8zb6l3imGkDh/6KPdPJCygxOc6 fbgRj5fgRT7SWWP+RaZwcwDBsktE3X/KtZF0Mlek= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729441AbgHQPWR (ORCPT ); Mon, 17 Aug 2020 11:22:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:45994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729434AbgHQPWR (ORCPT ); Mon, 17 Aug 2020 11:22:17 -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 AA0DF23101; Mon, 17 Aug 2020 15:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677736; bh=VhMqv89aKVSu2wYlMStOJnpTIrVpsgyXhjWZ+wheO74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bp1VKtTeQzsTo40D6hIU9yB5oU1PAbK9zmH15v38TpBrWLVAsYP+gjEAHOaWV9Pgo ajGFwshqyH1vj1xIMxUAdFMafwlTG6uZBHM8Bq5axC16oZ93w31Ynb6nokVm4II6Cc EShsIs6jBpd4ps921BmuLZXbiTw0k0ttJEcgEZXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chengming Zhou , Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH 5.8 058/464] iocost: Fix check condition of iocg abs_vdebt Date: Mon, 17 Aug 2020 17:10:11 +0200 Message-Id: <20200817143836.543336190@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chengming Zhou [ Upstream commit d9012a59db54442d5b2fcfdfcded35cf566397d3 ] We shouldn't skip iocg when its abs_vdebt is not zero. Fixes: 0b80f9866e6b ("iocost: protect iocg->abs_vdebt with iocg->waitq.lock") Signed-off-by: Chengming Zhou Acked-by: Tejun Heo Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-iocost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 8ac4aad66ebc3..86ba6fd254e1d 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1370,7 +1370,7 @@ static void ioc_timer_fn(struct timer_list *timer) * should have woken up in the last period and expire idle iocgs. */ list_for_each_entry_safe(iocg, tiocg, &ioc->active_iocgs, active_list) { - if (!waitqueue_active(&iocg->waitq) && iocg->abs_vdebt && + if (!waitqueue_active(&iocg->waitq) && !iocg->abs_vdebt && !iocg_is_idle(iocg)) continue;