From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796114923; b=oLZjTlqbrQp1Xxu5z+4/LDzGdy1uFWYiPf2RvYvzeB47O7cCag5drhqkdi3g4pqg5f90 gqE5E0npMPFqEYyHYGucP27KKNbNegOwq7qfJNV1Mt8sThnF0j1bPxgrKXPevJyp1CnI2 6wXcR2pGogOKmCnQEvbLY0fkYVrIKpHO5kCtvcEz5xXyTH0eHxIg8RbWgNtzDFfw5/aLj kbGBSilnd8/QoxOmCZ4L7ASLH1/D9/M4ofUGwXvd6gxqYKjkLwverxTBDqqiPbWBwkQox AUJAuflEC7LEcxDXFS3B3XK5vVdIQRgvhfecxvNXJne88DzdCVmgSqdWKIR12fnzM/Q== 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=1E2Y0xw9oDzgZFrPp6f3RPszjBBU2VzQN/l8Z+dNXREPPCo7zoT0L/itY+tBf1N5bC4y nqTLedvouAft4oL32VE3SzXmDVkFiIYBobW6S9xQnr4Hh+xSFW3i7X8/FIlzND8Y9QBfY W+Src3MPHiah94mTBY1KxCFQOdkZRygwbXsOR3Pi5SwC7MQgSr/k09mBz8bd9i1lJtoEU T/JbOMKMV+92+lxBlQQqgd5UhLPKmSE078DvCRy5oW2pTA432hE0rbCL8EwH6J8YduD8p DrLLegqscCk5/1AhA8+WjR4jd009TwqrtgEI70jzvQ7SVJLKWRNdTmKnHCay/WSWnlA== 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.181 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 BB5BD606A320 for ; Tue, 1 Dec 2026 08:48:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BB5BD606A320 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-f181.google.com with SMTP id d2e1a72fcca58-8c700d6cc0bso5951313b3a.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=XUhpLqBC4lXDiZHGHmEWeURtkbIplAXD0DmB5I24rMeS2xqvctvTF8TEfGpPuV9KYt 9cCrAouY0fjt/yMSp54NGz+kj24c8t9rjLw+gyeSdRQnCzmCai+NhR0L/t81u8AuBiSy 6mKGyQ2l/KLrxpWF8ceth0Je7oC5PbeFc/wTakMPBuwp4XO5W/BUffr593fDYfR9ANWb DDSALCowIWe1jMsSMo109Bmj2Iv7L7X9nj7Pl+yLKaaioyAXxNqDw4suqU4veSriXb6q vhz1FoRGVxXG9nB5SS9msZCOOZuTI+qY007au51eRGcGR2jKjQoyJnxq6dlYmkN3yFp6 Y9FA== X-Forwarded-Encrypted: i=1; AL+hErFXcbkmD3PdUkIW7oDf+UeoJWlrtf+nVjAJFITqZhR7Wr/mnoc2MGHVL8DJs60uJeeSkPn7ZjbBu4o=@vger.kernel.org X-Gm-Message-State: APuU4Z/2Z/O7PW4Y/HpsScdWnUZyz5J93sa0hfoFSueqpOn/dqq/y07C zDBH9KZ6k5UZSRl8/7Qg9S7s3ROuo38bdBxxpNo+BWR3Ka16Cj5CO3RY2U1kU7u7E6c= X-Gm-Gg: AZFdTZfVVI5ffGZfSx1upu/vjTE0U7QQMKKMMv/Z3dHcpcI9A+yrE7GDU58hz0QRn3L iFzpwl/67yOpUWT6cDsgoJaP8kwwIbsxTQid1foBJWmk6Dxltiu+7z8SdPUqBu0HpnaSpP0Nz8Y 801rbVYeg277r90D1JUeR/j0vQuI4kDqBKTo0tmr1RugXx+b3UdXcKOAspIOYKk5TSrC+PxflL8 t0iIl5St75C+c/l13aRwiR+EZLVguHjqxkzxRy9CONjZOIwL3W2GtCwpPExIKMYmDAaErks6Le0 SX76PYrj4rmEQ2Ae0LA1jmzbQZuQn1JrI2PmrSyqtdEsi4/Ocgf744yek8t0KqKuNMMXP0NvQuA KTpgEDtkxqL+WEHJlNqrkeNEwJ3kXl37oW94FjcmT7jn0AwE9txmTCUuuhry9gkuiuxsns+SBAA f6SNOQkG1eY1borEGS0lA6zquuKuTz5YAlbrXGrlAUx2dWaCREzzNV9E9ax1uz1G3pFFiwRtKia ZTr+9HCE9SyDBVw3GHMFhskb/pfsKcIp2OyHO8KICrXrqLR9p+dO4+CWQOG3x012x3X/pys9j7b +jLDmKZZ7ymE4xdk55mNU+2CFDKNrV0yObSrOamII0capvIPOouEhxS5xACIIgmhkmgNIzzh3Ra fJvbNx3gugFyGHZw= 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-xfs@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.