Changeset View
Changeset View
Standalone View
Standalone View
sys/rpc/svc.c
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base) | ||||
* nmbclusters is an int, but nmbclusters*MCLBYTES may overflow | * nmbclusters is an int, but nmbclusters*MCLBYTES may overflow | ||||
* on LP64 architectures, so cast to u_long to avoid undefined | * on LP64 architectures, so cast to u_long to avoid undefined | ||||
* behavior. (ILP32 architectures cannot have nmbclusters | * behavior. (ILP32 architectures cannot have nmbclusters | ||||
* large enough to overflow for other reasons.) | * large enough to overflow for other reasons.) | ||||
*/ | */ | ||||
pool->sp_space_high = (u_long)nmbclusters * MCLBYTES / 4; | pool->sp_space_high = (u_long)nmbclusters * MCLBYTES / 4; | ||||
pool->sp_space_low = (pool->sp_space_high / 3) * 2; | pool->sp_space_low = (pool->sp_space_high / 3) * 2; | ||||
if (IS_DEFAULT_VNET(curvnet)) { | |||||
sysctl_ctx_init(&pool->sp_sysctl); | sysctl_ctx_init(&pool->sp_sysctl); | ||||
if (sysctl_base) { | if (sysctl_base) { | ||||
SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"minthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | "minthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | ||||
pool, 0, svcpool_minthread_sysctl, "I", | pool, 0, svcpool_minthread_sysctl, "I", | ||||
"Minimal number of threads"); | "Minimal number of threads"); | ||||
SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"maxthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | "maxthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | ||||
pool, 0, svcpool_maxthread_sysctl, "I", | pool, 0, svcpool_maxthread_sysctl, "I", | ||||
"Maximal number of threads"); | "Maximal number of threads"); | ||||
SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"threads", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, | "threads", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, | ||||
pool, 0, svcpool_threads_sysctl, "I", | pool, 0, svcpool_threads_sysctl, "I", | ||||
"Current number of threads"); | "Current number of threads"); | ||||
SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"groups", CTLFLAG_RD, &pool->sp_groupcount, 0, | "groups", CTLFLAG_RD, &pool->sp_groupcount, 0, | ||||
"Number of thread groups"); | "Number of thread groups"); | ||||
SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_used", CTLFLAG_RD, | "request_space_used", CTLFLAG_RD, | ||||
&pool->sp_space_used, | &pool->sp_space_used, | ||||
"Space in parsed but not handled requests."); | "Space in parsed but not handled requests."); | ||||
SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_used_highest", CTLFLAG_RD, | "request_space_used_highest", CTLFLAG_RD, | ||||
&pool->sp_space_used_highest, | &pool->sp_space_used_highest, | ||||
"Highest space used since reboot."); | "Highest space used since reboot."); | ||||
SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_high", CTLFLAG_RW, | "request_space_high", CTLFLAG_RW, | ||||
&pool->sp_space_high, | &pool->sp_space_high, | ||||
"Maximum space in parsed but not handled requests."); | "Maximum space in parsed but not handled requests."); | ||||
SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_low", CTLFLAG_RW, | "request_space_low", CTLFLAG_RW, | ||||
&pool->sp_space_low, | &pool->sp_space_low, | ||||
"Low water mark for request space."); | "Low water mark for request space."); | ||||
SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_throttled", CTLFLAG_RD, | "request_space_throttled", CTLFLAG_RD, | ||||
&pool->sp_space_throttled, 0, | &pool->sp_space_throttled, 0, | ||||
"Whether nfs requests are currently throttled"); | "Whether nfs requests are currently throttled"); | ||||
SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_throttle_count", CTLFLAG_RD, | "request_space_throttle_count", CTLFLAG_RD, | ||||
&pool->sp_space_throttle_count, 0, | &pool->sp_space_throttle_count, 0, | ||||
"Count of times throttling based on request space has occurred"); | "Count of times throttling based on request space has occurred"); | ||||
} | |||||
bz: This will hide the sysctls from the vnet jails as opposed to make them read-only but available? | |||||
Done Inline ActionsYea, I wasn't sure what to do with these. I did it this way because I didn't know how to rmacklem: Yea, I wasn't sure what to do with these.
They are in the krpc, so really don't apply to nfs… | |||||
} | } | ||||
return pool; | return pool; | ||||
} | } | ||||
/* | /* | ||||
* Code common to svcpool_destroy() and svcpool_close(), which cleans up | * Code common to svcpool_destroy() and svcpool_close(), which cleans up | ||||
* the pool data structures. | * the pool data structures. | ||||
▲ Show 20 Lines • Show All 1,300 Lines • Show Last 20 Lines |
This will hide the sysctls from the vnet jails as opposed to make them read-only but available? Which version do we really need?