From 8e0779d50291cb9db0936677d66c7419502e3047 Mon Sep 17 00:00:00 2001 From: Chris Lew Date: Wed, 30 Mar 2022 13:38:48 -0700 Subject: [PATCH] net: qrtr: Change port allocation to atomic The xa_alloc_cyclic function cannot be called with GFP_ATOMIC if the context does not have preemption disabled. There was a change to make the port allocation structure synchronize with rcu and therefore was no longer protected with spinlocks. Using RCUs lead to a performance degredation so spinlock synchronization was reinstated. Now that port allocation happens within a spinlock, GFP_KERNEL cannot be used. Change-Id: I2178e190a73a949423d7c7ece1af92ab173e176d Signed-off-by: Chris Lew --- net/qrtr/af_qrtr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index 733042b96491..dbae3a819bb2 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -1472,7 +1472,7 @@ static int qrtr_port_assign(struct qrtr_sock *ipc, int *port) if (!*port) { rc = xa_alloc_cyclic(&qrtr_ports, port, ipc, QRTR_EPH_PORT_RANGE, &qrtr_ports_next, - GFP_KERNEL); + GFP_ATOMIC); } else if (*port < QRTR_MIN_EPH_SOCKET && !(capable(CAP_NET_ADMIN) || in_egroup_p(AID_VENDOR_QRTR) ||