From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751715AbdKYWfq (ORCPT ); Sat, 25 Nov 2017 17:35:46 -0500 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 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 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> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 25 Nov 2017 22:35:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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