From patchwork Mon Jul 15 20:11:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 11044905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F4066C5 for ; Mon, 15 Jul 2019 20:11:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B64828538 for ; Mon, 15 Jul 2019 20:11:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B91D2855A; Mon, 15 Jul 2019 20:11:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1255328538 for ; Mon, 15 Jul 2019 20:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730859AbfGOUL1 (ORCPT ); Mon, 15 Jul 2019 16:11:27 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36719 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729844AbfGOUL1 (ORCPT ); Mon, 15 Jul 2019 16:11:27 -0400 Received: by mail-pl1-f193.google.com with SMTP id k8so8865066plt.3 for ; Mon, 15 Jul 2019 13:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=ZWvLpiy8LsbkNpgxUihtSHfUQdquxnVHPH9fwkxLy2U=; b=sEHOuZwJ+BIE4P1ZiXDV0TH7shHP117fYRKQpA5BigDI/0l8pSGUvBLBHvSg3SnJrH E8vygy29R4ETfHRbefwSVptD/vymZ1I6RiNrywBCkMlycvvDn8IcJga5V+jn0GSrMTFk QRotMxIwlVamTSmE1HbjMxBZ45Ye2nh6qZsSIANnTSOrwttE90DdRnaluUfZ6NHV8qrz 6McH7qRWuUsUpcWB1kwD8EC/dJhtygH6AWR74MzdZywIRhvHzNj6uPuwif3OIPXPSf5g KnmA6LzPBsiikOl44CqcOO2qeNbC0CW3fqZS2EbVntOUnrtB7iKGFhkthHEsFcT5vm3m HxEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ZWvLpiy8LsbkNpgxUihtSHfUQdquxnVHPH9fwkxLy2U=; b=j73cmgk/+6XdR1gV5n6mEdyoKHduWwTYO+CCqKRnsiv2ctkaiRmcnlX3ynZHlGfmK9 f5QGNh62NpTaenaIvL76bbRCe8eqUwBInOlwqnvYeXEM6cmZJ2DqSBlqPwspozHwia+Q DTQRSLhuGDQe3g7H8g1KL0WEWHXxk1sZyHhlKI96/9ERUZUrxYafWZuu2pvNhiN5h4E/ FX5PxomhYNiNlFIDJGkmJhC+P5TwSld/epMo1HnEm0TYao18m0r2NeJhRpKQs41hPDaa 0tyyV8UBMS/eu0KczB6z43gSlTK4/6RLSwmDjtFDQYYNlyU6849g370/aMcmJUkDMUp1 EuiQ== X-Gm-Message-State: APjAAAVTKre2co7ZeoLUH6NhgW4q+0E0c24GnbuOjmMdJaNupHoHZhWC BOijiIKNzmaXfZ4ThXUEN2U= X-Google-Smtp-Source: APXvYqwsAL3ErP2ILEO0DCMd1V6VC7J0kOlBY+GrN2v5wIUoSqYN9htNnvIaemXXeHDzUOPRxHUNcw== X-Received: by 2002:a17:902:44e:: with SMTP id 72mr30311235ple.326.1563221486694; Mon, 15 Jul 2019 13:11:26 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::4caf]) by smtp.gmail.com with ESMTPSA id j13sm17302484pfh.13.2019.07.15.13.11.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 13:11:26 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com, peterz@infradead.org, oleg@redhat.com Subject: [PATCH 1/4] wait: add wq_has_single_sleeper helper Date: Mon, 15 Jul 2019 16:11:16 -0400 Message-Id: <20190715201120.72749-2-josef@toxicpanda.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20190715201120.72749-1-josef@toxicpanda.com> References: <20190715201120.72749-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP rq-qos sits in the io path so we want to take locks as sparingly as possible. To accomplish this we try not to take the waitqueue head lock unless we are sure we need to go to sleep, and we have an optimization to make sure that we don't starve out existing waiters. Since we check if there are existing waiters locklessly we need to be able to update our view of the waitqueue list after we've added ourselves to the waitqueue. Accomplish this by adding this helper to see if there is more than just ourselves on the list. Signed-off-by: Josef Bacik --- include/linux/wait.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/wait.h b/include/linux/wait.h index b6f77cf60dd7..30c515520fb2 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -126,6 +126,19 @@ static inline int waitqueue_active(struct wait_queue_head *wq_head) return !list_empty(&wq_head->head); } +/** + * wq_has_single_sleeper - check if there is only one sleeper + * @wq_head: wait queue head + * + * Returns true of wq_head has only one sleeper on the list. + * + * Please refer to the comment for waitqueue_active. + */ +static inline bool wq_has_single_sleeper(struct wait_queue_head *wq_head) +{ + return list_is_singular(&wq_head->head); +} + /** * wq_has_sleeper - check if there are any waiting processes * @wq_head: wait queue head From patchwork Mon Jul 15 20:11:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 11044907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6FBF746 for ; Mon, 15 Jul 2019 20:11:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5CD428553 for ; Mon, 15 Jul 2019 20:11:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9925328538; Mon, 15 Jul 2019 20:11:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 408FC28538 for ; Mon, 15 Jul 2019 20:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730754AbfGOULa (ORCPT ); Mon, 15 Jul 2019 16:11:30 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33003 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729844AbfGOULa (ORCPT ); Mon, 15 Jul 2019 16:11:30 -0400 Received: by mail-pl1-f194.google.com with SMTP id c14so8836713plo.0 for ; Mon, 15 Jul 2019 13:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=MB4gVXqWNYaKJnrlVX20etvhbnggMPAbdHNsnWIPeXs=; b=xQKVpC/gFkHj9XGqYbFT9QwlUw9vLWV/I4yEjny8GRIwQY4j4Cwv+TKgRgyZ71pHBe +Q2Qor1COxoZyyDuXq4xTORWGxFS69X32EehQoWuETojAYG2SmNQ0T5xKo+kHbZLmEwH iYkC3xUB8W9EEE9GjbpxQeyLP7o82fm4ewTW5B1lt+t8z9fTPxBz4dLOztClI2LDQXJs M8SBSxSOQNZaxtEO9nKKHih66xOKyWCDXkNj7grcGMaUlmacW+8/JPr1Q8tnEFeC1sXx AN1DvvqFbc57FzsgzHXKfUilI3LdTMrorN5dpVv+D9ABXUGUf27Uw5SMkEid3DVf6mAx hVoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=MB4gVXqWNYaKJnrlVX20etvhbnggMPAbdHNsnWIPeXs=; b=rzPr4EALmL80D03umdgPj75aM6FXN+S9h3ZRguURHO16INu2Kjoe1t774g923z93C8 khFYXwVnupy+kvVQrXn4MVD4TwrZIyf5jS0sGINtjBgDHM4xWTb+h4EUuY3YffTN9Gzx Mp6CmJaE87ofjQPuqfa2t++XZq9mc0QBk/PEvs2bd7N4ZXDQLwi0hqAoi5Txii4dmF0q KHsgDoO1eAqrB3IO3EUJwu5PFBnSOcCnuoaG/9WtjDW10G0JljlXMHHV8AF1qFFqK9vD dh7Q4swYpHHfJiomSW+0nTj6A91ERaWrxM1cfNK5SK9usJxlWRyw3exBRL/+8gNctStB bFwQ== X-Gm-Message-State: APjAAAW6tHl/Qm6oBZq3cNDICa0UXR9XBzU9B7YhoHMKwwWJts5KXhVr /lBgondhw2r8YczYqHfdQHZCZjB8AE4= X-Google-Smtp-Source: APXvYqxhVQMunxrDtxDEzFdb/upPWtMDsgL1O0zWrOChUH/xczkCKXzjvwUvgPJnaHdqlrUFb4lsBA== X-Received: by 2002:a17:902:76c7:: with SMTP id j7mr29155243plt.247.1563221489457; Mon, 15 Jul 2019 13:11:29 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::4caf]) by smtp.gmail.com with ESMTPSA id h12sm23119181pje.12.2019.07.15.13.11.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 13:11:28 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com, peterz@infradead.org, oleg@redhat.com Subject: [PATCH 2/4] rq-qos: fix missed wake-ups in rq_qos_throttle Date: Mon, 15 Jul 2019 16:11:17 -0400 Message-Id: <20190715201120.72749-3-josef@toxicpanda.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20190715201120.72749-1-josef@toxicpanda.com> References: <20190715201120.72749-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We saw a hang in production with WBT where there was only one waiter in the throttle path and no outstanding IO. This is because of the has_sleepers optimization that is used to make sure we don't steal an inflight counter for new submitters when there are people already on the list. We can race with our check to see if the waitqueue has any waiters (this is done locklessly) and the time we actually add ourselves to the waitqueue. If this happens we'll go to sleep and never be woken up because nobody is doing IO to wake us up. Fix this by checking if the waitqueue has a single sleeper on the list after we add ourselves, that way we have an uptodate view of the list. Signed-off-by: Josef Bacik --- block/blk-rq-qos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 659ccb8b693f..67a0a4c07060 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -244,6 +244,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, return; prepare_to_wait_exclusive(&rqw->wait, &data.wq, TASK_UNINTERRUPTIBLE); + has_sleeper = !wq_has_single_sleeper(&rqw->wait); do { if (data.got_token) break; From patchwork Mon Jul 15 20:11:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 11044909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42E5B746 for ; Mon, 15 Jul 2019 20:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3154E28538 for ; Mon, 15 Jul 2019 20:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 253BA2855A; Mon, 15 Jul 2019 20:11:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0FF128538 for ; Mon, 15 Jul 2019 20:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730981AbfGOULd (ORCPT ); Mon, 15 Jul 2019 16:11:33 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44004 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730882AbfGOULd (ORCPT ); Mon, 15 Jul 2019 16:11:33 -0400 Received: by mail-pg1-f194.google.com with SMTP id f25so8231908pgv.10 for ; Mon, 15 Jul 2019 13:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=bppF0imIlhYjcYfkQ8qzigS2WeXZqJaJnuaoOOwuuFA=; b=fTbMGjhZ5blJowGwm2MJxtZHweyY/0RlHfhgceJb25UGo+volUkTPCmWjzS03PBjyn kHfDbE8J4q9AzwOGORyrxIu4szA6P8Xk1bdbt2DiojhwuvacJ7PmNvTRc0tKv72Hqx2X 075DecMI7HFpdHAAC+b7lPz52kOaw8zthuPhJ6Rpfts1CvxJCLLhDuFQmzsZAZ4pKjfe 9MlmC2qa68Z36lwh9nEdU4u9qo1loAa9iFjYRGIU8A5hjDrMEGD6Dvh9Hu88S/nrbTEo PjdVQxTGakTQg0vRIz++tjF+muZtEq+IWWOm51EXG52TyeVrTGQUbTJwn8DzQuyBPTgf 2rkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=bppF0imIlhYjcYfkQ8qzigS2WeXZqJaJnuaoOOwuuFA=; b=nvDud5wN3DB0Saf/t04W4EqdPBqmRJK2I4eHEMWwsuuC3IIKR9jdOTCKU1Z/KQnI/L fqsTD9f8q+Mmbv/mxSRvDczPRSC+C2ze4Z14H4b9IYmc54k+rINS4Rx61D0MwxFlCfdH GT63XdGMVA2yHkKs3notn/lbWsLseuWlYC2KgB3SGQj1OZXUCmJGVq53CW6wtRaJq9w4 23+bOUOdjQ6JsSD6gSFlYGBlKALgLpR48uqLd36+UU/uH7QG5Ylq4JNEQo2Ppf2/dCIc UuRYIgkrR+bb6KNfJ5gDfqWkHgc1N2ZWhBFFZQqJNhIrDT1ymOGneBvHTEbw6G2ww95H w22Q== X-Gm-Message-State: APjAAAXNGVRVPTe6fQspjgTNICA0GtOm+hFOqi5djj+g8xsoCyBMdtmv mig/88EsRtNynTrjVAT0y7Y= X-Google-Smtp-Source: APXvYqy6gnNuaPgBbBSmZ4RVshldvtkrhOme8CwfUdtrtitIzHVWM7YkYEXuIr0v7qze0Eitc3gpSg== X-Received: by 2002:a63:a41:: with SMTP id z1mr28773187pgk.290.1563221492268; Mon, 15 Jul 2019 13:11:32 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::4caf]) by smtp.gmail.com with ESMTPSA id h1sm24681888pfo.152.2019.07.15.13.11.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 13:11:31 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com, peterz@infradead.org, oleg@redhat.com Subject: [PATCH 3/4] rq-qos: use READ_ONCE/WRITE_ONCE for got_token Date: Mon, 15 Jul 2019 16:11:18 -0400 Message-Id: <20190715201120.72749-4-josef@toxicpanda.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20190715201120.72749-1-josef@toxicpanda.com> References: <20190715201120.72749-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Oleg noticed that our checking of data.got_token is unsafe in the cleanup case, and should really use a memory barrier. Use the READ_ONCE/WRITE_ONCE helpers on got_token so we can be sure we're always safe. Signed-off-by: Josef Bacik --- block/blk-rq-qos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 67a0a4c07060..f4aa7b818cf5 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -201,7 +201,7 @@ static int rq_qos_wake_function(struct wait_queue_entry *curr, if (!data->cb(data->rqw, data->private_data)) return -1; - data->got_token = true; + WRITE_ONCE(data->got_token, true); list_del_init(&curr->entry); wake_up_process(data->task); return 1; @@ -246,7 +246,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, prepare_to_wait_exclusive(&rqw->wait, &data.wq, TASK_UNINTERRUPTIBLE); has_sleeper = !wq_has_single_sleeper(&rqw->wait); do { - if (data.got_token) + if (READ_ONCE(data.got_token)) break; if (!has_sleeper && acquire_inflight_cb(rqw, private_data)) { finish_wait(&rqw->wait, &data.wq); @@ -256,7 +256,7 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, * which means we now have two. Put our local token * and wake anyone else potentially waiting for one. */ - if (data.got_token) + if (READ_ONCE(data.got_token)) cleanup_cb(rqw, private_data); break; } From patchwork Mon Jul 15 20:11:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 11044911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC3B36C5 for ; Mon, 15 Jul 2019 20:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAC9C28538 for ; Mon, 15 Jul 2019 20:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5092855A; Mon, 15 Jul 2019 20:11:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8544D28538 for ; Mon, 15 Jul 2019 20:11:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731168AbfGOULg (ORCPT ); Mon, 15 Jul 2019 16:11:36 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34910 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730882AbfGOULf (ORCPT ); Mon, 15 Jul 2019 16:11:35 -0400 Received: by mail-pg1-f193.google.com with SMTP id s1so1931100pgr.2 for ; Mon, 15 Jul 2019 13:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=SJf4C6KejtjXuljRmpFGx9hGgMD/PzbLxtQzdurli00=; b=XEf2gZjuQsH1ka7bXG6EbQb9vscFZbQwJD1e5tErbkF2mj1opSw/jrqlb7VP9Z6vR/ V7hfb+upbv2VoCdZc9VVvKpvPhU2/dtbcOthkuFgQ8/gCcSxUII2LzhngNa2WvCg+i8C qNxWD+U0UvQu3f1I0JXc0+BX4PcWwwAZ0USR6lsF1ZENnCgAqBte8ggCurdQ2jC5YarE XAgafgfG/HQzzFQaM6V9tK3LDKQQ9kTpxNRIG8kg6vdvxcWqCi29LhYcZROsCdhmziut 7iEM8x3u6EBYxhVTkw7zJNJZRV70K3KXbYH7HYKCEFPQdksnKMk9bcTGuN6ImEFrubTd PvXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=SJf4C6KejtjXuljRmpFGx9hGgMD/PzbLxtQzdurli00=; b=DM+mjjvfTKq4j3pZJR//Wu52BK8fggbeX052nhcfsi3SUopezRENV1AtMQgLIGcAm/ 6qGbKEjzF+0q4BIgeyxgx0E5GiHUWgQVcwgQLpw589wW5l7MWr1UShc9Os0aCYvbQHaJ xTfuIT8E7Y5htJlDe713tTpYWV+rwsMJCfPCvxPmVyzHfZuEidG6pIv1B+d13yADQmcj 5BNWEt4zrXxqUIBwv1qNMGkYt1OZMv47ADhXiqh0Cvbe/YpiD9hT0KiyB43x3gmPeQbu A/1bwrNwQZAXZAqP4akrhCGdbVhKsVRHMC4Jhm6xsZQHITxh9rWPCn3+OhxdIjE4zuCR hoSQ== X-Gm-Message-State: APjAAAUDsI0zgfmdKjLcEpUjzCS8FEa/XDhJUMuSRb77SAo67Ep3ZTkF 8RRZSjHHpYqql8hkoRVfDuY= X-Google-Smtp-Source: APXvYqw24vVbSWaGT1XYSVoCsx77tNpMoTKR6cg3dqCR+s4/Mxl6zTKM7kFs3jPH73aua2yoVNXa8g== X-Received: by 2002:a63:f501:: with SMTP id w1mr371963pgh.444.1563221495103; Mon, 15 Jul 2019 13:11:35 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::4caf]) by smtp.gmail.com with ESMTPSA id a3sm20020489pfo.49.2019.07.15.13.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 13:11:34 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com, peterz@infradead.org, oleg@redhat.com Subject: [PATCH 4/4] rq-qos: don't reset has_sleepers on spurious wakeups Date: Mon, 15 Jul 2019 16:11:19 -0400 Message-Id: <20190715201120.72749-5-josef@toxicpanda.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20190715201120.72749-1-josef@toxicpanda.com> References: <20190715201120.72749-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we had multiple sleepers before we don't need to worry about never being woken up. If we're woken up randomly without having gotten our inflight token then we need to go back to sleep, we won't be properly woken up without being given our inflight token anyway so this resetting isn't needed. Signed-off-by: Josef Bacik --- block/blk-rq-qos.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index f4aa7b818cf5..35bc6f54d088 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -261,7 +261,6 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, break; } io_schedule(); - has_sleeper = false; } while (1); finish_wait(&rqw->wait, &data.wq); }