1. 06 1月, 2012 1 次提交
    • C
      NFS: Cache state owners after files are closed · 0aaaf5c4
      Chuck Lever 提交于
      Servers have a finite amount of memory to store NFSv4 open and lock
      owners.  Moreover, servers may have a difficult time determining when
      they can reap their state owner table, thanks to gray areas in the
      NFSv4 protocol specification.  Thus clients should be careful to reuse
      state owners when possible.
      
      Currently Linux is not too careful.  When a user has closed all her
      files on one mount point, the state owner's reference count goes to
      zero, and it is released.  The next OPEN allocates a new one.  A
      workload that serially opens and closes files can run through a large
      number of open owners this way.
      
      When a state owner's reference count goes to zero, slap it onto a free
      list for that nfs_server, with an expiry time.  Garbage collect before
      looking for a state owner.  This makes state owners for active users
      available for re-use.
      
      Now that there can be unused state owners remaining at umount time,
      purge the state owner free list when a server is destroyed.  Also be
      sure not to reclaim unused state owners during state recovery.
      
      This change has benefits for the client as well.  For some workloads,
      this approach drops the number of OPEN_CONFIRM calls from the same as
      the number of OPEN calls, down to just one.  This reduces wire traffic
      and thus open(2) latency.  Before this patch, untarring a kernel
      source tarball shows the OPEN_CONFIRM call counter steadily increasing
      through the test.  With the patch, the OPEN_CONFIRM count remains at 1
      throughout the entire untar.
      
      As long as the expiry time is kept short, I don't think garbage
      collection should be terribly expensive, although it does bounce the
      clp->cl_lock around a bit.
      
      [ At some point we should rationalize the use of the nfs_server
      ->destroy method. ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      [Trond: Fixed a garbage collection race and a few efficiency issues]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0aaaf5c4
  2. 05 1月, 2012 1 次提交
  3. 10 12月, 2011 1 次提交
  4. 02 12月, 2011 2 次提交
  5. 25 8月, 2011 1 次提交
  6. 20 7月, 2011 1 次提交
  7. 13 7月, 2011 1 次提交
  8. 28 5月, 2011 1 次提交
  9. 25 4月, 2011 2 次提交
  10. 16 4月, 2011 1 次提交
  11. 29 3月, 2011 1 次提交
  12. 12 3月, 2011 4 次提交
  13. 26 1月, 2011 1 次提交
  14. 07 1月, 2011 4 次提交
  15. 25 10月, 2010 1 次提交
  16. 24 10月, 2010 2 次提交
  17. 20 10月, 2010 1 次提交
  18. 05 10月, 2010 1 次提交
    • A
      fs/locks.c: prepare for BKL removal · b89f4321
      Arnd Bergmann 提交于
      This prepares the removal of the big kernel lock from the
      file locking code. We still use the BKL as long as fs/lockd
      uses it and ceph might sleep, but we can flip the definition
      to a private spinlock as soon as that's done.
      All users outside of fs/lockd get converted to use
      lock_flocks() instead of lock_kernel() where appropriate.
      
      Based on an earlier patch to use a spinlock from Matthew
      Wilcox, who has attempted this a few times before, the
      earliest patch from over 10 years ago turned it into
      a semaphore, which ended up being slower than the BKL
      and was subsequently reverted.
      
      Someone should do some serious performance testing when
      this becomes a spinlock, since this has caused problems
      before. Using a spinlock should be at least as good
      as the BKL in theory, but who knows...
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NMatthew Wilcox <willy@linux.intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Sage Weil <sage@newdream.net>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-fsdevel@vger.kernel.org
      b89f4321
  19. 31 7月, 2010 2 次提交
  20. 25 6月, 2010 1 次提交
  21. 23 6月, 2010 2 次提交
  22. 15 5月, 2010 2 次提交
  23. 03 3月, 2010 1 次提交
  24. 10 2月, 2010 3 次提交
  25. 27 1月, 2010 1 次提交
  26. 16 12月, 2009 1 次提交
    • T
      NFSv4: Fix a regression in the NFSv4 state manager · 38045412
      Trond Myklebust 提交于
      Commit 5601a00d (nfs: run state manager
      in privileged mode) introduces a regression in the NFSv4 code when
      compiled with CONFIG_NFS_V4_1. The calls to nfs4_end_drain_session()
      from the main loop in nfs4_state_manager() Oops due to the lack of an
      NFSv4.1 session when running NFSv4.0.
      
      The fix is to move those two calls back into nfs41_init_clientid() and
      nfs4_reset_session().
      
      The calls to nfs4_end_drain_session() that remain inside
      nfs4_state_manager() are safe, since the NFSv4.0 code will never set the
      NFS4CLNT_SESSION_DRAINING bit.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      38045412