Skip to contentSkip to conversation

Remove per-lock-operation nlm_lookup_host() call

PATCH In review Chuck Lever 2 participants 2 messages Jan 8, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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>

A message that is not in the archive (sent off-list or not yet received): 20080108152113.20097.96094.stgit-meopP2rzCrTwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org

#2 lore raw
Quoted 3 lines · Chuck Lever

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.

This sound like exactly the trade off we do everywhere else in the filesystem / VFS code :)