From patchwork Wed Apr 5 18:28:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9665401 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 1C42460353 for ; Wed, 5 Apr 2017 18:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 143B527F94 for ; Wed, 5 Apr 2017 18:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09227285A4; Wed, 5 Apr 2017 18:29: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=-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 B86B227F94 for ; Wed, 5 Apr 2017 18:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932888AbdDES3a (ORCPT ); Wed, 5 Apr 2017 14:29:30 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:33954 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933625AbdDES32 (ORCPT ); Wed, 5 Apr 2017 14:29:28 -0400 Received: by mail-pg0-f54.google.com with SMTP id 21so12201104pgg.1 for ; Wed, 05 Apr 2017 11:29:28 -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=b1NwVFxTTg5QBXL/wcDG/JHzGfXtwqxX0sxh5bJnpO4=; b=Bc89g/tXjEcEidNSGrbam1ecz3nyGzmK5Kgj9X0LhCLbHr5DXhljxSP1PFBouiaXRb xQx7S6f5ffBo1p0AkYmTh7RPP9e11PwGUT/68MdJjV0q/+FDUSkKLjGI9zyTDul0Na1g ayh+x/8LBEN8PSAzxfwbIpsl7Gg0rJGvAIxK6MWL2g3jlSXibePhyCNRABct7GDv5XUs a/kSFe77umBGfYIIHVje2jyqLzfCFhGHmH0LAYKi2BnrLfrJgM3jkJ/XaYLLRc9psg5v S4w/WCsrr54OLkJEdmn8whkd18KORlDQsXBrOS/dRrJTQTHbMIJ+QWCUkmlU7grkPoma M6xw== 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=b1NwVFxTTg5QBXL/wcDG/JHzGfXtwqxX0sxh5bJnpO4=; b=LCtze6VL/Fqe3RSgCgje5e5q2P4kir0YI7aISqRlK4zOqVpNJGlKJNjd13bva81gUN 4RC0TTndJ5CK2uJkGl5fg/DSzSHcAq+G7zCiG4U3wnp3Aq8bN9UbbpLrWBFFYGaJYaJ8 A9mi7pBIzBMP3JHgTw0oUQzjenHwr2qmrRFxBN1cb7zwqvLHDhmPzClF4mfmBvKFigFG 6ibIumX9d98bpKPSpuRNdL8vcNvmSaHhEQPuXuS3x7r95tOnypntlQ30GSbEkxBewPZP lq6iZhJG9+/oINow3+Qlnk0yP44fblnTcfrUAwVLEGZwkcNkbdyBLxAF3RC4elLA/rei /UDA== X-Gm-Message-State: AFeK/H2wZtpwYe3/6bwNq8aJ2ZeAs2pk4yZLUeEXGFukOpPIJXg+uvOkyCfF+yWSJiFiQXC4 X-Received: by 10.84.248.72 with SMTP id e8mr37867185pln.133.1491416967993; Wed, 05 Apr 2017 11:29:27 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::a:a8dd]) by smtp.gmail.com with ESMTPSA id x10sm38801490pff.72.2017.04.05.11.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 11:29:27 -0700 (PDT) From: Omar Sandoval To: Jens Axboe , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH v2 7/8] blk-mq: make driver tag failure path easier to follow Date: Wed, 5 Apr 2017 11:28:19 -0700 Message-Id: <252ae705a3bf4426a1de451a031033c635f2d56a.1491416593.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 4aa3148befe1..71dc8608f3a8 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1011,17 +1011,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);