From patchwork Tue Dec 12 19:01:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 10108167 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 B7700602C2 for ; Tue, 12 Dec 2017 19:02:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB70627BA5 for ; Tue, 12 Dec 2017 19:02:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A013D29105; Tue, 12 Dec 2017 19:02:00 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1761527BA5 for ; Tue, 12 Dec 2017 19:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752563AbdLLTB6 (ORCPT ); Tue, 12 Dec 2017 14:01:58 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37754 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752579AbdLLTBz (ORCPT ); Tue, 12 Dec 2017 14:01:55 -0500 Received: by mail-qt0-f194.google.com with SMTP id f2so49951500qtj.4; Tue, 12 Dec 2017 11:01:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8xiX6jYU7CKWze4lGJ0lF7NoM48CuaqyqX7mgiiweo0=; b=EmINPXt26eCLWUtRV+R8R6taDvgGioH20U1xnfJ6ve9BdA+VlwCLUM2G6ui1Aw0mMy X7sC+zEXHz3jGn6EE9H3SQYCm2CDueLnk2iJka8D77d5x421Wt8AaKce+Wqc+JynDUSn BnQkX84OBzOBeHH29//DwydxWeEUxeknzPROaQhdYpSjL6gsbaos76RQymSx6SccKtB5 fahxRYEuoMpmEMUUiJz77/rjZkhqCdaZQOf23FoNMf0VzQWP/ar4QOme/muRMC3g2iKA TtGiQvWi7wJ/IWfuj6dxsclQyaVleGc7nNItWGBVuq4ijrLtjppxeqCEMiRna3K7V5YA OlUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8xiX6jYU7CKWze4lGJ0lF7NoM48CuaqyqX7mgiiweo0=; b=FzCEJ5UflscAUbB+9PNecWA0UnT7jSi2sWbzo3kaGPzjzavDUaryLeVWjqaPyKkEiG 2I35oh24nQTzIDJI1f0Uo4eJNQx9gNTG7YOpu1iDx1GgDrovJq2QEeVRHKxpoVwMIU2O 1fuvNqyZJTTKfGCJgOljZ6l1wActmdAQxHJm6dT2iX0T9rfDKA8Kb4Ix2PBHZcGFtKRi faHm0wiMD3WTnv2vd8uCwzF2YM6zvhCAT5AOOhWgWdkMckIKW7HukwYIhSIZWr+metaC V3VVh+cWwSqAto4VRmBQqSgiPePBtOpmJrSAoT3yXRNDqYSeUPjqrCUUlkwZfj8ZNZrg mqrw== X-Gm-Message-State: AKGB3mJCcSR4NraVPsc96dQSfXQ4zTVRwu/jObCJlWENCde2GoRiGYyN IIeGS9/RAPhIE8E1XsDVbDs= X-Google-Smtp-Source: ACJfBouV9k7xZ9lt/v2GtBZczfIz/kI5KsYWxHu3A11m9G67Ldb2UkYPwJ0LKlmm7CdSNfxCEXnv3w== X-Received: by 10.55.115.193 with SMTP id o184mr6349237qkc.171.1513105313385; Tue, 12 Dec 2017 11:01:53 -0800 (PST) Received: from localhost (dhcp-ec-8-6b-ed-7a-cf.cpe.echoes.net. [72.28.5.223]) by smtp.gmail.com with ESMTPSA id r53sm6446650qtr.93.2017.12.12.11.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 11:01:52 -0800 (PST) From: Tejun Heo To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, oleg@redhat.com, peterz@infradead.org, kernel-team@fb.com, osandov@fb.com, linux-block@vger.kernel.org, hch@lst.de, Tejun Heo Subject: [PATCH 4/6] blk-mq: make blk_abort_request() trigger timeout path Date: Tue, 12 Dec 2017 11:01:32 -0800 Message-Id: <20171212190134.535941-5-tj@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171212190134.535941-1-tj@kernel.org> References: <20171212190134.535941-1-tj@kernel.org> 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 With issue/complete and timeout paths now using the generation number and state based synchronization, blk_abort_request() is the only one which depends on REQ_ATOM_COMPLETE for arbitrating completion. There's no reason for blk_abort_request() to be a completely separate path. This patch makes blk_abort_request() piggyback on the timeout path instead of trying to terminate the request directly. This removes the last dependency on REQ_ATOM_COMPLETE in blk-mq. Signed-off-by: Tejun Heo --- block/blk-mq.c | 2 +- block/blk-mq.h | 2 -- block/blk-timeout.c | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 3a08d7a..73d6444 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -785,7 +785,7 @@ struct blk_mq_timeout_data { unsigned int nr_expired; }; -void blk_mq_rq_timed_out(struct request *req, bool reserved) +static void blk_mq_rq_timed_out(struct request *req, bool reserved) { const struct blk_mq_ops *ops = req->q->mq_ops; enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER; diff --git a/block/blk-mq.h b/block/blk-mq.h index 154b2fa..1fa83fa 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -94,8 +94,6 @@ extern int blk_mq_sysfs_register(struct request_queue *q); extern void blk_mq_sysfs_unregister(struct request_queue *q); extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx); -extern void blk_mq_rq_timed_out(struct request *req, bool reserved); - void blk_mq_release(struct request_queue *q); /** diff --git a/block/blk-timeout.c b/block/blk-timeout.c index 6427be7..051924f 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -156,12 +156,13 @@ void blk_timeout_work(struct work_struct *work) */ void blk_abort_request(struct request *req) { - if (blk_mark_rq_complete(req)) - return; if (req->q->mq_ops) { - blk_mq_rq_timed_out(req, false); + req->deadline = jiffies; + mod_timer(&req->q->timeout, 0); } else { + if (blk_mark_rq_complete(req)) + return; blk_delete_timer(req); blk_rq_timed_out(req); }