Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp693450ybx; Wed, 30 Oct 2019 03:36:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfvAXkwbk09zvBR+Pm6hCXH9smJhX048eFbQ+ModY+xFx8xpFUyp271eTAVWzMTmhQRZ0w X-Received: by 2002:a50:cc43:: with SMTP id n3mr31494728edi.287.1572431769847; Wed, 30 Oct 2019 03:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572431769; cv=none; d=google.com; s=arc-20160816; b=HJHpFwmc709ZWIYxhcBoVIGO+AVTnfSMW94Brq3R7qNwEa9ece6ecazPeZy45Z7C8i Cm+0EkQCtAxBbjxXL/ghO0tMIscqoi4nRNP0HacXkyUYca3l8AM+FQ9jsLHZzjKG7Kxr PQPrFSNL5d6iVEEu1kU4EiHgSwGMnbnr+PbqXoRYvVccU8t4wGMrLTRxrP3lWD3rwgCV JlUPXkThxPim7igYgE+q1V2d4fmlXbvcZ1YwiyRPZAOdN8gkLro424icvkKaeJUy0bbA t6kinO+9BZRo/917W+Dn1nXzC1cbqgRJvsyHAtF96aLzCGNrIgzyPbzrabubWVfCQ0c3 ckAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=vMnBP1vJh7DVtSAEiQOC37MaYouJjw4pGK3+A/kZfEE=; b=z/OMK0Ef+x2MGdayboaroh0FNJYaBY6uSIJpUOvGi23uUArNVx9HvL1Njh2rKPi4TS QlG0hZlfxSu9Kki81S+FjttG1YjAxpba+DWsgRkLlR0k461t+Mx2J9qHvYwW35PUcrMd 0F5sRrKiYscNbIrCqhtg0J0LaFGf0CEuL5usnkcIPCflesmFzAZ2mdYFHPTxk8Bgf9dK JOb5v9NQ6Jxt2Meo2i2ViIyPCas6d5ChJ+8+zyNH5OfgkBzMHPgU8admkvGJaJ1AjKbP sk2mi3u/uEo+IzkfzNkHKJDrmNtE+N3YKEQVNi5TAgSlrXsxH/ba/dNguVGivZvDRrAW G1eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cM8ljuzJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si924637ejb.240.2019.10.30.03.35.45; Wed, 30 Oct 2019 03:36:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cM8ljuzJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726225AbfJ3KfL (ORCPT + 99 others); Wed, 30 Oct 2019 06:35:11 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31688 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726046AbfJ3KfK (ORCPT ); Wed, 30 Oct 2019 06:35:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572431709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vMnBP1vJh7DVtSAEiQOC37MaYouJjw4pGK3+A/kZfEE=; b=cM8ljuzJEYay75gZmV+oyfNRyuEt79+iU/NIl03OwMj7CqNFqmmIXFEjeV0yalg1EkheTg cMnSANZlcKEaVys+n0aH96mfcYVEp/v6WRPyy4A9/ZckonaMjJJwANrvAx3IjIBJ2VhcVQ E2F1A+OzrpEH2NGGG8A7r1ORT5uJSRI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-nQpbRAfROVGuuPV7vSUXZw-1; Wed, 30 Oct 2019 06:35:06 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE4321005500; Wed, 30 Oct 2019 10:35:04 +0000 (UTC) Received: from fogou.chygwyn.com (unknown [10.33.36.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96A3910016EB; Wed, 30 Oct 2019 10:34:32 +0000 (UTC) Subject: Re: [PATCH] mm/filemap: do not allocate cache pages beyond end of file at read To: Linus Torvalds , Konstantin Khlebnikov Cc: "Kirill A. Shutemov" , Linux-MM , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , Alexander Viro , Johannes Weiner , "cluster-devel@redhat.com" References: <157225677483.3442.4227193290486305330.stgit@buzz> <20191028124222.ld6u3dhhujfqcn7w@box> <20191028125702.xdfbs7rqhm3wer5t@box> From: Steven Whitehouse Message-ID: Date: Wed, 30 Oct 2019 10:34:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: nQpbRAfROVGuuPV7vSUXZw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 29/10/2019 16:52, Linus Torvalds wrote: > On Tue, Oct 29, 2019 at 3:25 PM Konstantin Khlebnikov > wrote: >> I think all network filesystems which synchronize metadata lazily should= be >> marked. For example as "SB_VOLATILE". And vfs could handle them speciall= y. > No need. The VFS layer doesn't call generic_file_buffered_read() > directly anyway. It's just a helper function for filesystems to use if > they want to. > > They could (and should) make sure the inode size is sufficiently > up-to-date before calling it. And if they want something more > synchronous, they can do it themselves. > > But NFS, for example, has open/close consistency, so the metadata > revalidation is at open() time, not at read time. > > Linus NFS may be ok here, but it will break GFS2. There may be others too...=20 OCFS2 is likely one. Not sure about CIFS either. Does it really matter=20 that we might occasionally allocate a page and then free it again? Ramfs is a simple test case, but at the same time it doesn't represent=20 the complexity of a real world filesystem. I'm just back from a few days=20 holiday so apologies if I've missed something earlier on in the discussions= , Steve.