]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: avoid work queue scheduling if possible
authorFlorian Westphal <fw@strlen.de>
Wed, 26 Feb 2020 09:14:51 +0000 (10:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 04:46:26 +0000 (20:46 -0800)
commit7905840d2f4e2eed7183dea12d8994fdaf1367a8
tree87979d44054a051fdc13afd8b36474c4ced32f6a
parentbc03507eaf6d467c84e57805d30ef680928028b7
mptcp: avoid work queue scheduling if possible

We can't lock_sock() the mptcp socket from the subflow data_ready callback,
it would result in ABBA deadlock with the subflow socket lock.

We can however grab the spinlock: if that succeeds and the mptcp socket
is not owned at the moment, we can process the new skbs right away
without deferring this to the work queue.

This avoids the schedule_work and hence the small delay until the
work item is processed.

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c
net/mptcp/protocol.h
net/mptcp/subflow.c