Remove per-lock-operation nlm_lookup_host() call
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | NFS: Introduce external nlm_host set-up and tear-down functionsfs/ include/ | +62 | 0 replies | |
| 2/3 | NFS: Invoke nlmclnt_init during NFS mount processingfs/ include/ | +20 | 0 replies | |
| 3/3 | NFS: Use cached nlm_host when calling nlmclnt_proc()fs/ fs/ fs/ +1 more | +14 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] Remove per-lock-operation nlm_lookup_host() call
Hi Trond-
Calling nlm_lookup_host() during each NLM operation is a lot of overhead. The nlm_lookup_host() function grabs the nlm_host_mutex, serializing NLM operations and generating extra CPU invalidations on SMP systems.
The nlm_lookup_host() function can also trigger nlm_host garbage collection, and reorders the global nlm_host chain after every successful nlm_host lookup, resulting in extraneous memory write traffic.
In addition, nlmclnt_proc() pokes around in the NFS inode and in the NFS client's rpc_xprt struct, both of which are layering violations that we can and should avoid.
The new architecture pins an nlm_host structure to each NFS client superblock that has the "lock" mount option set. The client passes in the pinned nlm_host structure during each call to nlmclnt_proc(). NFS client unmount processing "puts" the nlm_host so it can be garbage- collected later.
By pinning an nlm_host for each mount point, we trade the overhead of looking up or creating a fresh nlm_host struct during every NLM procedure call for a little extra memory space utilization.
Please consider these patches for 2.6.25.
Sidebar: there are only a few remaining references to the internals of NFS inodes in the client-side NLM code. The only references I found are related to extracting or comparing the inode's file handle via NFS_FH(). One is in nlmclnt_grant(); the other is in nlmclnt_setlockargs().
Signature · 1 line
corporate: <chuck dot lever at oracle dot com>