From patchwork Sat Aug 4 00:03:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10555561 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 DDCBC157D for ; Sat, 4 Aug 2018 00:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D092C2C913 for ; Sat, 4 Aug 2018 00:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4DA62C91D; Sat, 4 Aug 2018 00:03: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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 12E922C9CD for ; Sat, 4 Aug 2018 00:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732073AbeHDCB4 (ORCPT ); Fri, 3 Aug 2018 22:01:56 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:34551 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731959AbeHDCB4 (ORCPT ); Fri, 3 Aug 2018 22:01:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1533341008; x=1564877008; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=CMm+QZdcd7NFpQmX8hg665eQvS4gE7t3ks7clca/ey8=; b=Xyob/EORuCTkf4zP/ZanjnUXtwaRLSuzalqbUJnjhfope7vT0sSv87h3 bFoeqHhiel9Ky4KnZKqifuH8HRh5XKDsPFlTth4jpa87/z4SLM7QVpGqo jggumG42WSIGjHaTVKAMGtPeJUBRD3s+XC+JWHYwfzz29C53I8Ba2Kvic ysuN5zJRe7zoMZB62uZugZlZcXc21Y/x8J21Tl9PMJhZ0UDSCBGlkfRdr +Ns7k9Kckc4egLYjX3OqXnz8AIaePNR8DA5z1ohVF3nYazggBUmOoyhsV 12gcTfHAGsM9Zg3Z3IHJKO6Vn8ci5C0KERRqx/+B05y9XvGAtNSVh8FhL g==; X-IronPort-AV: E=Sophos;i="5.51,440,1526313600"; d="scan'208";a="90059258" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Aug 2018 08:03:27 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 03 Aug 2018 16:51:11 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 03 Aug 2018 17:03:25 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , "David S . Miller" , Jianchao Wang , Ming Lei , Alan Stern , Johannes Thumshirn Subject: [PATCH v4 03/10] block, ide: Remove flag BLK_MQ_REQ_PREEMPT Date: Fri, 3 Aug 2018 17:03:18 -0700 Message-Id: <20180804000325.3610-4-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180804000325.3610-1-bart.vanassche@wdc.com> References: <20180804000325.3610-1-bart.vanassche@wdc.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 Since it is no longer necessary that blk_get_request() knowns whether or not RQF_PREEMPT will be set, remove flag BLK_MQ_REQ_PREEMPT. This patch does not change any functionality. See also 039c635f4e66 ("ide, scsi: Tell the block layer at request allocation time about preempt requests"). Signed-off-by: Bart Van Assche Cc: David S. Miller Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Alan Stern Cc: Johannes Thumshirn --- block/blk-core.c | 9 +++------ block/blk-mq.c | 2 -- drivers/ide/ide-pm.c | 3 ++- include/linux/blk-mq.h | 4 +--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 3378fe478e67..3a5aa56eab9d 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -908,7 +908,7 @@ EXPORT_SYMBOL(blk_alloc_queue); /** * blk_queue_enter() - try to increase q->q_usage_counter * @q: request queue pointer - * @flags: BLK_MQ_REQ_NOWAIT, BLK_MQ_REQ_PREEMPT and/or BLK_MQ_REQ_PM + * @flags: BLK_MQ_REQ_NOWAIT and/or BLK_MQ_REQ_PM */ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) { @@ -1431,8 +1431,6 @@ static struct request *__get_request(struct request_list *rl, unsigned int op, blk_rq_set_rl(rq, rl); rq->cmd_flags = op; rq->rq_flags = rq_flags; - if (flags & BLK_MQ_REQ_PREEMPT) - rq->rq_flags |= RQF_PREEMPT; /* init elvpriv */ if (rq_flags & RQF_ELVPRIV) { @@ -1570,7 +1568,7 @@ static struct request *get_request(struct request_queue *q, unsigned int op, goto retry; } -/* flags: BLK_MQ_REQ_PREEMPT, BLK_MQ_REQ_PM and/or BLK_MQ_REQ_NOWAIT. */ +/* flags: BLK_MQ_REQ_PM and/or BLK_MQ_REQ_NOWAIT. */ static struct request *blk_old_get_request(struct request_queue *q, unsigned int op, blk_mq_req_flags_t flags) { @@ -1613,8 +1611,7 @@ struct request *blk_get_request(struct request_queue *q, unsigned int op, struct request *req; WARN_ON_ONCE(op & REQ_NOWAIT); - WARN_ON_ONCE(flags & ~(BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_PREEMPT | - BLK_MQ_REQ_PM)); + WARN_ON_ONCE(flags & ~(BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_PM)); if (q->mq_ops) { req = blk_mq_alloc_request(q, op, flags); diff --git a/block/blk-mq.c b/block/blk-mq.c index c92ce06fd565..8b23ae34d949 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -300,8 +300,6 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, rq->rq_flags = rq_flags; rq->cpu = -1; rq->cmd_flags = op; - if (data->flags & BLK_MQ_REQ_PREEMPT) - rq->rq_flags |= RQF_PREEMPT; if (blk_queue_io_stat(data->q)) rq->rq_flags |= RQF_IO_STAT; INIT_LIST_HEAD(&rq->queuelist); diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index 59217aa1d1fb..10d10e01c0f4 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c @@ -90,8 +90,9 @@ int generic_ide_resume(struct device *dev) } memset(&rqpm, 0, sizeof(rqpm)); - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PREEMPT); + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); ide_req(rq)->type = ATA_PRIV_PM_RESUME; + rq->rq_flags |= RQF_PREEMPT; rq->special = &rqpm; rqpm.pm_step = IDE_PM_START_RESUME; rqpm.pm_state = PM_EVENT_ON; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index f15c1de51f5e..59f99b0019bb 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -221,10 +221,8 @@ enum { BLK_MQ_REQ_RESERVED = (__force blk_mq_req_flags_t)(1 << 1), /* allocate internal/sched tag */ BLK_MQ_REQ_INTERNAL = (__force blk_mq_req_flags_t)(1 << 2), - /* set RQF_PREEMPT */ - BLK_MQ_REQ_PREEMPT = (__force blk_mq_req_flags_t)(1 << 3), /* for power management requests */ - BLK_MQ_REQ_PM = (__force blk_mq_req_flags_t)(1 << 4), + BLK_MQ_REQ_PM = (__force blk_mq_req_flags_t)(1 << 3), }; struct request *blk_mq_alloc_request(struct request_queue *q, unsigned int op,