From patchwork Thu Oct 25 21:10:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10656583 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 72F1414DE for ; Thu, 25 Oct 2018 21:11:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67EF02C648 for ; Thu, 25 Oct 2018 21:11:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C06E2C652; Thu, 25 Oct 2018 21:11:41 +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 046582C648 for ; Thu, 25 Oct 2018 21:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727596AbeJZFp6 (ORCPT ); Fri, 26 Oct 2018 01:45:58 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:51873 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbeJZFp6 (ORCPT ); Fri, 26 Oct 2018 01:45:58 -0400 Received: by mail-it1-f195.google.com with SMTP id 74-v6so3354099itw.1 for ; Thu, 25 Oct 2018 14:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/vYx+4HwhlHgM56nJ1gOfckQ6BdZmCnlgV89L5QOSZk=; b=rEz8XVgieiGpw3IYEA0CehycP/AzMMVXy1jAobXa3/HY8ymPDTMR7p+Abwvbju8fDn EW0oW+h2iShvThsqmbmtoDA/+TvhdaQB0xWI8Edm3k81suL28K5BkzRYiy9vQ13Z0Qi7 r/iiK3SrjZoBAdtf6HtHb1mo7eSFANsWyUr2phGAQlnmqjwRgju8BZrh9/fPNjyTwmLK Tfb/xptMSiBfYA9Yg4O2MYaypKrvLyzKSORQZqZsgOgGtQlE4qKZbh2KdAemrKYvkLOO Lyr1vEmqdfpIBRLk/zSmF2sYk+pfzrYqSzQEw8tV+QQTxdiwjm9r4J6qY5vMSBA31t6M WB9g== 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; bh=/vYx+4HwhlHgM56nJ1gOfckQ6BdZmCnlgV89L5QOSZk=; b=lG7O8dbkv3Wpr1PipyO3/V5ZsoTSFt4DbRIJvlsD74RvRNSL5zukLkji4lNf3LwqeB HgET93y6JMpNLARFpze4SLeTA7D+iClY5DZiGC+ExNPuwenDmWvXEUiSK/5a0uh2lHJ9 d5CaRdHg59vXDhyxtYOxozEHbyALEQv6I6qKsjMDADexkY5B7c48277ULt/Yfe32Yv32 NEcDPIHXV03c3G0IPvnL3BHffdRyflU92Nl8wP/3a5jQeinRl1Uab3WxRVR5hb1oEY6n OzRUVGIrs50lpp5W+0X7s74TkV9fr45JVZXnvBrF+3LQrZBubhYXgGMcXUDXfYmWecVf KL8A== X-Gm-Message-State: AGRZ1gJGWp/m4thDTBV/EY2APJY9wB5D2i7L6SIHt4iO2JVF1UEea1bS jmx+z3OKPVwKeElwbra4z6ewBA== X-Google-Smtp-Source: AJdET5cxk7yixWX5Jn5egqV0Mc1VxFF9PNU1ZwN22nACW0QAhMXu4NY5aruEO7eMDO1jg07FRRMptg== X-Received: by 2002:a02:590:: with SMTP id 16-v6mr698485jal.70.1540501899330; Thu, 25 Oct 2018 14:11:39 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id e65-v6sm3446375ioa.76.2018.10.25.14.11.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 14:11:38 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 26/28] block: remove req_no_special_merge() from merging code Date: Thu, 25 Oct 2018 15:10:37 -0600 Message-Id: <20181025211039.11559-27-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025211039.11559-1-axboe@kernel.dk> References: <20181025211039.11559-1-axboe@kernel.dk> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It'll always be false at this point, just remove it. Signed-off-by: Jens Axboe Reviewed-by: Hannes Reinecke --- block/blk-merge.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 7fedc0391610..3561dcce2260 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -595,17 +595,6 @@ int ll_front_merge_fn(struct request_queue *q, struct request *req, return ll_new_hw_segment(q, req, bio); } -/* - * blk-mq uses req->special to carry normal driver per-request payload, it - * does not indicate a prepared command that we cannot merge with. - */ -static bool req_no_special_merge(struct request *req) -{ - struct request_queue *q = req->q; - - return !q->mq_ops && req->special; -} - static bool req_attempt_discard_merge(struct request_queue *q, struct request *req, struct request *next) { @@ -631,13 +620,6 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req, unsigned int seg_size = req->biotail->bi_seg_back_size + next->bio->bi_seg_front_size; - /* - * First check if the either of the requests are re-queued - * requests. Can't merge them if they are. - */ - if (req_no_special_merge(req) || req_no_special_merge(next)) - return 0; - if (req_gap_back_merge(req, next->bio)) return 0; @@ -738,8 +720,7 @@ static struct request *attempt_merge(struct request_queue *q, return NULL; if (rq_data_dir(req) != rq_data_dir(next) - || req->rq_disk != next->rq_disk - || req_no_special_merge(next)) + || req->rq_disk != next->rq_disk) return NULL; if (req_op(req) == REQ_OP_WRITE_SAME && @@ -858,8 +839,8 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) if (bio_data_dir(bio) != rq_data_dir(rq)) return false; - /* must be same device and not a special request */ - if (rq->rq_disk != bio->bi_disk || req_no_special_merge(rq)) + /* must be same device */ + if (rq->rq_disk != bio->bi_disk) return false; /* only merge integrity protected bio into ditto rq */