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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01A2C433EF for ; Mon, 23 May 2022 22:36:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DFCC6B0072; Mon, 23 May 2022 18:36:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 28B4B6B0073; Mon, 23 May 2022 18:36:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A1556B0074; Mon, 23 May 2022 18:36:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0C7C66B0072 for ; Mon, 23 May 2022 18:36:10 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id D064D8111D for ; Mon, 23 May 2022 22:36:09 +0000 (UTC) X-FDA: 79498467258.24.A10F553 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 47E6D140026 for ; Mon, 23 May 2022 22:35:57 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 91A8E61542; Mon, 23 May 2022 22:36:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BAC6C385A9; Mon, 23 May 2022 22:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653345368; bh=EE0WUvON5ejJQLkBWGV/tDflACpI5x3JMK2sZqhb/4U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CC5Vp4lrbHj9V1ccl5SdDoFbcHiWK5BO+R40hsCl9NoRxMav99+ONFpUyqXktj6Jk 27fb7G61UI6BSXDJ8pu/EOT/Q1GZY2Fm+6RVKI46K9nd9gxCXHQHaKmhkZVo0f/L7E 1aKRJWCycFJbh1gRWQBAa0L8i1QMtEbx6LmnI/wess6hn+kK7lxKwokfdEwbsVeqT8 m1ULKspWnvGIH9jzOZDKPXaiYj16rXgB1YG0asYZu34mQnbB/+2PZ4IArwtOxbp34D 3bzGNBTuDdNJTm4rvbMvTzkC25IKXjhmjE2XmG9zJLIJJKOL7ldOqtq4BTebO4JQgO NxwNCPzk8hmjA== Date: Mon, 23 May 2022 16:36:04 -0600 From: Keith Busch To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, linux-xfs@vger.kernel.org, Changhui Zhong Subject: Re: [PATCH V2] block: ignore RWF_HIPRI hint for sync dio Message-ID: References: <20220420143110.2679002-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220420143110.2679002-1-ming.lei@redhat.com> X-Rspam-User: X-Rspamd-Queue-Id: 47E6D140026 X-Stat-Signature: w46rmsmtqzozyfc98qg8hmn7p7nh3srx Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CC5Vp4lr; spf=pass (imf09.hostedemail.com: domain of kbusch@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kbusch@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam03 X-HE-Tag: 1653345357-244935 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Apr 20, 2022 at 10:31:10PM +0800, Ming Lei wrote: > So far bio is marked as REQ_POLLED if RWF_HIPRI/IOCB_HIPRI is passed > from userspace sync io interface, then block layer tries to poll until > the bio is completed. But the current implementation calls > blk_io_schedule() if bio_poll() returns 0, and this way causes io hang or > timeout easily. Wait a second. The task's current state is TASK_RUNNING when bio_poll() returns zero, so calling blk_io_schedule() isn't supposed to hang.