From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.95.11.211 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796112493; b=yrwAhcspInzYeLYi1riFuzUch0fJHGW4yFr9K/E9X8S89vyP+3/T/2lexP922DQqcHiS a3YN74a+emC18cNKbOxtqBXX0/f3NERMjkAe9+xW7LCTqSKtg+IVV9L8L0RHk9cNnC71+ 6OC6K88mMjnXyEuPgCOiC8fEv8az1yZ+jh82cm/iSxbcpboIu3ZWAxsxVg4Qq39sTVMLZ irjLqIMejrGjMfAAoaFkZsesGAzlagtd90hSkj42hlLOay6Shmoy6MvuCvSHgaDj7WI0j UGWdawVRZjmd5nFHPWIGHRma2+kLS3B7ePTTi3WHfBn6xwgryg7MLp4NZOrLX/bwmWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796112493; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; bh=f3UW3roz/UN1BoaFzIadrst/nWNAJQHHKqSHRxbKmG4=; b=oc6y6zE3Tk3chsfu83dkA5rdEhREnH+W0e9UmbKtIX3cjE8nLqFk0aqVWUf12dWIiKdi U2hqpZwJWp46alGY8DwxI47GVb1dLbEMm6etaGJlLkEEpG6ZjIfMeu4W8Mz6A0E9QK1J+ xZbN0mUDbSqtIMUZKEmlp9HqduplujtPAIRNz3pXFn2FkAVo4fKV2muHHmSbp7S5YxtYR 4fyRdi9bo8Wd+0Adjts5Ouib8XJIc/PDF15XUNMaO73tzb916uWP4KEBINX3Y4pDZVWWn N8Mu3onDcd9FWHQ7N0Q4bIplnROZDZXhelGJvS8DCKute6zWVR7NLLguXLVXkjFIYqA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.remote-ip=213.95.11.211 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49FF4606A320; Tue, 1 Dec 2026 08:08:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 49FF4606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 45ECB68BFE; Tue, 1 Dec 2026 09:08:01 +0100 (CET) Date: Tue, 1 Dec 2026 09:08:00 +0100 From: Christoph Hellwig To: Fengnan Chang Cc: Christian Brauner , Ming Lei , Christoph Hellwig , "Darrick J . Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH] iomap: disable I/O polling when direct I/O must wait Message-ID: <20261201080800.GA26780@lst.de> References: <20261201034922.203226-1-changfengnan@bytedance.com> X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201034922.203226-1-changfengnan@bytedance.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Tue, Dec 01, 2026 at 03:49:22AM +0000, Fengnan Chang wrote: > With IOMAP_DIO_FORCE_WAIT, __iomap_dio_rw() waits for the bios of an > asynchronous kiocb in the submission path. That wait does not poll, and > the caller, such as io_uring, cannot poll before __iomap_dio_rw() > returns. > > Such writes usually do not poll, because a mapping that needs > completion work clears IOCB_HIPRI. But IOCB_HIPRI is only cleared once > that mapping is reached, and a bio for an earlier mapping may already > have been submitted as polled. > > For example, an ext4 unaligned write that covers a written block > followed by an unwritten block needs sub-block zeroing, so ext4 passes > IOMAP_DIO_FORCE_WAIT. The bio for the written block is submitted as > polled, and the task then waits for it without polling. On a poll > queue the write stalls until the request times out; NVMe then reaps > the completion from its timeout handler, after 30 seconds by default. > > Like synchronous kiocbs, do not poll the bios if the caller will wait > for them: clear IOCB_HIPRI before submitting any bio. > > Reproduced with an io_uring IOPOLL write of 4 KiB at offset 2 KiB to > such an ext4 file on a null_blk device with poll queues: the write > failed with -ETIMEDOUT after the request timeout. With this change it > completes and reads back correctly. Looks good: Reviewed-by: Christoph Hellwig I've seen you've also posted various other polling fixes. Any chance you could try to wire up your tests in blktests or xfstests so that we get test coverage for these cases?