1. 06 4月, 2018 1 次提交
  2. 04 4月, 2018 10 次提交
    • D
      fscache: Attach the index key and aux data to the cookie · 402cb8dd
      David Howells 提交于
      Attach copies of the index key and auxiliary data to the fscache cookie so
      that:
      
       (1) The callbacks to the netfs for this stuff can be eliminated.  This
           can simplify things in the cache as the information is still
           available, even after the cache has relinquished the cookie.
      
       (2) Simplifies the locking requirements of accessing the information as we
           don't have to worry about the netfs object going away on us.
      
       (3) The cache can do lazy updating of the coherency information on disk.
           As long as the cache is flushed before reboot/poweroff, there's no
           need to update the coherency info on disk every time it changes.
      
       (4) Cookies can be hashed or put in a tree as the index key is easily
           available.  This allows:
      
           (a) Checks for duplicate cookies can be made at the top fscache layer
           	 rather than down in the bowels of the cache backend.
      
           (b) Caching can be added to a netfs object that has a cookie if the
           	 cache is brought online after the netfs object is allocated.
      
      A certain amount of space is made in the cookie for inline copies of the
      data, but if it won't fit there, extra memory will be allocated for it.
      
      The downside of this is that live cache operation requires more memory.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAnna Schumaker <anna.schumaker@netapp.com>
      Tested-by: NSteve Dickson <steved@redhat.com>
      402cb8dd
    • D
      fscache: Add more tracepoints · 08c2e3d0
      David Howells 提交于
      Add more tracepoints to fscache, including:
      
       (*) fscache_page - Tracks netfs pages known to fscache.
      
       (*) fscache_check_page - Tracks the netfs querying whether a page is
           pending storage.
      
       (*) fscache_wake_cookie - Tracks cookies being woken up after a page
           completes/aborts storage in the cache.
      
       (*) fscache_op - Tracks operations being initialised.
      
       (*) fscache_wrote_page - Tracks return of the backend write_page op.
      
       (*) fscache_gang_lookup - Tracks lookup of pages to be stored in the write
           operation.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      08c2e3d0
    • D
      fscache: Add tracepoints · a18feb55
      David Howells 提交于
      Add some tracepoints to fscache:
      
       (*) fscache_cookie - Tracks a cookie's usage count.
      
       (*) fscache_netfs - Logs registration of a network filesystem, including
           the pointer to the cookie allocated.
      
       (*) fscache_acquire - Logs cookie acquisition.
      
       (*) fscache_relinquish - Logs cookie relinquishment.
      
       (*) fscache_enable - Logs enablement of a cookie.
      
       (*) fscache_disable - Logs disablement of a cookie.
      
       (*) fscache_osm - Tracks execution of states in the object state machine.
      
      and cachefiles:
      
       (*) cachefiles_ref - Tracks a cachefiles object's usage count.
      
       (*) cachefiles_lookup - Logs result of lookup_one_len().
      
       (*) cachefiles_mkdir - Logs result of vfs_mkdir().
      
       (*) cachefiles_create - Logs result of vfs_create().
      
       (*) cachefiles_unlink - Logs calls to vfs_unlink().
      
       (*) cachefiles_rename - Logs calls to vfs_rename().
      
       (*) cachefiles_mark_active - Logs an object becoming active.
      
       (*) cachefiles_wait_active - Logs a wait for an old object to be
           destroyed.
      
       (*) cachefiles_mark_inactive - Logs an object becoming inactive.
      
       (*) cachefiles_mark_buried - Logs the burial of an object.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      a18feb55
    • D
      fscache: Fix hanging wait on page discarded by writeback · 2c984257
      David Howells 提交于
      If the fscache asynchronous write operation elects to discard a page that's
      pending storage to the cache because the page would be over the store limit
      then it needs to wake the page as someone may be waiting on completion of
      the write.
      
      The problem is that the store limit may be updated by a different
      asynchronous operation - and so may miss the write - and that the store
      limit may not even get updated until later by the netfs.
      
      Fix the kernel hang by making fscache_write_op() mark as written any pages
      that are over the limit.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      2c984257
    • D
      fscache: Detect multiple relinquishment of a cookie · d0fb31ec
      David Howells 提交于
      Report if an fscache cookie is relinquished multiple times by the netfs.
      Signed-off-by: NDavid <dhowells@redhat.com>
      d0fb31ec
    • D
      fscache: Pass the correct cancelled indications to fscache_op_complete() · b27ddd46
      David Howells 提交于
      The last parameter to fscache_op_complete() is a bool indicating whether or
      not the operation was cancelled.  A lot of the time the inverse value is
      given or no differentiation is made.  Fix this.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      b27ddd46
    • D
      fscache, cachefiles: Fix checker warnings · bfa3837e
      David Howells 提交于
      Fix a couple of checker warnings in fscache and cachefiles:
      
       (1) fscache_n_op_requeue is never used, so get rid of it.
      
       (2) cachefiles_uncache_page() is passed in a lock that it releases, so
           this needs annotating.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      bfa3837e
    • D
      afs: Be more aggressive in retiring cached vnodes · 678edd09
      David Howells 提交于
      When relinquishing cookies, either due to iget failure or to inode
      eviction, retire a cookie if we think the corresponding vnode got deleted
      on the server rather than just letting it lie in the cache.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      678edd09
    • D
      afs: Use the vnode ID uniquifier in the cache key not the aux data · 27a3ee3a
      David Howells 提交于
      AFS vnodes (files) are referenced by a triplet of { volume ID, vnode ID,
      uniquifier }.  Currently, kafs is only using the vnode ID as the file key
      in the volume fscache index and checking the uniquifier on cookie
      acquisition against the contents of the auxiliary data stored in the cache.
      
      Unfortunately, this is subject to a race in which an FS.RemoveFile or
      FS.RemoveDir op is issued against the server but the local afs inode isn't
      torn down and disposed off before another thread issues something like
      FS.CreateFile.  The latter then gets given the vnode ID that just got
      removed, but with a new uniquifier and a cookie collision occurs in the
      cache because the cookie is only keyed on the vnode ID whereas the inode is
      keyed on the vnode ID plus the uniquifier.
      
      Fix this by keying the cookie on the uniquifier in addition to the vnode ID
      and dropping the uniquifier from the auxiliary data supplied.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      27a3ee3a
    • D
      afs: Invalidate cache on server data change · c1515999
      David Howells 提交于
      Invalidate any data stored in fscache for a vnode that changes on the
      server so that we don't end up with the cache in a bad state locally.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c1515999
  3. 03 4月, 2018 29 次提交