Received: by 10.223.185.116 with SMTP id b49csp5449313wrg; Wed, 7 Mar 2018 11:58:42 -0800 (PST) X-Google-Smtp-Source: AG47ELuQEBIQkLq3fIk0Ym8u+/p4s4hFPrB8bljbYuURQQtGDJkGslZe7YeYMoDpCmgDed/MDMIy X-Received: by 2002:a17:902:8c93:: with SMTP id t19-v6mr21409615plo.304.1520452721980; Wed, 07 Mar 2018 11:58:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520452721; cv=none; d=google.com; s=arc-20160816; b=nC/4essTglTGHbVwoLY2dyzL3RbjiWbdFgGCmc/0GIb4+Xi4hGkXwx98JOzAp4PtH2 aF2zOkJ4zLE+nYGp2eJssFrhX8Yq/FmT+gS6WcLYGG979XuMzv+dG9YGldxJDAsD8gJz 0dG4EpFfJJIJwSGoKXVlWrf/g7HWly3ZQNAXBEekr0PhYpzKV0r4SjjksUfcZ5M85OhX 1zD5+YhGK8lXLZHr6ymoHDp1s8fVaNXbWJMVLR8m8uvesP0+9rCKi0Q7KogvtOzyJXbs DoBGqzcMLvGYjEQ1Rq7/SDKY8Y+jPTRtKf/B8yCX+UjBVrtwwimxQnj+Mc7nIoe+EMUh 1cWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YC0etEWx2NdhYV667cBc0vvaJWLIOKK5Oo1F7azyYfE=; b=xJNxKlX394asjMaovK6+GE4IWA1pmAWCUWhQOLbcXufyqjvzLm3anwFfVVHXm7R6+N inpADaznSIJab8cN8KRWmE1NpOD55UeX1i+21KFKruPzZAX9Y4ddgWGR+dqmVrlEOeE5 z+BeINEbRCPEDy7WX5iTvWmUFoO54QQOYCYQUO0D1EDEygHHuuIaOEAXO7k8SiZhqB/T mhXflkeors+Ar7k2KA6H8JpbGCWVfhD4r5EZp+5LL8XyIFpDcl9Aza2dE2+zx+w7SyVT 0LN7NLpP4ueDwBByJa6uvLmjraWND81SUj3qduxtWwY5aS/Cy6c+N+QTn0f4vdVO3GaT yung== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u188si14371718pfb.220.2018.03.07.11.58.09; Wed, 07 Mar 2018 11:58:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965345AbeCGT5U (ORCPT + 99 others); Wed, 7 Mar 2018 14:57:20 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44962 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965716AbeCGTrV (ORCPT ); Wed, 7 Mar 2018 14:47:21 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 993B110E8; Wed, 7 Mar 2018 19:47:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Valente , Omar Sandoval , Bart Van Assche , Ming Lei , Jens Axboe Subject: [PATCH 4.14 083/110] blk-mq: dont call io scheds .requeue_request when requeueing rq to ->dispatch Date: Wed, 7 Mar 2018 11:39:06 -0800 Message-Id: <20180307191050.465606623@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Lei commit 105976f517791aed3b11f8f53b308a2069d42055 upstream. __blk_mq_requeue_request() covers two cases: - one is that the requeued request is added to hctx->dispatch, such as blk_mq_dispatch_rq_list() - another case is that the request is requeued to io scheduler, such as blk_mq_requeue_request(). We should call io sched's .requeue_request callback only for the 2nd case. Cc: Paolo Valente Cc: Omar Sandoval Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers") Cc: stable@vger.kernel.org Reviewed-by: Bart Van Assche Acked-by: Paolo Valente Signed-off-by: Ming Lei Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-mq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -638,7 +638,6 @@ static void __blk_mq_requeue_request(str trace_block_rq_requeue(q, rq); wbt_requeue(q->rq_wb, &rq->issue_stat); - blk_mq_sched_requeue_request(rq); if (test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) { if (q->dma_drain_size && blk_rq_bytes(rq)) @@ -650,6 +649,9 @@ void blk_mq_requeue_request(struct reque { __blk_mq_requeue_request(rq); + /* this request will be re-inserted to io scheduler queue */ + blk_mq_sched_requeue_request(rq); + BUG_ON(blk_queued_rq(rq)); blk_mq_add_to_requeue_list(rq, true, kick_requeue_list); }