From patchwork Wed Apr 5 19:01:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9665481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD285602B5 for ; Wed, 5 Apr 2017 19:02:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A408285A3 for ; Wed, 5 Apr 2017 19:02:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DC0C2856A; Wed, 5 Apr 2017 19:02:58 +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=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 480482856A for ; Wed, 5 Apr 2017 19:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756065AbdDETC5 (ORCPT ); Wed, 5 Apr 2017 15:02:57 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:36431 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756060AbdDETC4 (ORCPT ); Wed, 5 Apr 2017 15:02:56 -0400 Received: by mail-pg0-f42.google.com with SMTP id g2so12790232pge.3 for ; Wed, 05 Apr 2017 12:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ZKVgCI2rDBgkZOr2WSn61KOjNwivuSspDnOy+yscdng=; b=iGGByoF2iJg8HE7dbTZ+sPa/c73DokkbG4qIvXw3zgElTdOba4Uk0YwI1kfd6xbRjK 8B4BlqXJ9Ek3p9HiJ26ipimpLQ4BNnxQEvNxbJnfbbdV6o07Hvb4slTr+FYcS20r+lCg xJq/Ob0qdkdF5p8T0C4UGOh2cWNCFya6aF+PUipzbBDP4sgW9pPAC0wlI92UYk4M7Ozi 18ZpHK7XSJ2pFp3Oak/yBu7XD8U4T8brxDte6slbzZ6f/BwN3rNtAwg8onmd7GzXFak7 QdVU9dVrl1lFAOn2pMq9LzBs/aGZtbd2BQiyN5K5r95P/opqzxJTFOvLHKCj30B+MhOG OxQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ZKVgCI2rDBgkZOr2WSn61KOjNwivuSspDnOy+yscdng=; b=W23bUkZ7Yic19qB9njRHutxjQwcfscEweY3thwBgLldc9T7c6tTJQHcwZG0iktrqRT Ed4231VrCOVavQ9pJ8g3Rtu1rirOoOtq35X0yKzwv7q+V+BdPuARniy7hOefofsNIrTs i33ntyq7CoQundHKhvagxPTw+PhPVmkHeqJbZdxsqGmHZuyqVBv2mrHakMOq0CBDHZw9 d4qm77KSGWucqG6a30l2hii5PekLz2xwhgaFwtw8GhYxRNif9ytaTMyymj53EzaAed+S RGgFRRk/2zwP4qrlLJRElZPJhp8m8vLM8rAE7F8EHqKEDEi3TDhBRxV8daVTnNKlzbto 2GkA== X-Gm-Message-State: AFeK/H2l+7KYNQskrDRTftPgPaUBYFVtjUSY4S/x9VGOdmIOCKgB4o0QhWFOQmNHmk//1ZEZ X-Received: by 10.99.56.88 with SMTP id h24mr31509322pgn.108.1491418975739; Wed, 05 Apr 2017 12:02:55 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::a:a8dd]) by smtp.gmail.com with ESMTPSA id 4sm5610375pff.17.2017.04.05.12.02.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 12:02:55 -0700 (PDT) From: Omar Sandoval To: Jens Axboe , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH v3 7/8] blk-mq: make driver tag failure path easier to follow Date: Wed, 5 Apr 2017 12:01:35 -0700 Message-Id: <41f30269ef99fc7825e6a4ddc41bf0b642e5de98.1491418411.git.osandov@fb.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: References: In-Reply-To: References: 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 From: Omar Sandoval Minor cleanup that makes it easier to figure out what's going on in the driver tag allocation failure path of blk_mq_dispatch_rq_list(). Signed-off-by: Omar Sandoval --- block/blk-mq.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 39e9af3498ac..de57e7727c52 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1003,17 +1003,16 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list) * The initial allocation attempt failed, so we need to * rerun the hardware queue when a tag is freed. */ - if (blk_mq_dispatch_wait_add(hctx)) { - /* - * It's possible that a tag was freed in the - * window between the allocation failure and - * adding the hardware queue to the wait queue. - */ - if (!blk_mq_get_driver_tag(rq, &hctx, false)) - break; - } else { + if (!blk_mq_dispatch_wait_add(hctx)) + break; + + /* + * It's possible that a tag was freed in the window + * between the allocation failure and adding the + * hardware queue to the wait queue. + */ + if (!blk_mq_get_driver_tag(rq, &hctx, false)) break; - } } list_del_init(&rq->queuelist);