net: qrtr: Change port insertion to atomic

The xa_insert function cannot be called with GFP_ATOMIC if the context
does not have preemption disabled. There was a change to make the port
insertion 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 insertion
happens within a spinlock, GFP_KERNEL cannot be used.

Change-Id: Ib09addbcaa7802bf80ddb953901e07e43c0f376e
Signed-off-by: Tony Truong <quic_truong@quicinc.com>
This commit is contained in:
Tony Truong 2022-11-28 16:19:16 -08:00
parent 7c38a3fd23
commit 8fb044e2d6

View File

@ -1577,9 +1577,9 @@ static int qrtr_port_assign(struct qrtr_sock *ipc, int *port)
in_egroup_p(GLOBAL_ROOT_GID))) {
rc = -EACCES;
} else if (*port == QRTR_PORT_CTRL) {
rc = xa_insert(&qrtr_ports, 0, ipc, GFP_KERNEL);
rc = xa_insert(&qrtr_ports, 0, ipc, GFP_ATOMIC);
} else {
rc = xa_insert(&qrtr_ports, *port, ipc, GFP_KERNEL);
rc = xa_insert(&qrtr_ports, *port, ipc, GFP_ATOMIC);
}
if (rc == -EBUSY)