From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: invalidate the buffer heads of a block device Date: Tue, 30 Sep 2014 17:13:19 -0400 Message-ID: References: <2368A3FCF9F7214298E53C823B0A48EC0420B08E@AMSPEX01CL02.citrite.net> <20140929181115.GG6328@quack.suse.cz> <2368A3FCF9F7214298E53C823B0A48EC0420B711@AMSPEX01CL02.citrite.net> <20140930091902.GA26216@quack.suse.cz> <2368A3FCF9F7214298E53C823B0A48EC0420B8AF@AMSPEX01CL02.citrite.net> <20140930095510.GC26216@quack.suse.cz> <2368A3FCF9F7214298E53C823B0A48EC0420B983@AMSPEX01CL02.citrite.net> <20140930104845.GA31117@quack.suse.cz> <20140930205301.GF12900@lenny.home.zabbo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Jan Kara , Thanos Makatos , "linux-fsdevel@vger.kernel.org" , Ross Lagerwall , Felipe Franciosi To: Zach Brown Return-path: Received: from mail-vc0-f173.google.com ([209.85.220.173]:33996 "EHLO mail-vc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbaI3VNU (ORCPT ); Tue, 30 Sep 2014 17:13:20 -0400 Received: by mail-vc0-f173.google.com with SMTP id ij19so3057418vcb.32 for ; Tue, 30 Sep 2014 14:13:19 -0700 (PDT) In-Reply-To: <20140930205301.GF12900@lenny.home.zabbo.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Sep 30, 2014 at 4:53 PM, Zach Brown wrote: > On Tue, Sep 30, 2014 at 12:48:45PM +0200, Jan Kara wrote: >> On Tue 30-09-14 10:11:32, Thanos Makatos wrote: >> > >> > Regarding extending the ioctl to invalidate the page cache, do you have >> > any suggestions where I could start looking? >> You just need to call invalidate_inode_pages2(). That is going to do all >> you need. >> >> > Would such a new ioctl have any chance to be accepted upstream? >> I believe a possibility for a file to be fully flushed from page cache is >> useful at times and if you present well your usecase there are reasonable >> chances it will get accepted upstream. > > Agreed, this seems reasonable. How many times have we all dropped our > entire cache just 'cause we didn't have a more precise tool? > > $ grep -ri drop_caches xfstests/ > xfstests/src/fsync-tester.c: if ((fd = open("/proc/sys/vm/drop_caches", O_WRONLY)) < 0) { > xfstests/src/stale_handle.c: system("echo 3 > /proc/sys/vm/drop_caches"); > xfstests/common/quota: echo 3 > /proc/sys/vm/drop_caches > > The last one even says: > > # XXX: really need an ioctl instead of this big hammer > echo 3 > /proc/sys/vm/drop_caches > > :) > It would definitely be useful for NFS, however we'd want the option of clearing the cached metadata too (acls, mode bits, owner/group owner, etc.) -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@primarydata.com