Date: Tue, 19 Feb 2019 10:40:35 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r344275 - stable/11/sys/rpc/rpcsec_gss Message-ID: <201902191040.x1JAeZ3E068202@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Tue Feb 19 10:40:35 2019 New Revision: 344275 URL: https://svnweb.freebsd.org/changeset/base/344275 Log: MFC r342114: Add kern.rpc.gss.client_max, to make it possible to bump it easily. This can drastically lower the load on gssd(8) on large NFS servers. Modified: stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:28:59 2019 (r344274) +++ stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:40:35 2019 (r344275) @@ -168,9 +168,22 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 +u_int svc_rpc_gss_client_max = CLIENT_MAX; + +SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); +SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); + +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFLAG_RW, + &svc_rpc_gss_client_max, 0, + "Max number of rpc-gss clients"); + +static u_int svc_rpc_gss_client_count; +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, + &svc_rpc_gss_client_count, 0, + "Number of rpc-gss clients"); + struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; struct svc_rpc_gss_client_list svc_rpc_gss_clients; -static size_t svc_rpc_gss_client_count; static uint32_t svc_rpc_gss_next_clientid = 1; static void @@ -666,7 +679,7 @@ svc_rpc_gss_timeout_clients(void) */ sx_xlock(&svc_rpc_gss_lock); client = TAILQ_LAST(&svc_rpc_gss_clients, svc_rpc_gss_client_list); - while (svc_rpc_gss_client_count > CLIENT_MAX && client != NULL) { + while (svc_rpc_gss_client_count > svc_rpc_gss_client_max && client != NULL) { svc_rpc_gss_forget_client_locked(client); sx_xunlock(&svc_rpc_gss_lock); svc_rpc_gss_release_client(client);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902191040.x1JAeZ3E068202>