From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796114923; b=njV3YXT3p5do1Hd66G+Zmr3jRmpMDA0nM6Yx4ju7WJIAZfpKTeLVNpzWwqfse1a9xL3P X4rQNxgpkOdo9LqP/Qew0kWAtF6hlJAce4YeSnm7U3CmdEdli8M7sBtMLg6Ilv16t3oAL P3vaujBn0arOtPyk6ds29qH0ChuQt3wM/o6GBfo2UVEceziY6X0alpudNz0H00nxWaORV UaQlt7Ux6jTTDU72qJ6xANtGhF718Fm8Z4lCY5HoP04cv/ALqCjvrSrZm9p+/+fFdo/1C g81vdlygasjcGD7fCierz4gLc/mjaSwGGixwrAmnKtJrumgbtjBkigpMYjPczjNH73g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796114923; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=BTP9QBZ2fh+8BoARD9rzdXWGKe2kI739N9ER6+oAs18=; b=ABhllsfGRWKp0ds7is0tfjmCsF5WueLjlo/6BG26X2Ut/3N7O3Z1XO3H3vzMi3lznp46 vSK0kSg456wbJm05ZW+J+o8DJMc78TPw735YbH9fxWYVGf9EFqv9TNaBNoByfyWDIm9Jc vGIZRqtETLw+xwvbF9TC052NjmfNdanlslhMcGEzHVtMY7f4WhDVQVGD+Bg6jx9ZdqNPS bjP5ClW3pmBD7vPwtXfvnk+JyL4bVut/3zS00UVe2nXKjRIpHdW2gibHKTFMHmYw+J2bl bCwyjWvtWMFW1SW6UH4NFdN/7JCdwup71FzEl8kJjrA0ELYUiKZzAoL9/ycjk/X6o/g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FrMIfGBF; arc=none smtp.remote-ip=209.85.210.182 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA452606A329 for ; Tue, 1 Dec 2026 08:48:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA452606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FrMIfGBF Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-8c700d6cc0bso5951312b3a.1 for ; Tue, 01 Dec 2026 00:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796114922; x=1796719722; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=BTP9QBZ2fh+8BoARD9rzdXWGKe2kI739N9ER6+oAs18=; b=FrMIfGBFfyAoq9YmnnQaweiIehNISOUZlNJOFv5pI/7oMrOnL62992Hlpu4Baj98WK oHUAUxH6R7WDGQQlRWH0/CWPwG+c4H1/se6vvZAa6pBnGeI13mhxHSF9V1nEm8AX/dFl DFzIXgcUnDS+QSxwtWBKTQ1isN/PUmxsuXquoAygocwxQNmCTUacv9ILji7bZC84t16k DHi56P0O366GoNHuvmw0TLG81FvnbfpDngfpyo9qYSS/3A+XoY9Ql+gk8X+ocBpEAklV RJ8I/HE8TSevbgSzK0WY0ErrSFe12Pvm8OfB6J+M1jcf7YAwgJV8FgyXfOZ1oJqWMK0k 71eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796114922; x=1796719722; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BTP9QBZ2fh+8BoARD9rzdXWGKe2kI739N9ER6+oAs18=; b=QjjKEevFPZzWtgLHYALpZWYIxT4H2yEREwBCbsnenN/Zs492JV0XEbywOTgnBvHIP3 +ckaa4ssD493HDUnyyxKn9teT1fmqqmlWUhyNFSRaCrWV/Pz8lbv2kSnWHLFKRxEFJWv SSS/qR2sNDCKtcTQvbAsHM84CiL08Nst0k0AwMmMThoper53ciU4zA5U2pg6WLxVVpLK ZU8bVArI5OeE4jPftvbVLUIau+rLK7dM43mnAUVrjWBoF3q/1Q8kRxl+Ss4bNcjTeuNF BjIZRfoSt75cbOdUCOOycMo7bzALN/e9B5HJa6H5HnXPjbqm+GwXE36Bk8pnF6HfMPx/ LrFA== X-Forwarded-Encrypted: i=1; AL+hErETsWGfAYsCsZqZTJEUVbw3kxIE/pb2lq1oQE+IvL3sXhj6ScjsEB5Ywn3kbOmjKQ0dooutiGoTvelq@vger.kernel.org X-Gm-Message-State: APuU4Z87nI1elJwhz90Whjv20pPj1WxdqDncGKMtFNYu3kyQqsm17ddn UebqKwPqL8+flgTeaBwhuH14/4De3zVfpJmt8SY+9Opj4Ug5u5qSCH8l X-Gm-Gg: AZFdTZeqEywn4BmVSGuxgd4j8+VmAwcZHcZOGJ5we5QfCck1/KeimWvOAa49LqYs0Z1 FcCCDL1oeU38md7dMPh5mQD0R2fn4bfI4XyUBz2f2S0FegwS90+RxIE1PeZoOBXzprmDMuEtVol tCPMEImCIWQKkylwxxjE0Su24pRilHWm5YpKkkg/13R6ZeWWO7V2P9YlgeZWmRLHBQ9hdGNc4WP JuHB1rWQ+DRRuFZs5MZX67dHbBhUx9dMZOwz/KGR07dQMbSQJo0u4h2G7MnOrn0LIL16CY60QTs vy6pXkWO9wb0fP0c8DsiNiX0IPyOKu4oyEh+ZM/ygJlLLWs7P6FnxsaAnK50OW8hP4UVXHEj1E3 CAQ9SncSJaH7yP9JRvyyuUom5+zp7LXFdtiuGtB0quVmS3B724MQxAlYHrDz7Rl2GdKH6GyjdKJ 9AVxh8H3esu3DvEG+OgOo87yJ1mjtfsiAD/atTU21sUnjffWG99EVaDeLJx94XdvjS30cHznrer iMShLsseluA1YGd/AFRBFo2ms3CyHv0olyZ0hdKmUvx7p+sxNfBUF9fwelrr0ppvy0sXEEKQAC3 H4dnsXXvXr8Xo2l5u28XE+zcMcGPkon3Kqj+WKBt6tuwkC/znGqWi0eM2d15/SDM0TwhanQrkgs J4c+eCZjAQ3x0cws= X-Received: by 2002:a05:6a21:4383:b0:3fe:feae:d0e5 with SMTP id adf61e73a8af0-400aeff58a8mr30231897637.51.1796114921820; Tue, 01 Dec 2026 00:48:41 -0800 (PST) Received: from [10.255.0.229] (34.224.142.34.bc.googleusercontent.com. [34.142.224.34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cea748csm18967189a12.4.2026.12.01.00.48.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 00:48:41 -0800 (PST) Message-ID: <1c2ff9ad-243e-4ebc-8f3d-aa2d1f21f09d@gmail.com> Date: Tue, 1 Dec 2026 16:48:35 +0800 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iomap: disable I/O polling when direct I/O must wait To: Christoph Hellwig , Fengnan Chang Cc: Christian Brauner , "Darrick J . Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, tom.leiming@gmail.com References: <20261201034922.203226-1-changfengnan@bytedance.com> <20261201080800.GA26780@lst.de> From: Fengnan Chang In-Reply-To: <20261201080800.GA26780@lst.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 01/12/26 16:08, Christoph Hellwig 写道: > 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? Sure, I'll do it later.