1. 01 6月, 2018 6 次提交
    • A
      NFS: Pass "privileged" value to nfs4_init_sequence() · fba83f34
      Anna Schumaker 提交于
      We currently have a separate function just to set this, but I think it
      makes more sense to set it at the same time as the other values in
      nfs4_init_sequence()
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      fba83f34
    • A
      NFS: Move call to nfs4_state_protect() to nfs4_commit_setup() · e9ae1ee2
      Anna Schumaker 提交于
      Rather than doing this in the generic NFS client code.  Let's put this
      with the other v4 stuff so it's all in one place.
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      e9ae1ee2
    • A
      NFS: Move call to nfs4_state_protect_write() to nfs4_write_setup() · fb91fb0e
      Anna Schumaker 提交于
      This doesn't really need to be in the generic NFS client code, and I
      think it makes more sense to keep the v4 code in one place.
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      fb91fb0e
    • N
      NFS: Avoid quadratic search when freeing delegations. · e04bbf6b
      NeilBrown 提交于
      There are three places that walk all delegation for an nfs_client and
      restart whenever they find something interesting - potentially
      resulting in a quadratic search:  If there are 10,000 uninteresting
      delegations followed by 10,000 interesting one, then the code
      skips over 100,000,000 delegations, which can take a noticeable amount
      of time.
      
      Of these nfs_delegation_reap_unclaimed() and
      nfs_reap_expired_delegations() are only called during unusual events:
      a server reboots or reports expired delegations, probably due to a
      network partition.  Optimizing these is not particularly important.
      
      The third, nfs_client_return_marked_delegations(), is called
      periodically via nfs_expire_unreferenced_delegations().  It could
      cause periodic problems on a busy server.
      
      New delegations are added to the end of the list, so if there are
      10,000 open files with delegations, and 10,000 more recently opened files
      that received delegations but are now closed, then
      nfs_client_return_marked_delegations() can take seconds to skip over
      the 10,000 open files 10,000 times.  That is a waste of time.
      
      The avoid this waste a place-holder (an inode) is kept when locks are
      dropped, so that the place can usually be found again after taking
      rcu_readlock().  This place holder ensure that we find the right
      starting point in the list of nfs_servers, and makes is probable that
      we find the right starting point in the list of delegations.
      We might need to occasionally restart at the head of that list.
      
      It might be possible that the place_holder inode could lose its
      delegation separately, and then get a new one using the same (freed
      and then reallocated) 'struct nfs_delegation'.  Were this to happen,
      the new delegation would be at the end of the list and we would miss
      returning some other delegations.  This would have the effect of
      unnecessarily delaying the return of some unused delegations until the
      next time this function is called - typically 90 seconds later.  As
      this is not a correctness issue and is vanishingly unlikely to happen,
      it does not seem worth addressing.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      e04bbf6b
    • N
      NFS: use cond_resched() when restarting walk of delegation list. · 3ca951b6
      NeilBrown 提交于
      In three places we walk the list of delegations for an nfs_client
      until an interesting one is found, then we act of that delegation
      and restart the walk.
      
      New delegations are added to the end of a list and the interesting
      delegations are usually old, so in many case we won't repeat
      a long walk over and over again, but it is possible - particularly if
      the first server in the list has a large number of uninteresting
      delegations.
      
      In each cache the work done on interesting delegations will often
      complete without sleeping, so this could loop many times without
      giving up the CPU.
      
      So add a cond_resched() at an appropriate point to avoid hogging the
      CPU for too long.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      3ca951b6
    • N
      NFS: slight optimization for walking list for delegations · f3893491
      NeilBrown 提交于
      There are 3 places where we walk the list of delegations
      for an nfs_client.
      In each case there are two nested loops, one for nfs_servers
      and one for nfs_delegations.
      
      When we find an interesting delegation we try to get an active
      reference to the server.  If that fails, it is pointless to
      continue to look at the other delegation for the server as
      we will never be able to get an active reference.
      So instead of continuing in the inner loop, break out
      and continue in the outer loop.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      f3893491
  2. 29 5月, 2018 3 次提交
  3. 11 4月, 2018 28 次提交
  4. 06 4月, 2018 1 次提交
  5. 04 4月, 2018 1 次提交
    • 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
  6. 28 3月, 2018 1 次提交