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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 1363AC4361A for ; Thu, 3 Dec 2020 15:51:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97D57207AC for ; Thu, 3 Dec 2020 15:51:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727096AbgLCPv2 (ORCPT ); Thu, 3 Dec 2020 10:51:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgLCPv2 (ORCPT ); Thu, 3 Dec 2020 10:51:28 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47055C061A4E for ; Thu, 3 Dec 2020 07:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qMp9uzMJSCPuOk5Suoki8K6MrVesaZ0px0kuLniWQ0g=; b=DwCb3erR+VvjYmid7x5vTrqy8g cCTe0YIKi6H0uPAyBMy7cXtKnJid7wJTo/GrFK3825/0iAz/ULn5jFCZm1HiaZ6KUppHEzoRSjazL n1OqMtjKtwYdoP3eKBiDh0TbIC64UnCdq6+p41Oo6ZEIyqtWgewO0d8MfsFLy0pKuTpGbIe3NKNro +X8CpshY3sheJdLeNzocbulA5m3vpW4Xjhk/QnX3KGygnrswe0aLn10dOE2LmswVqfO/OjeJiI8cL B189HBXsV3Ttw8bTX2Di8W6q3SDrcVALezs3c62efrjm28LlqtDKdMFzfyFiawnb9Nc0lF2V4783e 9wT56ECg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkqsV-0003bW-AL; Thu, 03 Dec 2020 15:50:43 +0000 Date: Thu, 3 Dec 2020 15:50:43 +0000 From: Matthew Wilcox To: David Howells Cc: Christoph Hellwig , jlayton@redhat.com, dchinner@redhat.com, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com Subject: Re: Problems doing DIO to netfs cache on XFS from Ceph Message-ID: <20201203155043.GI11935@casper.infradead.org> References: <914680.1607004656@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <914680.1607004656@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Dec 03, 2020 at 02:10:56PM +0000, David Howells wrote: > Note that I'm only doing async DIO reads and writes, so I was a bit surprised > that XFS is doing a writeback at all - but I guess that IOCB_DIRECT is > actually just a hint and the filesystem can turn it into buffered I/O if it > wants. That's almost the exact opposite of what is going on. XFS sees that you're going to do an O_DIRECT read, so it writes back the dirty memory that's currently in the page cache so that your read doesn't read stale data from disk.