From patchwork Wed May 16 03:43:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: huhai X-Patchwork-Id: 10402487 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 94A65601D4 for ; Wed, 16 May 2018 03:43:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 841C528720 for ; Wed, 16 May 2018 03:43:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7754828732; Wed, 16 May 2018 03:43:34 +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.9 required=2.0 tests=BAYES_00, FROM_EXCESS_BASE64, MAILING_LIST_MULTI, MIME_BASE64_BLANKS, MSGID_FROM_MTA_HEADER, 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 E9D9728720 for ; Wed, 16 May 2018 03:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022AbeEPDnd (ORCPT ); Tue, 15 May 2018 23:43:33 -0400 Received: from smtpbgeu1.qq.com ([52.59.177.22]:40789 "EHLO smtpbgeu1.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbeEPDnd (ORCPT ); Tue, 15 May 2018 23:43:33 -0400 X-Greylist: delayed 2797 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 May 2018 23:43:32 EDT X-QQ-GoodBg: 2 X-QQ-SSF: 00400000000000F0 X-QQ-FEAT: 3GtnPQ8BMmafByLlOW6R7KnvxDtv/B5JQdg3M1+mAp9spv1T0arQZChMtcf/1 S4Nw8Gy5cwp0/9hz8QN4SDy9BQti21B6EqOX5U7hC+vU+5cFDc+HXDazR5cadtG3EFgky1i LKbFSt5uEdJlu86JQ2Y/3OsHQIdXw8ewJH+mcPJRuRaF+sY9Po86T+yKL+8Ln6vOAZ1h4G5 liYid9SZ0ofQOwhjkyYLHaadEbXhAv36gLn902XhCrq3lj2/l14V1FJTz65bILAjQdadMoF TnCaIcMSrv/Vu/OIhe/e2HLcQ= X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 218.76.220.175 X-QQ-STYLE: X-QQ-mid: bizmailvip39t1526442206t43461 From: "=?utf-8?B?6IOh5rW3?=" To: "=?utf-8?B?YXhib2U=?=" Cc: "=?utf-8?B?bGludXgtYmxvY2s=?=" , "=?utf-8?B?aGNo?=" Subject: blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly Mime-Version: 1.0 Date: Wed, 16 May 2018 11:43:26 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x X-QQ-SENDSIZE: 520 Received: from qq.com (unknown [127.0.0.1]) by smtp.qq.com (ESMTP) with SMTP id ; Wed, 16 May 2018 11:43:27 +0800 (CST) Feedback-ID: bizmailvip:kylinos.cn:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 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 Author: huhai Date: Wed May 16 10:34:22 2018 +0800 blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly For sq make_request instances, we should issue sync request directly too, otherwise it will break down the semantics of sync request, the current code logic is to send synchronous requests asynchronously. Signed-off-by: huhai diff --git a/block/blk-mq.c b/block/blk-mq.c index 5629f18..fcf2f16 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1771,7 +1771,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_try_issue_directly(data.hctx, same_queue_rq, &cookie); } - } else if (q->nr_hw_queues > 1 && is_sync) { + } else if (is_sync) { blk_mq_put_ctx(data.ctx); blk_mq_bio_to_request(rq, bio); blk_mq_try_issue_directly(data.hctx, rq, &cookie);