Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1063450ybl; Wed, 14 Aug 2019 10:07:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY2cyPSuvTy1181rc8WsXcXEvhfHqYbxMoGWb7lgycLjgPD7kBobwi16wDWw5skyndthjh X-Received: by 2002:a63:1:: with SMTP id 1mr199641pga.162.1565802446646; Wed, 14 Aug 2019 10:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802446; cv=none; d=google.com; s=arc-20160816; b=x89wqamo99dNap5kQrnzsWqkTxe2xJ0K2+ajyo8Ksa4HMZf/qSQ/cmt2ate3hftWCu iTHd/j4E9F8qJ7J9gAZdn+/5ooOsszx2I+dzGgARPenbwOX9COhh3oQ18BQaumIv7cj/ 3SKB1aRAtkKrI1ZrUVWQ371cexM/OhdP+U39V1779C2kQSq4A6itDS41yj17+V0d1Jd8 fsFXKPOBvCZy0hxrUcMTAqQEa4hrkMQGYue+qZH4ocx6OGYazqBl2Nc8C2j6KJFVRPqW a9FAc/zM6aK+JJKTGVM9XReiQB5B1UzGpp636xo3TqkNGvmvcKAvPPK5EDj02drYSUnV IIeA== 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=ZfzUAIUW0Zk0jrAGyDfMjiIprBCmS0GzFcvhAAWrvcA=; b=SAgYHD27OQKOu56oJCcc3oHwxXicAabAIyyU83wfwW0cAAC13tnUaJyPC1/mNjpXDM 30JQwm0YFTuoFbzTt8jzjJjygw2njjp+apjAX87bENhPa9Xpdt5popP/QnqvpcTu5wuV IQMOsrqkowt85Aw8/0hdjSNLpBCHA4JqP+eYnf/YP6xBo9AxS8BD0ONUM7wMgzgpowwL 9t5nV2t4K3G+Oh5b7h8ugrTUWMakw3+kAnerJr3njr3ITbLwEQfTgdiLhboRMdkHuFBG LgDpSNFNJOkiaq7JxWWYolvxc2NqFqJxvUR1zTrxN9tZ+kw8CNi5WR409lZSM2XOcR5M JoCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yRakyMTE; 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 f1si264076pld.12.2019.08.14.10.07.10; Wed, 14 Aug 2019 10:07:26 -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=yRakyMTE; 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 S1729487AbfHNRFo (ORCPT + 99 others); Wed, 14 Aug 2019 13:05:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728559AbfHNRFk (ORCPT ); Wed, 14 Aug 2019 13:05:40 -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 C95B821721; Wed, 14 Aug 2019 17:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802340; bh=v4VLVQDSvMnhfsEqgws/49qzElS6zd8ANglCL/PMcNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yRakyMTEJ/SodPrVMODLKmPH+gZnzogQLUVvVk81EQZjBbBKNbGZXU7xt64CO+9W5 a4M/Kkkz62MmgXiPRuC3Vu7y0ywhjb+2YDGDqNGCFSW6mo3uTeoIayYI+63cN6Kxz4 YNgZNaJzJe9kL0e3ab0Xz4ADkUnfzb7YtrjmhnEc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oleg Nesterov , Josef Bacik , Jens Axboe , Sasha Levin Subject: [PATCH 5.2 060/144] rq-qos: dont reset has_sleepers on spurious wakeups Date: Wed, 14 Aug 2019 19:00:16 +0200 Message-Id: <20190814165802.340386441@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@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 64e7ea875ef63b2801be7954cf7257d1bfccc266 ] If we raced with somebody else getting an inflight counter we could fail to get an inflight counter with no sleepers on the list, and thus need to go to sleep. In this case has_sleepers should be true because we are now relying on the waker to get our inflight counter for us. And in the case of spurious wakeups we'd still want this to be the case. So set has_sleepers to true if we went to sleep to make sure we're woken up the proper way. Reviewed-by: Oleg Nesterov Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-rq-qos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 659ccb8b693fa..e5d75280b431e 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -260,7 +260,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, break; } io_schedule(); - has_sleeper = false; + has_sleeper = true; } while (1); finish_wait(&rqw->wait, &data.wq); } -- 2.20.1