From: Chuck Lever Date: Mon, 2 Jan 2023 17:06:09 +0000 (-0500) Subject: SUNRPC: Move the server-side GSS upcall to a noinline function X-Git-Tag: v6.3-rc1~138^2~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ac5e7a6904bc23fec8ba60af686b2ed5cf027ff;p=thirdparty%2Fkernel%2Flinux.git SUNRPC: Move the server-side GSS upcall to a noinline function Since upcalls are infrequent, ensure the compiler places the upcall mechanism out-of-line from the I/O path. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index a27f924b8906b..d320ccb17a5b9 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1444,6 +1444,14 @@ static bool use_gss_proxy(struct net *net) return sn->use_gss_proxy; } +static noinline_for_stack int +svcauth_gss_proc_init(struct svc_rqst *rqstp, struct rpc_gss_wire_cred *gc) +{ + if (!use_gss_proxy(SVC_NET(rqstp))) + return svcauth_gss_legacy_init(rqstp, gc); + return svcauth_gss_proxy_init(rqstp, gc); +} + #ifdef CONFIG_PROC_FS static ssize_t write_gssp(struct file *file, const char __user *buf, @@ -1600,10 +1608,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp) switch (gc->gc_proc) { case RPC_GSS_PROC_INIT: case RPC_GSS_PROC_CONTINUE_INIT: - if (use_gss_proxy(SVC_NET(rqstp))) - return svcauth_gss_proxy_init(rqstp, gc); - else - return svcauth_gss_legacy_init(rqstp, gc); + return svcauth_gss_proc_init(rqstp, gc); case RPC_GSS_PROC_DATA: case RPC_GSS_PROC_DESTROY: /* Look up the context, and check the verifier: */