Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10143797imu; Wed, 5 Dec 2018 17:13:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WsldO5b20voxTSDr1n/9RKqWa6kk4z1O4osB1okGuwcauW/4SO1KDeJ+r3jqriFDCFQ/L3 X-Received: by 2002:a63:fb10:: with SMTP id o16mr22328527pgh.211.1544058833183; Wed, 05 Dec 2018 17:13:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544058833; cv=none; d=google.com; s=arc-20160816; b=zvZROZ+qyriryteRKnBEYfot/tlYHLF6kmvXLeeMsSojsgabd51OD3s4i0q9wsjhL6 9MaanwwJeZFx+r+Dyo4bw/0066mv19MgKcnhE6EaG2iIQtFTivtglmxjnIM9XiEO66B0 NpuoDacWSphK892KT/jz+w0J3p0Cri+985WtI8sOF3KgIVOsHSwsFiXLQKFv+eojMdLk Pts6Y8Jpr6pSfcJjQsKDNKeKjdy8hmFGEhpZw8Us4bqnYSUA4CAHDVuMdniCjJ0QmmBS xf2KnXg8plyieVVQ3p0jhqhCRBio4MdnJPBK/HdEkS7xa9rXSdqLr9JZAgevipyFhf6v CyXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=VZkgXeIEZ3W6cCdhF/Is7OQcrhENZCkkmF7DPwBBxMA=; b=jG/a3qrp0xcsNlaj4gNc75XVj2sQWGMIR9INcP6cYczvQIhvtMtfxRfyHjwqmWt0z+ SggzXsRnD1mAUdRewKl3De2bx0lSFkRVyXI8u5T9RfPizOEiND/rb+8nm2BuDMP4xdAd vZ3uz0uPQdskHPcErVsVTt/JTckYQ/419FTgqAfG9f7/rwu0jr4ZkZrYudqv5Nmbj9uc uwow4T5GQOjQCf2E3KsPltQdNwMg1F7uJvzFulNGoSuC2gKHAMHfOb8PpErIDpPVo/aE lHmdw9hhbuBrznZcf0J28rmvWh8pVo0+z/WwH25A4NQP5HQh5a6fAcjb1dMoYIoL8S0B zWrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=C31YpJ5Z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si18111576pgk.27.2018.12.05.17.13.38; Wed, 05 Dec 2018 17:13:53 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=C31YpJ5Z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbeLFBL6 (ORCPT + 99 others); Wed, 5 Dec 2018 20:11:58 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:47256 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbeLFBL6 (ORCPT ); Wed, 5 Dec 2018 20:11:58 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB619Pur001212; Thu, 6 Dec 2018 01:11:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=VZkgXeIEZ3W6cCdhF/Is7OQcrhENZCkkmF7DPwBBxMA=; b=C31YpJ5Zpepp+vNFioW4Xc4BS+hZvsK7l7N94B1rfjRM9XAH5XfhQMfm7LdUMDyZ6xMQ R1/jMgTL3bh9eu1Cegq263dAWyZPr7zOmW20DLn28vstpIy9/JG9uX0xQk3bFaINkC5r t41NU71fFhtHc/Nhh1DtDmeZ4+zVu6cCqF4NEijwE0WwGXG36P/mTCsVrpiNXBVj7GNT MyTX2El4B6Y/0ODmAxkIdZa/TagG9Z/knVM8ncHqiJcsmEAy3ZLawRMytnoDooFjUOHJ FD6CvTBYeFNpwy4XYjlM6Ps7VBImh3qLCLDX/yMBUsz7dLJi37Q9ngr/nUjTWL9Szra7 Kw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2p3ftf9kgr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Dec 2018 01:11:54 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB61BrxD007589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Dec 2018 01:11:53 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wB61Bq2l021192; Thu, 6 Dec 2018 01:11:53 GMT Received: from [10.182.71.8] (/10.182.71.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Dec 2018 17:11:52 -0800 Subject: Re: [PATCH V9 2/4] blk-mq: refactor the code of issue request directly To: Jens Axboe Cc: ming.lei@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1543995842-20704-1-git-send-email-jianchao.w.wang@oracle.com> <1543995842-20704-3-git-send-email-jianchao.w.wang@oracle.com> From: "jianchao.wang" Message-ID: Date: Thu, 6 Dec 2018 09:12:33 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9098 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812060007 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/18 12:27 AM, Jens Axboe wrote: > On 12/5/18 12:44 AM, Jianchao Wang wrote: >> Merge blk_mq_try_issue_directly and __blk_mq_try_issue_directly >> into one interface to unify the interfaces to issue requests >> directly. The merged interface takes over the requests totally, >> it could insert, end or do nothing based on the return value of >> .queue_rq and 'bypass' parameter. Then caller needn't any other >> handling any more and then code could be cleaned up. >> >> Signed-off-by: Jianchao Wang >> --- >> block/blk-mq.c | 116 +++++++++++++++++++++++++++------------------------------ >> 1 file changed, 54 insertions(+), 62 deletions(-) >> >> diff --git a/block/blk-mq.c b/block/blk-mq.c >> index 153af90..fe92e52 100644 >> --- a/block/blk-mq.c >> +++ b/block/blk-mq.c >> @@ -1815,93 +1815,85 @@ static bool blk_rq_can_direct_dispatch(struct request *rq) >> return req_op(rq) == REQ_OP_READ || req_op(rq) == REQ_OP_WRITE; >> } >> >> -static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, >> +static blk_status_t blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, >> struct request *rq, >> blk_qc_t *cookie, >> - bool bypass_insert, bool last) >> + bool bypass, bool last) >> { >> struct request_queue *q = rq->q; >> bool run_queue = true; >> + blk_status_t ret = BLK_STS_RESOURCE; >> + int srcu_idx; >> bool force = false; >> >> + if (!blk_rq_can_direct_dispatch(rq)) { >> + /* >> + * Insert request to hctx dispatch list for 'bypass == true' >> + * case, otherwise, the caller will fail forever. >> + */ >> + if (bypass) >> + force = true; >> + goto out; >> + } > > Same here, of course. Yes, I will change it next version. > > Otherwise looks fine. > Thanks Jianchao