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 X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F33C433DB for ; Tue, 9 Feb 2021 19:55:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 94ABE64EAA for ; Tue, 9 Feb 2021 19:55:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94ABE64EAA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0795F6B0005; Tue, 9 Feb 2021 14:55:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 002F56B006C; Tue, 9 Feb 2021 14:55:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE5B76B006E; Tue, 9 Feb 2021 14:55:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id C3ED56B0005 for ; Tue, 9 Feb 2021 14:55:45 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8BDBE8248076 for ; Tue, 9 Feb 2021 19:55:45 +0000 (UTC) X-FDA: 77799784650.06.arch40_5a0ab2f2760a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 66A5710049132 for ; Tue, 9 Feb 2021 19:55:45 +0000 (UTC) X-HE-Tag: arch40_5a0ab2f2760a X-Filterd-Recvd-Size: 2200 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 19:55:44 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 94F4864E85; Tue, 9 Feb 2021 19:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1612900543; bh=/VVBW/mmIaA9aKxI4f8SyqvwmyZqliL2BhQwvcCvZfA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HsE/Kxij+DWxv152OJJcn+tRfjMZQ74BZ/MkOBURXxcAOGGHo+C4qd44rbRSwWhzh 2YSwczO9yPWYBGDK+li9B2xVV7d0GVnbiuIxDvH9bkQzGbBdEx7BEru5t6O+6Ck1Hb V368P9hl5NY4qebU5s1QtbZ59vFE2LzjOXzGH6nU= Date: Tue, 9 Feb 2021 11:55:42 -0800 From: Andrew Morton To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, hch@infradead.org Subject: Re: [PATCHSET v2 0/3] Improve IOCB_NOWAIT O_DIRECT reads Message-Id: <20210209115542.3e407e306a4f1af29257c8f6@linux-foundation.org> In-Reply-To: <20210209023008.76263-1-axboe@kernel.dk> References: <20210209023008.76263-1-axboe@kernel.dk> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 8 Feb 2021 19:30:05 -0700 Jens Axboe wrote: > Hi, > > For v1, see: > > https://lore.kernel.org/linux-fsdevel/20210208221829.17247-1-axboe@kernel.dk/ > > tldr; don't -EAGAIN IOCB_NOWAIT dio reads just because we have page cache > entries for the given range. This causes unnecessary work from the callers > side, when the IO could have been issued totally fine without blocking on > writeback when there is none. > Seems a good idea. Obviously we'll do more work in the case where some writeback needs doing, but we'll be doing synchronous writeout in that case anyway so who cares. Please remind me what prevents pages from becoming dirty during or immediately after the filemap_range_needs_writeback() check? Perhaps filemap_range_needs_writeback() could have a comment explaining what it is that keeps its return value true after it has returned it!