This patch makes the sizes of hash tables used by the NFSv4 server tunable.
Although I do not see any measurable performance change when the table
sizes are increased, a server under heavy NFSv4 load from several clients
may need larger hash tables for good performance. One email report of
high CPU overheads for an NFSv4 server might have been caused by small
hash tables. By making them tunable, NFSv4 server sysadmins can test larger
hash tables.
The default sizing of the hash tables is not changed by this patch.
Details
- Reviewers
kib
Tested on a small single client setup and found to be performance neutral
for that case.
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Konstantin already provided this review via email. I've pasted
it here so he doesn't need to type it again:
I cannot see anything wrong with allocating the hash tables with malloc(9).
Even if the tables are relatively large, i.e. require large contig KVA for
allocation to succeed, it is not a problem during boot, when the kmem
is not fragmented.
One thing which I note in the patch is cosmetic issue with the lc_stateid[]
variadic array. You save one malloc call by the trick of the zero-length
last member, but this is IMO not needed anymore, lc_statid may become
the normal pointer and memory allocated by the malloc(9) after struct
nfsclient is malloced.
The second revision is applied to the first. I guess I should
have submitted an entire new diff. Oh well...
fs/nfs/nfsrvstate.h | ||
---|---|---|
106 | Well, the structure is allocated large enough to If you think lc_id[0] is clearer, that's easy to change. All that is needed is a "+ 1" on the size This is normally small, so I don't think a 3rd As for u_char, it's just 8bit arbitrary bytes, so | |
fs/nfsserver/nfs_nfsdserv.c | ||
3472 | It's "+ i", where "i" is the number of non-null |