Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-1118

Push file_update_time() into .page_mkwrite

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • None
    • None
    • 10264

    Description

      Please add a check for this so that it isn't forgotten. This isn't something that will cause a compile error, so it could easily be missed when porting to a new kernel.

      Cheers, Andreas

      Begin forwarded message:

      > From: Jan Kara <jack@suse.cz>
      > Date: 16 February, 2012 6:46:08 MST
      > To: LKML <linux-kernel@vger.kernel.org>
      > Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>, Eric Sandeen <sandeen@redhat.com>, Dave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.cz>, Peter Zijlstra <a.p.zijlstra@chello.nl>, Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>, Arnaldo Carvalho de Melo <acme@ghostprotocols.net>, Jaya Kumar <jayalk@intworks.biz>, Sage Weil <sage@newdream.net>, ceph-devel@vger.kernel.org, Steve French <sfrench@samba.org>, linux-cifs@vger.kernel.org, Eric Van Hensbergen <ericvh@gmail.com>, Ron Minnich <rminnich@sandia.gov>, Latchesar Ionkov <lucho@ionkov.net>, v9fs-developer@lists.sourceforge.net, Miklos Szeredi <miklos@szeredi.hu>, fuse-devel@lists.sourceforge.net, Steven Whitehouse <swhiteho@redhat.com>, cluster-devel@redhat.com, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Trond Myklebust <Trond.Myklebust@netapp.com>, linux-nfs@vger.kernel.org
      > Subject: [PATCH 00/11] Push file_update_time() into .page_mkwrite
      >
      > Hello,
      >
      > to provide reliable support for filesystem freezing, filesystems need to have
      > complete control over when metadata is changed. In particular,
      > file_update_time() calls from page fault code make it impossible for
      > filesystems to prevent inodes from being dirtied while the filesystem is
      > frozen.
      >
      > To fix the issue, this patch set changes page fault code to call
      > file_update_time() only when ->page_mkwrite() callback is not provided. If the
      > callback is provided, it is the responsibility of the filesystem to perform
      > update of i_mtime / i_ctime if needed. We also push file_update_time() call
      > to all existing ->page_mkwrite() implementations if the time update does not
      > obviously happen by other means. If you know your filesystem does not need
      > update of modification times in ->page_mkwrite() handler, please speak up and
      > I'll drop the patch for your filesystem.
      >
      > As a side note, an alternative would be to remove call of file_update_time()
      > from page fault code altogether and require all filesystems needing it to do
      > that in their ->page_mkwrite() implementation. That is certainly possible
      > although maybe slightly inefficient and would require auditting 100+
      > vm_operations_structs shake.
      >
      > If I get acks on these patches, Andrew, would you be willing to take these
      > patches?
      >
      > Honza
      >

      Attachments

        Activity

          [LU-1118] Push file_update_time() into .page_mkwrite
          ys Yang Sheng added a comment -

          Patch landed, So close this ticket.

          ys Yang Sheng added a comment - Patch landed, So close this ticket.

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/18683/
          Subject: LU-1118 llite: Invoke file_update_time in page_mkwrite
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: f28278c8cb55ce78ba0e6a180ce2b5daef1d8bea

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/18683/ Subject: LU-1118 llite: Invoke file_update_time in page_mkwrite Project: fs/lustre-release Branch: master Current Patch Set: Commit: f28278c8cb55ce78ba0e6a180ce2b5daef1d8bea

          Yang Sheng (yang.sheng@intel.com) uploaded a new patch: http://review.whamcloud.com/18683
          Subject: LU-1118 llite: Invoke file_update_time in page_mkwrite
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: af14f5840bc994468bf4e947f30698d7195b178e

          gerrit Gerrit Updater added a comment - Yang Sheng (yang.sheng@intel.com) uploaded a new patch: http://review.whamcloud.com/18683 Subject: LU-1118 llite: Invoke file_update_time in page_mkwrite Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: af14f5840bc994468bf4e947f30698d7195b178e
          ys Yang Sheng added a comment -

          On 2012-02-17, at 1:34 PM, Jinshan Xiong wrote:
          > What if we call file_update_time() in ll_page_mkwrite() anyway. So in older kernels, it will be called twice, is there any side-effect for this?
          There is some overhead to doing this, due to getting the kernel timestamp repeatedly. It also locks the inode to increment the version, and marks
          the inode dirty again.

          Better to make a configure check (if this is possible), otherwise a kernel version check. If some vendor backports this patch then it will call this twice, but at least it will avoid overhead in most cases.

          ys Yang Sheng added a comment - On 2012-02-17, at 1:34 PM, Jinshan Xiong wrote: > What if we call file_update_time() in ll_page_mkwrite() anyway. So in older kernels, it will be called twice, is there any side-effect for this? There is some overhead to doing this, due to getting the kernel timestamp repeatedly. It also locks the inode to increment the version, and marks the inode dirty again. Better to make a configure check (if this is possible), otherwise a kernel version check. If some vendor backports this patch then it will call this twice, but at least it will avoid overhead in most cases.

          People

            ys Yang Sheng
            ys Yang Sheng
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: