I've filed a bug about the performance of fuser(1M) (6878048: fuser
performance is suboptimal, which hasn't shown up on
bugs.opensolaris.org as I write this.)  I've also coded up a fix that
makes the performance more reasonable.  (I've requested a sponsor on
request-sponsor, but I figured I'd add more detail on this list in the
hopes of finding someone interested in picking this up.)

The data look like this:

AS segments     current         with fix
0               10.93           5.72
200000          40.08           5.73
400000          69.22           5.74
600000          98.42           5.78
800000          128.05          5.81
1000000         156.22          5.75
1200000         184.31          5.69
1400000         211.76          5.74

The problem with the current implementation is that dofusers() (the
kernel function involved) is looking at every address space segment in
every process to determine whether it matches the vnode in question.
(This is similar to what rm_assize() was doing when reading
/proc/<pid>/psinfo until the fix for 6801244 went in.)

The fix I've implemented adds a hash table to struct as to keep track
of the vnodes that have been mapped in to a process.  dofusers() walks
that hash table rather than the whole AS.  This solution is still
going to be O(number of vnodes) rather than O(1), but that seems
unavoidable.

Chad
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to