All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/70] NFSd lock scalability patches
@ 2014-04-18 18:43 Trond Myklebust
  2014-04-18 18:43 ` [PATCH 01/70] NFSd: Ensure we clear the cstate->slot in nfsd4_proc_compound Trond Myklebust
                   ` (3 more replies)
  0 siblings, 4 replies; 118+ messages in thread
From: Trond Myklebust @ 2014-04-18 18:43 UTC (permalink / raw)
  To: Bruce Fields; +Cc: linux-nfs

Hi Bruce,

In accordance with the traditional Good Friday theme of "suffering", here
is the first draft of the NFSd lock scalability patches for your perusal.
I've only done light testing so far, but since there is a total of 70
patches to review, I figured you might want to start sooner rather than
waiting for the QA folks to finish testing.

During the process, I did notice a bug or two in the existing NFSd code,
and so the first 3 patches are bugfixes that you may want to apply
irrespectively.

In general, what I've tried to do is add reference counting wherever
there is a need to carry structures around outside locks, and to
ensure that we make structures invisible to lookups before we attempt
to free them.

There are still a few optimisations that might be worth considering in
order to reduce the frequency of global locks that are taken. Suggestions
include:
1) Caching the nfs4_client in the struct nfsd4_compound_state
2) Caching the current/save_stateid as references to the actual nfs4_stid in the struct nfsd4_compound_state
3) Converting the stateid/sessionid/clientid global table lookups to use RCU.
4) Converting the file_hashtbl lookups to use RCU

Cheers
  Trond

Benny Halevy (4):
  nfsd4: rename recall_lock to state_lock
  nfsd4: use cl_lock to synchronize all stateid idr calls
  nfsd4: hash deleg stateid only on successful nfs4_set_delegation
  nfsd4: use state_lock for delegation hashing

Trond Myklebust (66):
  NFSd: Ensure we clear the cstate->slot in nfsd4_proc_compound
  NFSd: Move default initialisers from create_client() to alloc_client()
  NFSd: call rpc_destroy_wait_queue() from free_client()
  NFSd: Remove 'inline' designation for free_client()
  NFSd: Mark nfs4_free_lockowner and nfs4_free_openowner as static
    functions
  NFSd: Avoid taking state_lock while holding inode lock in
    nfsd_break_one_deleg
  NFSd: Ensure delegation setup is safe w.r.t. break_lease()
  NFSd: Add fine grained protection for the nfs4_file->fi_stateids list
  NFSd: Clean up nfs4_preprocess_stateid_op
  NFSd: Add a mutex to protect the NFSv4.0 open owner replay cache
  NFSd: Add locking to the nfs4_file->fi_fds[] array
  NFSd: Protect the nfs4_file delegation fields using the fi_lock
  NFSd: Lock owners are not per open stateid
  NFSd: Clean up helper __release_lock_stateid
  NFSd: Allow lockowners to hold several stateids
  NFSd: NFSv4 lock-owners are not associated to a specific file
  NFSd: Get rid of the lockowner_ino_hashtbl
  NFSd: Cleanup nfs4svc_encode_compoundres
  NFSd: Don't get a session reference without a client reference
  NFSd: Move the delegation reference counter into the struct nfs4_stid
  NFSd: Simplify stateid management
  NFSd: Fix delegation revocation
  NFSd: Don't let the laundromat reap clients that are referenced
  NFSd: Add reference counting to the lock and open stateids
  NFSd: Add a struct nfs4_file field to struct nfs4_stid
  NFSd: Replace delegation->dl_file with the dl_stid.sc_file
  NFSd: Replace nfs4_ol_stateid->st_file with the st_stid.sc_file
  NFSd: Ensure stateids remain unique until they are freed
  NFSd: Ensure atomicity of stateid destruction and idr tree removal
  NFSd: Fix atomicity of delegation counter
  NFSd: Slight cleanup of find_stateid()
  NFSd: Add reference counting to find_stateid
  NFSd: nfs4_preprocess_seqid_op should only set *stpp on success
  NFSd: Add reference counting to lock stateids
  NFSd: nfsd4_locku() must reference the lock stateid
  NFSd: Ensure that nfs4_open_delegation() references the delegation
    stateid
  NFSd: nfsd4_process_open2() must reference the delegation stateid
  NFSd: nfsd4_process_open2() must reference the open stateid
  NFSd: Prepare nfsd4_close() for open stateid referencing
  NFSd: nfsd4_open_confirm() must reference the open stateid
  NFSd: Add reference counting to nfs4_preprocess_confirmed_seqid_op
  NFSd: Migrate the stateid reference into nfs4_preprocess_seqid_op
  NFSd: Migrate the stateid reference into nfs4_lookup_stateid()
  NFSd: Migrate the stateid reference into nfs4_find_stateid_by_type()
  NFSd: Cleanup - Let nfsd4_lookup_stateid() take a cstate argument
  NFSd: Use the session->se_client  in lookup_clientid()
  NFSd: Convert nfsd4_process_open1() to work with lookup_clientid()
  NFSd: Convert nfs4_check_open_reclaim() to work with lookup_clientid()
  NFSd: Ensure struct nfs4_client is unhashed before we try to destroy
    it
  NFSd: Ensure that the laundromat unhashes the client before releasing
    locks
  NFSd: Don't require client_lock in free_client
  NFSd: Move create_client() call outside the lock
  NFSd: Protect unconfirmed client creation using client_lock
  NFSd: Protect session creation and client confirm using client_lock
  NFSd: Protect nfsd4_destroy_clientid using client_lock
  NFSd: Ensure lookup_clientid() takes client_lock
  NFSd: Remove nfs4_lock_state(): nfs4_preprocess_stateid_op()
  NFSd: Remove nfs4_lock_state(): nfsd4_test_stateid/nfsd4_free_stateid
  NFSd: Remove nfs4_lock_state(): nfsd4_release_lockowner
  NFSd: Remove nfs4_lock_state(): nfsd4_lock/locku/lockt()
  NFSd: Remove nfs4_lock_state(): nfsd4_open_downgrade + nfsd4_close
  NFSd: Remove nfs4_lock_state(): nfsd4_delegreturn()
  NFSd: Remove nfs4_lock_state(): nfsd4_open and nfsd4_open_confirm
  NFSd: Remove nfs4_lock_state(): exchange_id, create/destroy_session()
  NFSd: Remove nfs4_lock_state(): setclientid, setclientid_confirm,
    renew
  NFSd: Remove nfs4_lock_state(): reclaim_complete()

 fs/nfsd/netns.h        |    4 -
 fs/nfsd/nfs4callback.c |   18 +-
 fs/nfsd/nfs4proc.c     |   28 +-
 fs/nfsd/nfs4state.c    | 1239 ++++++++++++++++++++++++++++++------------------
 fs/nfsd/nfs4xdr.c      |   15 +-
 fs/nfsd/state.h        |   46 +-
 fs/nfsd/xdr4.h         |   21 +-
 7 files changed, 819 insertions(+), 552 deletions(-)

-- 
1.9.0


^ permalink raw reply	[flat|nested] 118+ messages in thread

end of thread, other threads:[~2014-05-30 12:05 UTC | newest]

Thread overview: 118+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18 18:43 [PATCH 00/70] NFSd lock scalability patches Trond Myklebust
2014-04-18 18:43 ` [PATCH 01/70] NFSd: Ensure we clear the cstate->slot in nfsd4_proc_compound Trond Myklebust
2014-04-18 18:43   ` [PATCH 02/70] NFSd: Move default initialisers from create_client() to alloc_client() Trond Myklebust
2014-04-18 18:43     ` [PATCH 03/70] NFSd: call rpc_destroy_wait_queue() from free_client() Trond Myklebust
2014-04-18 18:43       ` [PATCH 04/70] NFSd: Remove 'inline' designation for free_client() Trond Myklebust
2014-04-18 18:43         ` [PATCH 05/70] nfsd4: rename recall_lock to state_lock Trond Myklebust
2014-04-18 18:44           ` [PATCH 06/70] nfsd4: use cl_lock to synchronize all stateid idr calls Trond Myklebust
2014-04-18 18:44             ` [PATCH 07/70] nfsd4: hash deleg stateid only on successful nfs4_set_delegation Trond Myklebust
2014-04-18 18:44               ` [PATCH 08/70] nfsd4: use state_lock for delegation hashing Trond Myklebust
2014-04-18 18:44                 ` [PATCH 09/70] NFSd: Mark nfs4_free_lockowner and nfs4_free_openowner as static functions Trond Myklebust
2014-04-18 18:44                   ` [PATCH 10/70] NFSd: Avoid taking state_lock while holding inode lock in nfsd_break_one_deleg Trond Myklebust
2014-04-18 18:44                     ` [PATCH 11/70] NFSd: Ensure delegation setup is safe w.r.t. break_lease() Trond Myklebust
2014-04-18 18:44                       ` [PATCH 12/70] NFSd: Add fine grained protection for the nfs4_file->fi_stateids list Trond Myklebust
2014-04-18 18:44                         ` [PATCH 13/70] NFSd: Clean up nfs4_preprocess_stateid_op Trond Myklebust
2014-04-18 18:44                           ` [PATCH 14/70] NFSd: Add a mutex to protect the NFSv4.0 open owner replay cache Trond Myklebust
2014-04-18 18:44                             ` [PATCH 15/70] NFSd: Add locking to the nfs4_file->fi_fds[] array Trond Myklebust
2014-04-18 18:44                               ` [PATCH 16/70] NFSd: Protect the nfs4_file delegation fields using the fi_lock Trond Myklebust
2014-04-18 18:44                                 ` [PATCH 17/70] NFSd: Lock owners are not per open stateid Trond Myklebust
2014-04-18 18:44                                   ` [PATCH 18/70] NFSd: Clean up helper __release_lock_stateid Trond Myklebust
2014-04-18 18:44                                     ` [PATCH 19/70] NFSd: Allow lockowners to hold several stateids Trond Myklebust
2014-04-18 18:44                                       ` [PATCH 20/70] NFSd: NFSv4 lock-owners are not associated to a specific file Trond Myklebust
2014-04-18 18:44                                         ` [PATCH 21/70] NFSd: Get rid of the lockowner_ino_hashtbl Trond Myklebust
2014-04-18 18:44                                           ` [PATCH 22/70] NFSd: Cleanup nfs4svc_encode_compoundres Trond Myklebust
2014-04-18 18:44                                             ` [PATCH 23/70] NFSd: Don't get a session reference without a client reference Trond Myklebust
2014-04-18 18:44                                               ` [PATCH 24/70] NFSd: Move the delegation reference counter into the struct nfs4_stid Trond Myklebust
2014-04-18 18:44                                                 ` [PATCH 25/70] NFSd: Simplify stateid management Trond Myklebust
2014-04-18 18:44                                                   ` [PATCH 26/70] NFSd: Fix delegation revocation Trond Myklebust
2014-04-18 18:44                                                     ` [PATCH 27/70] NFSd: Don't let the laundromat reap clients that are referenced Trond Myklebust
2014-04-18 18:44                                                       ` [PATCH 28/70] NFSd: Add reference counting to the lock and open stateids Trond Myklebust
2014-04-18 18:44                                                         ` [PATCH 29/70] NFSd: Add a struct nfs4_file field to struct nfs4_stid Trond Myklebust
2014-04-18 18:44                                                           ` [PATCH 30/70] NFSd: Replace delegation->dl_file with the dl_stid.sc_file Trond Myklebust
2014-04-18 18:44                                                             ` [PATCH 31/70] NFSd: Replace nfs4_ol_stateid->st_file with the st_stid.sc_file Trond Myklebust
2014-04-18 18:44                                                               ` [PATCH 32/70] NFSd: Ensure stateids remain unique until they are freed Trond Myklebust
2014-04-18 18:44                                                                 ` [PATCH 33/70] NFSd: Ensure atomicity of stateid destruction and idr tree removal Trond Myklebust
2014-04-18 18:44                                                                   ` [PATCH 34/70] NFSd: Fix atomicity of delegation counter Trond Myklebust
2014-04-18 18:44                                                                     ` [PATCH 35/70] NFSd: Slight cleanup of find_stateid() Trond Myklebust
2014-04-18 18:44                                                                       ` [PATCH 36/70] NFSd: Add reference counting to find_stateid Trond Myklebust
2014-04-18 18:44                                                                         ` [PATCH 37/70] NFSd: nfs4_preprocess_seqid_op should only set *stpp on success Trond Myklebust
2014-04-18 18:44                                                                           ` [PATCH 38/70] NFSd: Add reference counting to lock stateids Trond Myklebust
2014-04-18 18:44                                                                             ` [PATCH 39/70] NFSd: nfsd4_locku() must reference the lock stateid Trond Myklebust
2014-04-18 18:44                                                                               ` [PATCH 40/70] NFSd: Ensure that nfs4_open_delegation() references the delegation stateid Trond Myklebust
2014-04-18 18:44                                                                                 ` [PATCH 41/70] NFSd: nfsd4_process_open2() must reference " Trond Myklebust
2014-04-18 18:44                                                                                   ` [PATCH 42/70] NFSd: nfsd4_process_open2() must reference the open stateid Trond Myklebust
2014-04-18 18:44                                                                                     ` [PATCH 43/70] NFSd: Prepare nfsd4_close() for open stateid referencing Trond Myklebust
2014-04-18 18:44                                                                                       ` [PATCH 44/70] NFSd: nfsd4_open_confirm() must reference the open stateid Trond Myklebust
2014-04-18 18:44                                                                                         ` [PATCH 45/70] NFSd: Add reference counting to nfs4_preprocess_confirmed_seqid_op Trond Myklebust
2014-04-18 18:44                                                                                           ` [PATCH 46/70] NFSd: Migrate the stateid reference into nfs4_preprocess_seqid_op Trond Myklebust
2014-04-18 18:44                                                                                             ` [PATCH 47/70] NFSd: Migrate the stateid reference into nfs4_lookup_stateid() Trond Myklebust
2014-04-18 18:44                                                                                               ` [PATCH 48/70] NFSd: Migrate the stateid reference into nfs4_find_stateid_by_type() Trond Myklebust
2014-04-18 18:44                                                                                                 ` [PATCH 49/70] NFSd: Cleanup - Let nfsd4_lookup_stateid() take a cstate argument Trond Myklebust
2014-04-18 18:44                                                                                                   ` [PATCH 50/70] NFSd: Use the session->se_client in lookup_clientid() Trond Myklebust
2014-04-18 18:44                                                                                                     ` [PATCH 51/70] NFSd: Convert nfsd4_process_open1() to work with lookup_clientid() Trond Myklebust
2014-04-18 18:44                                                                                                       ` [PATCH 52/70] NFSd: Convert nfs4_check_open_reclaim() " Trond Myklebust
2014-04-18 18:44                                                                                                         ` [PATCH 53/70] NFSd: Ensure struct nfs4_client is unhashed before we try to destroy it Trond Myklebust
2014-04-18 18:44                                                                                                           ` [PATCH 54/70] NFSd: Ensure that the laundromat unhashes the client before releasing locks Trond Myklebust
2014-04-18 18:44                                                                                                             ` [PATCH 55/70] NFSd: Don't require client_lock in free_client Trond Myklebust
2014-04-18 18:44                                                                                                               ` [PATCH 56/70] NFSd: Move create_client() call outside the lock Trond Myklebust
2014-04-18 18:44                                                                                                                 ` [PATCH 57/70] NFSd: Protect unconfirmed client creation using client_lock Trond Myklebust
2014-04-18 18:44                                                                                                                   ` [PATCH 58/70] NFSd: Protect session creation and client confirm " Trond Myklebust
2014-04-18 18:44                                                                                                                     ` [PATCH 59/70] NFSd: Protect nfsd4_destroy_clientid " Trond Myklebust
2014-04-18 18:44                                                                                                                       ` [PATCH 60/70] NFSd: Ensure lookup_clientid() takes client_lock Trond Myklebust
2014-04-18 18:44                                                                                                                         ` [PATCH 61/70] NFSd: Remove nfs4_lock_state(): nfs4_preprocess_stateid_op() Trond Myklebust
2014-04-18 18:44                                                                                                                           ` [PATCH 62/70] NFSd: Remove nfs4_lock_state(): nfsd4_test_stateid/nfsd4_free_stateid Trond Myklebust
2014-04-18 18:44                                                                                                                             ` [PATCH 63/70] NFSd: Remove nfs4_lock_state(): nfsd4_release_lockowner Trond Myklebust
2014-04-18 18:44                                                                                                                               ` [PATCH 64/70] NFSd: Remove nfs4_lock_state(): nfsd4_lock/locku/lockt() Trond Myklebust
2014-04-18 18:44                                                                                                                                 ` [PATCH 65/70] NFSd: Remove nfs4_lock_state(): nfsd4_open_downgrade + nfsd4_close Trond Myklebust
2014-04-18 18:45                                                                                                                                   ` [PATCH 66/70] NFSd: Remove nfs4_lock_state(): nfsd4_delegreturn() Trond Myklebust
2014-04-18 18:45                                                                                                                                     ` [PATCH 67/70] NFSd: Remove nfs4_lock_state(): nfsd4_open and nfsd4_open_confirm Trond Myklebust
2014-04-18 18:45                                                                                                                                       ` [PATCH 68/70] NFSd: Remove nfs4_lock_state(): exchange_id, create/destroy_session() Trond Myklebust
2014-04-18 18:45                                                                                                                                         ` [PATCH 69/70] NFSd: Remove nfs4_lock_state(): setclientid, setclientid_confirm, renew Trond Myklebust
2014-04-18 18:45                                                                                                                                           ` [PATCH 70/70] NFSd: Remove nfs4_lock_state(): reclaim_complete() Trond Myklebust
2014-05-05  8:53                                                                                                                         ` [PATCH 60/70] NFSd: Ensure lookup_clientid() takes client_lock Christoph Hellwig
2014-05-16 18:19                                                                                                                     ` [PATCH 58/70] NFSd: Protect session creation and client confirm using client_lock Jeff Layton
2014-04-19 14:56                                                                                                     ` [PATCH 50/70] NFSd: Use the session->se_client in lookup_clientid() Christoph Hellwig
2014-05-07 20:18                                                                                                     ` Bruce Fields
2014-05-07 20:21                                                                                                       ` Bruce Fields
2014-05-07 19:58                                                                           ` [PATCH 37/70] NFSd: nfs4_preprocess_seqid_op should only set *stpp on success Bruce Fields
2014-05-08 19:48                                                                             ` Trond Myklebust
2014-04-19 14:50                                                                         ` [PATCH 36/70] NFSd: Add reference counting to find_stateid Christoph Hellwig
2014-04-21 15:37                                                                           ` Trond Myklebust
2014-04-19 14:41                                                                       ` [PATCH 35/70] NFSd: Slight cleanup of find_stateid() Christoph Hellwig
2014-04-21 13:31                                                                         ` Trond Myklebust
2014-04-19 15:51                                                                     ` [PATCH 34/70] NFSd: Fix atomicity of delegation counter Christoph Hellwig
2014-04-21 15:58                                                                       ` Trond Myklebust
2014-04-19 14:40                                                             ` [PATCH 30/70] NFSd: Replace delegation->dl_file with the dl_stid.sc_file Christoph Hellwig
2014-04-21 13:13                                                               ` Trond Myklebust
2014-05-05  9:01                                                             ` Christoph Hellwig
2014-05-07 19:25                                                           ` [PATCH 29/70] NFSd: Add a struct nfs4_file field to struct nfs4_stid Bruce Fields
2014-05-08 19:40                                                             ` Trond Myklebust
2014-05-09  7:34                                                               ` Christoph Hellwig
2014-05-07 19:20                                                       ` [PATCH 27/70] NFSd: Don't let the laundromat reap clients that are referenced Bruce Fields
2014-05-07 18:46                                                     ` [PATCH 26/70] NFSd: Fix delegation revocation Bruce Fields
2014-05-07 16:21                                                   ` [PATCH 25/70] NFSd: Simplify stateid management Bruce Fields
2014-04-19 14:38                                           ` [PATCH 21/70] NFSd: Get rid of the lockowner_ino_hashtbl Christoph Hellwig
2014-04-21 13:08                                             ` Trond Myklebust
2014-05-07 15:20                                       ` [PATCH 19/70] NFSd: Allow lockowners to hold several stateids Bruce Fields
2014-05-22 12:20                                         ` Jeff Layton
2014-04-19 14:35                               ` [PATCH 15/70] NFSd: Add locking to the nfs4_file->fi_fds[] array Christoph Hellwig
2014-04-21 13:01                                 ` Trond Myklebust
2014-04-21 13:14                                   ` Christoph Hellwig
2014-04-21 13:16                                     ` Christoph Hellwig
2014-05-06 23:41                       ` [PATCH 11/70] NFSd: Ensure delegation setup is safe w.r.t. break_lease() Bruce Fields
2014-05-09  0:56                         ` Trond Myklebust
2014-05-06 23:40                     ` [PATCH 10/70] NFSd: Avoid taking state_lock while holding inode lock in nfsd_break_one_deleg Bruce Fields
2014-05-09  0:50                       ` Trond Myklebust
2014-05-30 12:05                         ` Jeff Layton
2014-04-19 15:56                 ` [PATCH 08/70] nfsd4: use state_lock for delegation hashing Christoph Hellwig
2014-05-06 16:48             ` [PATCH 06/70] nfsd4: use cl_lock to synchronize all stateid idr calls Bruce Fields
2014-05-06 16:40         ` [PATCH 04/70] NFSd: Remove 'inline' designation for free_client() Bruce Fields
2014-05-06 16:37       ` [PATCH 03/70] NFSd: call rpc_destroy_wait_queue() from free_client() Bruce Fields
2014-05-06 16:37     ` [PATCH 02/70] NFSd: Move default initialisers from create_client() to alloc_client() Bruce Fields
2014-05-06 15:32   ` [PATCH 01/70] NFSd: Ensure we clear the cstate->slot in nfsd4_proc_compound Bruce Fields
2014-05-06 16:36     ` Bruce Fields
2014-04-19 15:04 ` [PATCH 00/70] NFSd lock scalability patches Christoph Hellwig
2014-04-19 20:58 ` Bruce Fields
2014-05-07 20:29   ` Bruce Fields
2014-05-08 20:16     ` Trond Myklebust
2014-04-21 15:01 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.