Message ID | 1518536892-2051-1-git-send-email-nj.shetty@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-block-owner@kernel.org> 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 18064601C2 for <patchwork-linux-block@patchwork.kernel.org>; Tue, 13 Feb 2018 15:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0870E28DBA for <patchwork-linux-block@patchwork.kernel.org>; Tue, 13 Feb 2018 15:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F12E328DF9; Tue, 13 Feb 2018 15:47:57 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 5D43B28DBA for <patchwork-linux-block@patchwork.kernel.org>; Tue, 13 Feb 2018 15:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933789AbeBMPr4 (ORCPT <rfc822;patchwork-linux-block@patchwork.kernel.org>); Tue, 13 Feb 2018 10:47:56 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:31028 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933594AbeBMPrz (ORCPT <rfc822;linux-block@vger.kernel.org>); Tue, 13 Feb 2018 10:47:55 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180213154753epoutp037e51bfc09e5d0c37eec2d1f7f69925a7~S7T2jBFTR2594625946epoutp03g; Tue, 13 Feb 2018 15:47:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180213154753epoutp037e51bfc09e5d0c37eec2d1f7f69925a7~S7T2jBFTR2594625946epoutp03g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1518536873; bh=Sg/sNE3fLqKALq6mrvYiQtEAePATntvQvPW6rGz6f00=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=f2/UGbjYmvXq6Omb2nzwA1euSGayyPTNwiHlSKCzMYpE1G92SfU6HceYrCbPaNI1s SfEePxof7qZU72Zk/xiysE4r7TwmFO56sm/xpw1MT/IRfDDIVEUuQr5reUW8ecRAOI d/JmhMv/nmfMX3lGQofNC6+CUG+JLXi3ZFiPXpgc= Received: from epsmges1p3.samsung.com (unknown [182.195.42.55]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180213154752epcas1p3003741bb93c37bd3ec2c233746671b45~S7T1lnn_11063610636epcas1p3A; Tue, 13 Feb 2018 15:47:52 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id B2.62.04137.8A8038A5; Wed, 14 Feb 2018 00:47:52 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180213154752epcas1p35e3c13d150d2108a06342781ec5e64d7~S7T1ZMcmi1454614546epcas1p3s; Tue, 13 Feb 2018 15:47:52 +0000 (GMT) X-AuditID: b6c32a37-44bff70000001029-85-5a8308a8c8df Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id CD.AA.03826.7A8038A5; Wed, 14 Feb 2018 00:47:52 +0900 (KST) Received: from test-PowerEdge-R720.sisodomain.com ([107.108.221.212]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P43009JCIJN8870@mmp2.samsung.com>; Wed, 14 Feb 2018 00:47:51 +0900 (KST) From: Nitesh Shetty <nj.shetty@samsung.com> To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: axboe@kernel.dk, axboe@fb.com, linux-nvme@lists.infradead.org, nj.shetty@samsung.com, joshi.k@samsung.com Subject: [PATCH v3] blk: optimization for classic polling Date: Tue, 13 Feb 2018 21:18:12 +0530 Message-id: <1518536892-2051-1-git-send-email-nj.shetty@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <3578876466-3733-1-git-send-email-nj.shetty@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRmVeSWpSXmKPExsWy7bCmvu4KjuYogwsnhSz+7znGZrH6bj+b xdH/b9ks9t7Stri8aw6bxfxlT9kttv2ez+zA7jGx+R27x+WzpR6bl9R79G1ZxejxeZNcAGsU l01Kak5mWWqRvl0CV8bL59eZC/6yV0xe9IulgfEMWxcjJ4eEgInE5okdzF2MXBxCAjsYJTbO uccG4XxnlFgzcRYzTNXEx5ehqjYwSjzfvRSqqp1J4t2fi+xdjBwcbALaEqf/c4A0iAjYSsw9 do0FJMwskC/xdZEYSFhYwFJiT/d9FhCbRUBVov/hRzCbV8BFou9gIyPELjmJm+c6wfZyCrhK /HnbCbZXQqCDTeLn2tNQZ7tIfNrwkx3CFpZ4dXwL2AkSAtISl47aQtR3M0rcaF0NNXQKo8SM ufoQtr3ExT1/mUBsZgE+iXdfe1ghenklOtqEIEo8JPa8fcMEYTtKbHp1kRXi3RmMEm0zNjBN YJRawMiwilEstaA4Nz212LDAWK84Mbe4NC9dLzk/dxMjOBq1zHcwbjjnc4hRgINRiYeX421T lBBrYllxZe4hRgkOZiUR3oT7QCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8AQEuUUIC6Yklqdmp qQWpRTBZJg5OqQZGx5eNr8JlZrRxyCaxCuVLPt6gH5j39pPyhfScYzu9jkx7c8xlZ+CML1fv ZfWH3Tqx4wbzgYh6/URL7yqXy6H3zQxzQhJY1tyNUT/S98X+h338JYHrB9VZEoOj1A+HL3Lc MLH39RSF3llvZkRcnMGxKiraMXUnh/4BCYHjnrFHco6cz2Avf6GsxFKckWioxVxUnAgAOxo+ usICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgluLIzCtJLcpLzFFi42I5/e+xoO4KjuYog2NHmC3+7znGZrH6bj+b xdH/b9ks9t7Stri8aw6bxfxlT9kttv2ez+zA7jGx+R27x+WzpR6bl9R79G1ZxejxeZNcAGsU l01Kak5mWWqRvl0CV8bL59eZC/6yV0xe9IulgfEMWxcjJ4eEgInExMeXmbsYuTiEBNYxSpw5 dpcVwulkkrj36TZQFQcHm4C2xOn/HCANIgK2EnOPXWMBsZkF8iW6fnxgArGFBSwl9nTfB4uz CKhK9D/8CGbzCrhI9B1sZIRYJidx81wnM4jNKeAq8ecthC0EVHNifRPrBEaeBYwMqxglUwuK c9Nzi40KDPNSy/WKE3OLS/PS9ZLzczcxAsNn22Gtvh2M95fEH2IU4GBU4uHd8KopSog1say4 MvcQowQHs5IIb8J9oBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe23nHIoUE0hNLUrNTUwtSi2Cy TBycUg2MC48eFjr2n4sjYJOXm/e8VTyy5zamX1Cd76Dy6+LjH1OM72Ut3tD9YefXP5Zzftaz bJFc9eL5l2mfzm6qXxmc4/HbKmJ55Gvu1TuSfIOP7fr9boHX1S8PF6+LLlX74nvX5Yi66vrv XBWxRtP1mXa/mleR2l3DJHRAnUM1RCj4dsrnypcaF041GymxFGckGmoxFxUnAgA1+pH6GwIA AA== X-CMS-MailID: 20180213154752epcas1p35e3c13d150d2108a06342781ec5e64d7 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180213154752epcas1p35e3c13d150d2108a06342781ec5e64d7 X-RootMTR: 20180213154752epcas1p35e3c13d150d2108a06342781ec5e64d7 References: <3578876466-3733-1-git-send-email-nj.shetty@samsung.com> <CGME20180213154752epcas1p35e3c13d150d2108a06342781ec5e64d7@epcas1p3.samsung.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: <linux-block.vger.kernel.org> X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
On 2/13/18 8:48 AM, Nitesh Shetty wrote: > This removes the dependency on interrupts to wake up task. Set task > state as TASK_RUNNING, if need_resched() returns true, > while polling for IO completion. > Earlier, polling task used to sleep, relying on interrupt to wake it up. > This made some IO take very long when interrupt-coalescing is enabled in > NVMe. Thanks, applied.
diff --git a/block/blk-mq.c b/block/blk-mq.c index df93102..3574927 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3164,6 +3164,7 @@ static bool __blk_mq_poll(struct blk_mq_hw_ctx *hctx, struct request *rq) cpu_relax(); } + __set_current_state(TASK_RUNNING); return false; }
This removes the dependency on interrupts to wake up task. Set task state as TASK_RUNNING, if need_resched() returns true, while polling for IO completion. Earlier, polling task used to sleep, relying on interrupt to wake it up. This made some IO take very long when interrupt-coalescing is enabled in NVMe. Reference: http://lists.infradead.org/pipermail/linux-nvme/2018-February/015435.html Changes since v2->v3: -using __set_current_state() instead of set_current_state() Changes since v1->v2: -setting task state once in blk_poll, instead of multiple callers. Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com> --- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+)