From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:39100 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbdKYWfp (ORCPT ); Sat, 25 Nov 2017 17:35:45 -0500 From: David Howells In-Reply-To: References: <26247.1511533324@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, linux-afs@vger.kernel.org, linux-fsdevel , Linux Kernel Mailing List Subject: Re: [GIT PULL] afs: Fixes MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23133.1511649343.1@warthog.procyon.org.uk> Date: Sat, 25 Nov 2017 22:35:43 +0000 Message-ID: <23134.1511649343@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Linus Torvalds wrote: > So I see in the commit message why afs needs to do this, but it's > worth pointing out that it's > > (a) impossible to avoid the "inconsistent data" case for writable mmap'ed > pages Doesn't clear_page_dirty_for_io() write-protect the PTE for the page to be written out, in which case ->page_mkwrite() will get called again before the page is redirtied? > (b) can cause some really nasty latency issues True, but I think the most common case is a file being opened, written start to finish and then closed. Actually, the worst-handled thing I've seen is a shell script appending a bunch of things to a file because ->flush() syncs the file each time it is closed:-/ What would you recommend instead? I'm currently trying and keep track of what needs to be written so that I only write what's changed to the server, rather than writing only whole pages. David