From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3776C43333 for ; Wed, 3 Mar 2021 06:51:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EC5864EBA for ; Wed, 3 Mar 2021 06:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344386AbhCCGnU (ORCPT ); Wed, 3 Mar 2021 01:43:20 -0500 Received: from smtp01.tmcz.cz ([93.153.104.112]:33301 "EHLO smtp01.tmcz.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1581886AbhCBT2m (ORCPT ); Tue, 2 Mar 2021 14:28:42 -0500 Received: from leontynka.twibright.com (109-183-129-149.customers.tmcz.cz [109.183.129.149]) by smtp01.tmcz.cz (Postfix) with ESMTPS id ABE784059E; Tue, 2 Mar 2021 20:05:57 +0100 (CET) Received: from debian-a64.vm ([192.168.208.2]) by leontynka.twibright.com with smtp (Exim 4.92) (envelope-from ) id 1lHALE-0003kL-Fd; Tue, 02 Mar 2021 20:05:57 +0100 Received: by debian-a64.vm (sSMTP sendmail emulation); Tue, 02 Mar 2021 20:05:55 +0100 Message-Id: <20210302190555.201228400@debian-a64.vm> User-Agent: quilt/0.65 Date: Tue, 02 Mar 2021 20:05:17 +0100 From: Mikulas Patocka To: JeffleXu , Mike Snitzer , Heinz Mauelshagen , axboe@kernel.dk, caspar@linux.alibaba.com, io-uring@vger.kernel.org, linux-block@vger.kernel.org, joseph.qi@linux.alibaba.com, dm-devel@redhat.com, hch@lst.de Cc: Mikulas Patocka Subject: [PATCH 4/4] dm: support I/O polling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=dm-poll.patch Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Support I/O polling if submit_bio_noacct_mq_direct returned non-empty cookie. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6/drivers/md/dm.c =================================================================== --- linux-2.6.orig/drivers/md/dm.c 2021-03-02 19:26:34.000000000 +0100 +++ linux-2.6/drivers/md/dm.c 2021-03-02 19:26:34.000000000 +0100 @@ -1682,6 +1682,11 @@ static void __split_and_process_bio(stru } } + if (ci.poll_cookie != BLK_QC_T_NONE) { + while (atomic_read(&ci.io->io_count) > 1 && + blk_poll(ci.poll_queue, ci.poll_cookie, true)) ; + } + /* drop the extra reference count */ dec_pending(ci.io, errno_to_blk_status(error)); }