From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796114923; b=ql6Ouu6Va4FQVyGZ4muEN6Ofx5U8AmioCorygmw/5sPOAnI6YXjlxP86DZoXJn2ZTMQH vwLTnAVo1ZIOa3O7d6Lgxc4nK8OAMnv+lzCCTmRLOXa3brfkfZlWilvNx1JAFLkL9UqDJ eZC+gVDoyYyg7jD0AfARTxyYeW0amVM/pzSGtPs8oPcM9pFQPcPfkU7s7kIY3qZSWjnA/ jF0DK9RN1nR3y+eHSHkhjSlPL1T0nqmtG9VIaiG/MrJGsB64Si2Oj8Awb6vLgRnmlB3LZ ObZu6vYOrW7JjYdCPfr87GM5oLPeA+irrTnFJoQeDxDivFgt20zBT3Znu2iYRWhFFQw== 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=lEKu/Pfo15pFVzypXy7IpMk1E/B4g4iIwAlUvPds6ToXxm7w/+FhOTjVTCUs1fxtzLLU S5knH3GjsXVUR8bbHKwlOrWyatmcj6I73dYMF0gR3i0nEhLLKHgbyrq5s+Qh9cLyFPpBt g8YxSCYxIX2GZKhLCLwzcfqs05mHotI5HpIli+c7Gw3qEk0AC7JP22zpwaqbB2IIhX1WM 2rk/9i9CsMuyU5wXmSLASCu73D/Vvb7s/H9wfD3VoLmUxmrJDNflJrADQn4CLCIrGrrqO S3Hh+9EoDiVs+J78/Vpvqq7UIn9XpE3geufl5yLWw6B+jfcbUmODskYdzWYGNZNOzZQ== 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.172 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 C50F1606A327 for ; Tue, 1 Dec 2026 08:48:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C50F1606A327 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-f172.google.com with SMTP id d2e1a72fcca58-8c20d68c83fso6481954b3a.0 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=kMo1r/kaVsxM8LjBv8l6aQRGpViRTbEthbPHLZWYeb1zOyTvIew5oVJFZeUbfnskrN Kav/JkIQJNQsHP4oXEq+zJVE92DYWn5GHjCp0DVshEGLQ8POliEdb8xdSGfSW4haNQHv /3qRB6dH+mSqjlqRFx3T4u81c4hLdOzLCwqkBj1v87K/d7grDZSFrkya+h/b3pAAKm36 Gzi7xJEnGGo+4BCOpUImblvrZrNvaVD5MKNA7aacb8DnsB7H+RVMdKN8mSGnrmUgfgVk x0SL77oP2DgZmrEQAGW4HyvbBL9zN3vmOORM/wpqme3xa64ZjvJNwH0wFBvjILlFAJEw U6Hg== X-Forwarded-Encrypted: i=1; AL+hErH/z2FvY6UBRYkmLtkSxCL0q/U/KgV/gLsDAHuKKBY70DGus9VQpT7/hfzoy0eleIbTu2g9UFED/QOcH4Ot@vger.kernel.org X-Gm-Message-State: APuU4Z8AOKxy8n8OK5w74peVYVLULjT7QgdUKIPiUIELDGKthyASt/S9 mRXAb0ccPtaKYPbuKmLjujbjEalYi4xlB8cljqArPpax/KJXRN5G//z2 X-Gm-Gg: AZFdTZe3+wwHzLi3rny3XI8J1nKf5kAeOeHg8HfrgxTVIWkqE+526AWb1aNUhqqLQ/D aLB09IAiWjwNfOaqWBgoPSx/BoXgkM4XVWcFA5jZhFUzqSp/yuBHdLqfhrWtLA6doptNBRzzHvr edW2jafm8ze1cAgIfc69FFzqsTF3cJuLGHlBRayEi7PUdBhR3b9t2Tn90lzgDA6Jf/jmruAlnZZ jT6KB97do5bfxR86I0Q8w3ubqZIJOAUnYLJHnjgAVLV0UcAxzgmN+EqMN1bmp+hM/IWAfTl/TCw 2Ou4FE4R5NnFvgcEKjg2hDIeEsl5LkYDcLUiX3flLrNsGurEjatVwkWV56qnKvJE2iSWha8oaJW xbnNKHIX95lNyVF/s/EvMYZOqPLJwS49eMUoWX0K6l64Hij0GzvSB4m1YFTtowhHLJckz0+B4xL Y+EM7F3CGLbiDqQOXPaGb6ubtDnFdWl1gWTsaq8Y/5H2lvZ1IPMZEYYFdmgxG6wWQAqRyYs+B/h Bsr4dv6EG3MuwLq/qwcHlBa+I7Ye//+CbwbrFgHGWXbtV7KZn7GMq1chjgX9aWslaaR6l+1aZOU j7CbYtKoOIPn35+kXW08o2Nyq4XpN2nRDW7U11q+58nSpdv6ZlF/zVdXCeOgF8bix8FSYnIYj3+ 4XYqXmexthSHddlM= 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-fsdevel@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.